<a id="how-to-sponsor-an-upload"></a>

# How to sponsor an upload

Use these instructions when sponsoring an upload.

If you are interested in [sponsoring](https://documentation.ubuntu.com/project/how-ubuntu-is-made/processes/sponsorship.md#sponsorship), and have gained upload rights, you can join the [Ubuntu sponsors](https://documentation.ubuntu.com/project/how-ubuntu-is-made/concepts/glossary.md#term-Ubuntu-Sponsors) team (and [Ubuntu security sponsors](https://documentation.ubuntu.com/project/how-ubuntu-is-made/concepts/glossary.md#term-Ubuntu-Security-Sponsors)) to be notified of new requests in the [sponsorship queue](http://sponsoring-reports.ubuntu.com/). See [Path to upload rights](https://documentation.ubuntu.com/project/who-makes-ubuntu/developers/dmb-index.md#path-to-upload-rights) for details on how to apply for upload rights.

<a id="sponsor-a-package"></a>

## Sponsor a package

This is similar to uploading your own `.changes` file, except that after ensuring the upload follows all quality standards (see [How to review a merge proposal](https://documentation.ubuntu.com/project/contributors/advanced/review-a-merge-proposal.md#how-to-review-a-merge-proposal)), you sign the content of the proposing person with your key and upload it to the Ubuntu Archive instead of a PPA.

#### NOTE
These instructions assume the request for sponsorship is in the form of a [merge proposal](https://documentation.ubuntu.com/project/how-ubuntu-is-made/concepts/glossary.md#term-Merge-Proposal). See [Convert a debdiff contribution into a git-ubuntu branch](https://documentation.ubuntu.com/project/contributors/advanced/handle-git-ubuntu-uploads.md#convert-a-debdiff-contribution-into-a-git-ubuntu-branch) for guidance on working with a ‘traditional’ contribution in the form of a patch generated by the  tool.

1. Clone the package repository and change to the created directory:
   ```none
   $ git ubuntu clone <package>
   $ cd <package>
   ```
2. Add the Launchpad ID for which you’re sponsoring as a Git `remote`:
   ```none
   $ git ubuntu remote add <sponsored_LP_user>
   ```
3. Switch to the merge-proposal branch:
   ```none
   $ git checkout "<sponsoree_LP_user>/<MP_branch_name>" -b "<MP_branch_name>"
   ```
4. Generate the `orig` tarballs for the source package:
   ```none
   $ git ubuntu export-orig
   ```

   In case the upload is for a [merge](https://documentation.ubuntu.com/project/how-ubuntu-is-made/concepts/glossary.md#term-Merge), add the `--for-merge` flag:
   ```none
   $ git ubuntu export-orig --for-merge
   ```
5. Push the branch to your Launchpad namespace:
   ```none
   $ upload_args=$(git ubuntu prepare-upload args)
   ```

   This command generates arguments for the build step to include the appropriate header reference to the rich history in the `.changes` file and stores the output in the `upload_args` variable.
6. Build the source package (with arguments generated in the previous step – and stored in the `upload_args` variable – appended to the command):
   ```none
   $ debuild --build=source --no-check-builddeps \
             --unsigned-changes --unsigned-source \
             ${upload_args}
   ```

   The same command with short options:
   ```none
   $ debuild -S -d -uc -us ${upload_args}
   ```

   #### NOTE
   Use your preferred build method (`debuild`, `sbuild`, `dpkg-buildpackage`), but always append `${upload_args}`.

   In case the upload is for a [merge](https://documentation.ubuntu.com/project/how-ubuntu-is-made/concepts/glossary.md#term-Merge) in which the `changelog` has more than one entry compared to the version in the release pocket (e.g. uploading `2.0-1ubuntu1`, and the previous Ubuntu version was `1.1-1ubuntu1`), add the `-v` flag with the previous Ubuntu version to include the changelog entries between the previous Debian base and the new Debian base:
   ```none
   $ debuild -S -d -uc -us -v1.1-1ubuntu1 ${upload_args}
   ```

   When doing a merge, you’ll need to ensure that the `orig` tarball is included. You can verify if the `orig` tarball upload is required by checking the Debian changelog. If there is a new upstream version that is a part of the upload, then Launchpad will not have the `orig` tarball available. Example changelog for a tenacious upload that requires an `orig` tarball upload:
   ```none
   nfs-utils (1:3.1.1-1ubuntu1) tenacious; urgency=medium

   * Merge with Debian unstable (LP: #2171238). Remaining changes:
       - <CHANGES>

   -- Simon Poirier <simon.poirier@canonical.com>  Fri, 06 Nov 2026 19:01:40 -0500

   nfs-utils (1:3.1.1-1) unstable; urgency=medium

   * New upstream version 3.1.1
       - rpcctl: SyntaxWarning: 'return' in a 'finally' block (Closes: #1144982)
   * <CHANGES>

   -- Salvatore Bonaccorso <carnil@debian.org>  Wed, 23 Sep 2026 07:54:34 +0200

   nfs-utils (1:2.9.2-1) unstable; urgency=medium

   * New upstream version 2.9.2
   * <CHANGES>

   -- Salvatore Bonaccorso <carnil@debian.org>  Fri, 31 Jul 2026 20:49:30 +0200

   nfs-utils (1:2.9.1-1ubuntu1) stonking; urgency=medium

   * Merge with Debian unstable (LP: #2153341). Remaining changes:
       - <CHANGES>

   -- Zineb Zaadoud <zineb.zaadoud@canonical.com>  Sun, 07 Jun 2026 22:24:07 +0200
   ```

   In this case, run your source package build with `-sa` option. This is “Source All” and forces the inclusion of the `orig` tarball in the upload. Example command:
   ```none
   $ debuild -S -d -uc -us -sa -v1.1-1ubuntu1 ${upload_args}
   ```

   The resulting `.changes` has the all the required information for upload. Note that nfs-utils_3.1.1.orig.tar.xz is included.
   ```none
   Checksums-Sha1:
       578d6756e512630d648d6dbeb6ba19ae07862159 2695 nfs-utils_3.1.1-1ubuntu1.dsc
       c1f970ef2cf265e3c0eba5975666992c47c820d5 774380 nfs-utils_3.1.1.orig.tar.xz
       32b1b40f305c83e56ef702250204408e7e563629 61332 nfs-utils_3.1.1-1ubuntu1.debian.tar.xz
       5c8249bbd07c1b084a19bb3af1547c7f095b46a6 5431 nfs-utils_3.1.1-1ubuntu1_source.buildinfo
   Checksums-Sha256:
       048e1d29bd8b26165616ba5b7f68a15892271e93a7d9907bdb08dce49ab69930 2695 nfs-utils_3.1.1-1ubuntu1.dsc
       7dbc05eb8b32828b322872b759a62cb3979cb4118f344dd8616813d1390e84e0 774380 nfs-utils_3.1.1.orig.tar.xz
       988dacf82c391f10b7482c90ede54b5fb48202b1275c9e79e3dbe9689d5c140b 61332 nfs-utils_3.1.1-1ubuntu1.debian.tar.xz
       56c4116ec95d4a7870f1166d4c7124b6439949bd5300c3621a52be8b645f2738 5431 nfs-utils_3.1.1-1ubuntu1_source.buildinfo
   Files:
       308f63893ebe5a1c7422ed9f7161b460 2695 net optional nfs-utils_3.1.1-1ubuntu1.dsc
       24b69355dd92c51acc9dda7b178e1390 774380 net optional nfs-utils_3.1.1.orig.tar.xz
       248015a33bfeb2367b8e534c142932f5 61332 net optional nfs-utils_3.1.1-1ubuntu1.debian.tar.xz
       a1c2b716ccdc51b8895238f14db86df3 5431 net optional nfs-utils_3.1.1-1ubuntu1_source.buildinfo
   ```
7. Do a final check of the `.changes` file:
   ```none
   $ less <package>_<version>_source.changes
   ```

   Check that:
   * The `changelog` references the Launchpad bug to be closed by the upload.
   * For new upstream releases, the upstream `orig` tarball is included.
   * The `git-ubuntu` branch is mentioned.

   See [How to review a merge proposal](https://documentation.ubuntu.com/project/contributors/advanced/review-a-merge-proposal.md#how-to-review-a-merge-proposal) for general review details.
8. Verify the upload contents:

   It is important to verify that the upload contents are good and do not contain undesired changes, especially
   the Debian tarball that has been generated: `<package>_<version>.debian.tar.xz`, since there is no control
   of its contents on the server side.

Examples of issues you might catch may include, but are not limited to:

- Generated files that you did not intend to be in the upload, like a `debian/cscope.out` file or a `debian/control.swp` from an editor => you see them in the diff, but did not expect them
- The archive changed, your upload is not based on the most recent version => you see in diff conflicting or dropped changes
- Files from development, unused but left behind, like a `debian/patch/foo.patch` that is not in `debian/series` and therefore silently stays behind doing nothing => you see its content in the diff, but did not expect them to be part of the upload

  Assume that you would like to upload version `12.0.0-1ubuntu5.4` of the package `libvirt` to Ubuntu Resolute 26.04,
  and the latest version in the archive is `12.0.0-1ubuntu5.3`. Here are the instructions to generate the debdiff of the upload, which allows a quick cross check against what you expect from your work on git or the files directly:

  Pull the latest package from Resolute:
  ```none
  $ pull-lp-source libvirt resolute
  ```

  Run `debdiff` between the two `.dsc` files:
  ```none
  $ debdiff libvirt_12.0.0-1ubuntu5.3.dsc libvirt_12.0.0-1ubuntu5.4.dsc
  ```

  This shows the changes between `12.0.0-1ubuntu5.3` and `12.0.0-1ubuntu5.4`. It is important to make sure that
  the changes look good and there are no unexpected changes.

  To summarize the diff, you can use `diffstat`:
  ```none
  $ debdiff libvirt_12.0.0-1ubuntu5.3.dsc libvirt_12.0.0-1ubuntu5.4.dsc 2>/dev/null | diffstat
  ```

  `debdiff` will display a very large output when doing a merge. The output will include the upstream changes as well. You can use `git range-diff` if the tags have been pushed.
  ```none
  # git range-diff  old/debian..old/ubuntu new/debian..HEAD
  ```

  Note that the tags may be prepended with `lp${BUG_NUM}/`. `git range-diff` is a complex view of the history, so refer to the [documentation](https://git-scm.com/docs/git-range-diff) for more information.

1. Sign the `.changes` file:
   ```none
   $ cd ..
   $ debsign -k$DEBSIGN_KEYID <package>_<version>_source.changes
   ```
2. Upload the package:
   ```none
   $ dput ubuntu <package>_<version>_source.changes
   ```

## Signing methods

To ensure your GPG key is automatically used to sign all uploads, including sponsored ones, you can set the following in the `~/.devscripts` configuration file (see also the  manual page):

```shell
DEBUILD_DPKG_BUILDPACKAGE_OPTS="-k'Jane Packager <jpkg@example.com>' -sa"
```

For this setting to take effect, modify the `debuild` build command to omit the `-uc` and `-us` flags, which prevent signing (the same applies to builds with `dpkg-buildpackage`). For example:

```none
$ debuild -S -d ${upload_args}
```

Then do *not* run the `debsign` command.

## Further reading

* [How to handle git-ubuntu uploads](https://documentation.ubuntu.com/project/contributors/advanced/handle-git-ubuntu-uploads.md#how-to-handle-git-ubuntu-uploads)
