This module uses gbp and upstream git repository.

As of version 1.44.2, =pristine-tar= branch is no longer updated.

To update this package, first import the changes from upstream:
#+begin_src shell :dir .. :exports code :results verbatim
git fetch --all
#+end_src

Find the latest version:
#+NAME: version
#+begin_src shell :dir .. :exports code :results verbatim
VERSION=$(git describe --tags $(git rev-list '--tags=v1*' --max-count=1) | sed 's/^v//')
echo -n $VERSION
#+end_src

#+RESULTS: version
: 1.42.0

Update Debian's upstream branch:
#+begin_src shell :dir .. :exports code :results verbatim :var VERSION=version
git checkout upstream
git merge v$VERSION
#+end_src

Update debian/sid branch
#+begin_src shell :dir .. :exports code :results verbatim :var VERSION=version
  git checkout debian/sid
  git merge upstream
#+end_src

Update the debian/copyright file:
#+begin_src shell :dir .. :exports code :results verbatim :var VERSION=version
  cme update dpkg-copyright
#+end_src

Then review the changes and commit the result.

See also https://github.com/dod38fr/config-model/wiki/Updating-debian-copyright-file-with-cme

Generate a temporary changelog:
#+begin_src shell :dir .. :exports code :results verbatim :var VERSION=version
  gbp dch --new-version=$VERSION-1 --snapshot --auto debian/
#+end_src

Check patches (and cleanup if necessary):
#+begin_src shell :dir .. :exports code :results verbatim :var VERSION=version
  quilt push -a && quilt pop -a
#+end_src

#+RESULTS:

Commit =debian/changelog= (otherwise, =gbp buildpackage= tries to build the
old version):

#+begin_src shell :dir .. :exports code :results verbatim :var VERSION=version
  git commit -m"new upstream version" debian/changelog
#+end_src

#+RESULTS:
: [debian/sid 3569d8b0] new upstream version
:  1 file changed, 8 insertions(+)

Test the first build:
#+begin_src shell :eval no
  gbp buildpackage --git-ignore-new --git-no-purge
#+end_src

Regenerate the symbol file:

#+begin_src shell :var BUILD_DIR="../../build-area" VERSION=version :results verbatim :exports code
  cd $BUILD_DIR/libuv1-$VERSION
  dpkg-gensymbols -plibuv1
#+end_src

If you get an error with the =cd= command, redo the previous
step without forgetting the --git-no-purge flag.

Then review the diff (see links below)

See [[https://www.debian.org/doc/manuals/maint-guide/advanced.en.html#librarysymbols][Debian main guide]], [[https://qt-kde-team.pages.debian.net/symbolfiles.html][KDE symbol tool]] and [[https://www.man7.org/linux/man-pages/man1/dpkg-gensymbols.1.html][dpkg-gensymbols(1)]].

If the diff is fine, create a patch:

#+begin_src shell :var BUILD_DIR="../../build-area" VERSION=version :results none :exports code
  cd $BUILD_DIR/libuv1-$VERSION
  dpkg-gensymbols -plibuv1 |perl -p -E 's/([\d.]+)-\d[^#\n]*/$1/ if /^\+ /; s/~\d[^#\n]*//;' > /tmp/sym.patch
#+end_src

And apply the patch:

#+begin_src shell :dir ".." :results verbatim :exports code
  patch debian/libuv1.symbols /tmp/sym.patch
#+end_src

#+RESULTS:
: patching file debian/libuv1.symbols

And commit the results:

#+begin_src shell :dir ".." :results verbatim :exports code
  git add debian/libuv1.symbols
  git commit -m "update symbols file"
#+end_src

#+RESULTS:
: [debian/sid 2ecc9dd5] update symbols file
:  1 file changed, 105 insertions(+), 102 deletions(-)


You can rebuild (if needed) with the following command:

#+begin_src shell :dir ".." :results verbatim :exports code
  gbp buildpackage --git-ignore-new
#+end_src

Note: only committed changes are used by gbp buildpackage

Update the changelog to push on experimental:

#+begin_src shell :dir ".." :results verbatim :exports code
  gbp dch -Ra --commit --distribution=experimental
#+end_src

Or to push on unstable:
#+begin_src shell :dir ".." :results verbatim :exports code
  gbp dch -Ra --commit --distribution=unstable
#+end_src


Once everything is fine, build a source package and tag:

#+begin_src shell :dir ".." :results verbatim :exports code
  gbp buildpackage -S --git-tag
#+end_src

Push on salsa:

#+begin_src shell :dir ".." :results verbatim :exports code
  gbp push
#+end_src

After 1 week or so, if nobody complains, the new package can be
released in unstable (See [[https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1016305#37][#1016305]] for more context):


#+begin_src shell :dir ".." :results verbatim :exports code
  gbp dch -Ra --commit --distribution=unstable
#+end_src


For more details, see [[https://honk.sigxcpu.org/projects/git-buildpackage/manual-html/gbp.import.upstream-git.html#gbp.import.upstream.git.notarball][gbp import with git documentation]].

 -- Dominique Dumont <dod@debian.org>, Fri, 22 May 2020 18:55:50 +0200
