dep-14-convert: Create script to automate converting git layout to DEP-14
A script that analyzes the git layout and automatically converts it into DEP14 format with debian/latest
and upstream/latest
, as well as creates a minimal gbp.conf
if missing, and on top of that also runs salsa
commands to rename the remote branches.
If invoked without any parameters, it would merely suggest what commands to run. I plan to implement --apply
later to execute the changes, but this is safer without it now in first version.
Example output:
/tmp/tmp.mKjVFfQYsa/box64 master ± ~/debian/devscripts/scripts/dep14-compliance.sh
The git repository has the followng local branches: master upstream
In DEP14, these branches must exist in the Debian packaging repository:
* debian/latest Used to create the *.debian.tar.xz that contains the Debian
packaging code from the debian/ directory, and which is
uploaded to Debian unstable (or occasionally to experimental).
* upstream/latest Used to create the *.orig.tar.gz that contains the unmodified
source code of the specific upstream release.
* pristine-tar Optional: Contains xdelta data for making the release tarball
bit-for-bit identical with the original one, so that the
upstream *.orig.tar.gz.asc signature can be validated.
Other branches may also exist, but are not required.
-> Branch debian/latest: missing, presumably 'master' should be renamed
-> Branch upstream/latest: missing, presumably 'upstream' should be renamed
-> debian/gbp.conf configured: file missing
Run the following commands to make the repository follow DEP14:
git branch -m master debian/latest
salsa rename_branch debian/box64 --source-branch=master --dest-branch=debian/latest
salsa update_projects debian/box64 --rename-head --source-branch=master --dest-branch=debian/latest
git branch -m upstream upstream/latest
salsa rename_branch debian/box64 --source-branch=upstream --dest-branch=upstream/latest
git checkout debian/latest
echo "[DEFAULT]" > debian/gbp.conf
echo "debian-branch = debian/latest" >> debian/gbp.conf
echo "upstream-branch = upstream/latest" >> debian/gbp.conf
git add debian/gbp.conf
git commit -a -m "Update git repository layout to follow DEP14"
For accurate results, ensure your local git checkout is in sync with Salsa project debian/box64.
Edited by Otto Kekäläinen