Upgrading the Debian source package to a new upstream version
-------------------------------------------------------------

The following commands can be useful for updating the source package
to a new upstream version:

gbp clone --pristine-tar https://salsa.debian.org/debian/tboot
cd tboot
gbp import-orig --pristine-tar --uscan
dch -i
git commit debian/changelog
gpgsplit --uncompress ../tboot-$(dpkg-parsechangelog -SVersion|cut -d "-" -f1).tar.gz.gpg
gpgsplit 000001-008.uncompressed
(echo "-----BEGIN PGP SIGNATURE-----"; echo; base64 < 000003-002.sig; echo=; echo; echo "-----END PGP SIGNATURE-----") > ../tboot_$(dpkg-parsechangelog -SVersion|cut -d "-" -f1).orig.tar.gz.asc
rm -f 000002-011.plaintext 000003-002.sig 000001-004.onepass_sig 000001-008.uncompressed
rm 0000*
gbp buildpackage -S
sudo pbuilder build ../tboot_$(dpkg-parsechangelog -SVersion).dsc
lintian -EvIL +pedantic /var/cache/pbuilder/result/tboot_$(dpkg-parsechangelog -SVersion)_amd64.changes

sudo autopkgtest-build-qemu unstable ~/autopkgtest-unstable.img
autopkgtest ././../tboot_$(dpkg-parsechangelog -SVersion).dsc -- qemu ~/autopkgtest-unstable.img

curl -s -o ~/autopkgtest-setup "https://raw.githubusercontent.com/lindi2/baremetal/master/contrib/autopkgtest-setup"
chmod a+x ~/autopkgtest-setup
virt_server="ssh --setup-script $HOME/autopkgtest-setup https://baremetal.lindi.dy.fi $HOME/.baremetal_apikey"
autopkgtest --test-name=reboot-with-tpm1-bios ././../tboot_$(dpkg-parsechangelog -SVersion).dsc -- $virt_server --machine bios --template debian_11_bios
autopkgtest --test-name=reboot-with-tpm2-efi ././../tboot_$(dpkg-parsechangelog -SVersion).dsc -- $virt_server --machine uefi --template debian_11_uefi
