Skip to content
Bofu Chen edited this page Sep 20, 2020 · 32 revisions

Notes

  1. Add .buildinfo into local dev repository manually

    • .buildinfo is incuded in a changes file, so you will need it when running dput with a changes.
      • E.g., you want to migrate a package from distro1 to distro2, and you do not have the original source packages on hand.
    • .buildinfo is not included in a public repository by default because
      • It's only used for verifying that package is not modified manually, so it's secure.
      • It's not necessary for downloading binary or source package (.dsc).
      • So if you do not preserve it, you might have a trouble when running dput in the future.

Build BerryNet deb

  • Steps to upgrade from 3.8.0 to 3.9.0 release for gbp repo.

    # 0. Setup ~/.gbp.conf
    $ cat ~/.gbp.conf 
    [DEFAULT]
    pristine-tar = True
    
    # 1. Create upstream release
    #     Remember to update the version in setup.py
    $ git tag -a v3.9.0
    $ git push --tags
    
    # 2. Create Debian release
    #     Don't worry to make any mistake.
    #     The worst case is to delete the entire build-dir.
    $ cd <build-dir>
    $ gbp clone --pristine-tar --debian-branch=debian/sid git@github.com:DT42/BerryNet.git
    $ cd BerryNet
    # Scan and download the upstream tarball
    $ uscan
    $ gbp import-orig --pristine-tar ../berrynet_3.9.0.orig.tar.gz
    What is the upstream version? [3.9.0] 
    gbp:info: Importing '../berrynet_3.9.0.orig.tar.gz' to branch 'upstream'...
    gbp:info: Source package is berrynet
    gbp:info: Upstream version is 3.9.0
    gbp:info: Merging to 'debian/sid'
    gbp:info: Successfully imported version 3.9.0 of ../berrynet_3.9.0.orig.tar.gz
    
    # Notes
    #     1. Debsign will be applied, so ensure the author information is yours.
    #     2. Keep UNRELEASED.
    $ gbp dch
    # Commit log message: New upstream release
    $ git commit -a -s
    $ gbp buildpackage
    
    # Verify package.
    #
    # If you find that you need to update / modify the package,
    # repeat the steps below until everything is ready.
    $ debclean
    $ gbp buildpackage
    
    $ gbp dch --release --auto
    # Commit log message: <version> release
    $ git commit -a -s
    $ debclean
    $ gbp buildpackage --git-tag
    ...
    gbp:info: Tagging 3.9.0-1 as debian/3.9.0-1
    
    # Update the debianization and tags to BerryNet repo
    $ git push
    $ git push --tags
    

Setup Development Repository

mini-dinstall

Please use the following command to update the repo

$ mini-dinstall -v --no-db -b -c .mini-dinstall.conf

It is needed to put a sign script /tmp/sign-release.sh

#!/bin/sh

rm -f Release.gpg
echo "PASSWORD" | gpg --no-tty --batch --passphrase-fd=0 --default-key BDC8D74E641C2BC34632A5F3AB62C67FC0C4CC4C --detach-sign -o Release.gpg "$1"

Working Flow

  1. Sign changes file and push package to local dev repository

    $ debsign -m"BerryNet" <package-changes>
    $ dput berrynet <package-changes>
    
  2. Copy the changes to git-to-s3 working directory (git-to-s3/git_to_s3_temp/).

  3. Push updates (packages and repo meta) to public repository (hosted on S3) by git-to-s3

    # Create repository meta files (run all the steps on gc).
    $ cp <berrynet-packages> <tmp-dir>
    $ dput bn-{distribution} <changes-file>  # repeat for all distributions
    
    # integrate with git-to-s3/berrynet.md
    $ cd git-to-s3
    # dir structure in git_to_s3_temp needs to be the same as on S3
    # distribution candidates: staging, stretch (deprecated), buster, xenial (deprecating), bionic
    $ mkdir -p git_to_s3_temp/<distribution>
    $ cp <repo-diffs> git_to_s3_temp/<distribution>
    $ python3 git_to_s3.py
    

Delete or Replace Package

This demand should not happen. Here are the steps if you really need to do this:

  1. Delete source and binary packages in directory.

  2. Re-generate repository files

    --no-db is necessary or package replacement. If you remove a package and dput a new one w/ the same version, <distro>.db will not be updated, and the generated Package will contain the incorrect package information (e.g. Package still contains the old dependency info, instead of the updated one).

    Of course, a better way is to bump package's Debian version, instead of replacing it w/ the same version.

    $ mini-dinstall --no-db -b -c <mini-dinstall-conf>
    
  3. Delete source and binary packages from S3.

Migrate Model Packages for A New Codename

  1. Download the source package (.tar.xz and .dsc) of a model, including

    • .dsc
    • .tar.gz
  2. Unpack the source package.

     $ dpkg-source -x <package-name-version>.dsc
     $ cd <package-name-version>
     $ debuild -kBDC8D74E641C2BC34632A5F3AB62C67FC0C4CC4C
     $ cd ..
    
  3. Check the existence of the binary package of the model, including

    • .build
    • .buildinfo
    • .changes
    • .deb
  4. Put the source and binary packages to local repository.

     $ dput bn-focal <package-name-version>.changes
    
  5. Copy the repository updates to the git-to-s3 working directory, including

    • the source package
    • the binary package
    • the updated repository files
  6. Upload updates to S3.

     $ cd ~/berrynet-repo/focal
     $ cp -a by-hash Contents-* InRelease Release* Packages* Sources* <package-name-version>* ~/codes/BerryNet-repo/git-to-s3/git_to_s3_temp/focal
     $ cd ~/codes/BerryNet-repo/git-to-s3/
     $ python3 git_to_s3.py
    
  7. Check if the new binary package is available on the BerryNet repository.

     $ sudo apt update
     $ apt-cache policy <package-name>