[[newversion]]
=== New upstream release

If a package *foo* is properly packaged in the modern ``*3.0 (native)*'' or ``*3.0 (quilt)*'' formats, packaging a new upstream release is essentially moving the old *debian/* directory to the new source. This can be done by running the ``*tar -xvzf* '/path/to/foo_oldversion'*.debian.tar.gz*'' command in the new extracted source. footnote:[If a *foo* package is packaged in the old *1.0* format, this can be done by running the ``*zcat* '/path/to/foo_oldversion'*.diff.gz|patch -p1*'' command in the new extracted source, instead.] Of course, you need to do some obvious chores.

There are several tools to handle this situation.  After updating to the new upstream release with these tools, please make sure to describe concisely the changes in the new upstream release that fix reported bugs and close those bugs by adding ``*Closes: #*'bug_number''' in the *debian/changelog* file.

[[uupdate]]
==== uupdate + tarball

You can automatically update to the new upstream source with the *uupdate* command from the *devscripts* package.  It requires to have the old Debian source package and the new upstream tarball.

----
 $ wget https://example.org/foo/foo-newversion.tar.gz
 $ cd foo-oldversion
 $ uupdate -v newversion ../foo-newversion.tar.gz
 ...
 $ cd ../foo-newversion
 $ while dquilt push; do dquilt refresh; done
 $ dch
----

[[uscan]]
==== uscan

You can automatically update to the new upstream source with the *uscan* command from the *devscripts* package.  It requires to have the old Debian source package and the *debian/watch* file in it.

----
 $ cd foo-oldversion
 $ uscan
 ...
 $ while dquilt push; do dquilt refresh; done
 $ dch
----

[[gbp-orig]]
==== gbp

You can automatically update to the new upstream source with the ``*gbp import-orig --pristine-tar*'' command from the *git-buildpackage* package.  It requires to have the old Debian source in the git repository and the new upstream tarball.

----
 $ ln -sf foo-newversion.tar.gz foo_newversion.orig.tar.gz
 $ cd foo-vcs
 $ git checkout master
 $ gbp pq import
 $ git checkout master
 $ gbp import-orig --pristine-tar  ../foo_newversion.orig.tar.gz
 ...
 $ gbp pq rebase
 $ git checkout master
 $ gbp pq export
 $ gbp pq drop
 $ git add debian/patches
 $ dch -v <newversion>
 $ git commit -a -m "Refresh patches"
----

TIP:  If upstream uses the git repository, please also use *--upstream-vcs-tag* option for the *gbp import-orig* command.

[[gbp-uscan]]
==== gbp + uscan

You can automatically update to the new upstream source with the ``*gbp import-orig --pristine-tar --uscan*'' command from the *git-buildpackage* package.  It requires to have the old Debian source in the git repository and the *debian/watch* file in it.

----
 $ cd foo-vcs
 $ git checkout master
 $ gbp pq import
 $ git checkout master
 $ gbp import-orig --pristine-tar --uscan
 ...
 $ gbp pq rebase
 $ git checkout master
 $ gbp pq export
 $ gbp pq drop
 $ git add debian/patches
 $ dch -v <newversion>
 $ git commit -a -m "Refresh patches"
----

TIP:  If upstream uses the git repository, please also use *--upstream-vcs-tag* option for the *gbp import-orig* command.

