This module uses gbp and upstream git repository.

As of version 0.155, =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=v*' --max-count=1) | sed 's/^v//')
echo -n $VERSION
#+end_src

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][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

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

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

Note: only committed changes are used by gbp buildpackage

Update the changelog 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

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]].
