]>
pere.pagekite.me Git - homepage.git/blob - blog/images/2024-05-04-debian-snap-to-salsa.sh
3 # See also https://bugs.debian.org/804722#31
7 # Move to this Standards-Version.
12 if [ -z "$PKG" ]; then
13 echo "usage: $0 <PACKAGE>"
17 if [ -e "${PKG}-salsa" ]; then
18 echo "error: ${PKG}-salsa already exist, aborting."
22 if [ -z "ALLOWFAILURE" ] ; then
26 # Fetch every snapshotted source package. Manually loop until all
27 # transfers succeed, as 'gbp import-dscs --debsnap' do not fail on
29 until debsnap
--force -v $PKG || $ALLOWFAILURE ; do sleep 1; done
30 mkdir ${PKG}-salsa; cd ${PKG}-salsa
32 # Specify branches to override any debian/gbp.conf file present in the
33 # source package. Use DEP-14 branch layout.
35 --debian-branch=debian
/latest \
36 --upstream-branch=upstream
/latest \
37 --pristine-tar ..
/source-$PKG/*.dsc
39 # Document branch layout for gbp
40 inifile
+inifile debian
/gbp.conf
+create
+section DEFAULT
+key debian
-branch +value debian
/latest
41 inifile
+inifile debian
/gbp.conf
+section DEFAULT
+key upstream
-branch +value upstream
/latest
42 git add debian
/gbp.conf
43 git commit
-m "Added d/gbp.conf to describe branch layout." debian
/gbp.conf
45 # Add Vcs pointing to Salsa Debian project (must be manually created
47 if ! grep -q ^Vcs
- debian
/control
; then
48 awk "BEGIN { s=1 } /^\$/ { if (s==1) { print \"Vcs-Browser: https://salsa.debian.org/debian/$PKG\"; print \"Vcs-Git: https://salsa.debian.org/debian/$PKG.git\" }; s=0 } { print }" < debian
/control
> debian
/control.new
&& mv debian
/control.new debian
/control
49 git commit
-m "Updated vcs in d/control to Salsa." debian
/control
52 # Tell gbp to enforce the use of pristine-tar.
53 inifile
+inifile debian
/gbp.conf
+section DEFAULT
+key pristine
-tar +value True
54 git add debian
/gbp.conf
55 git commit
-m "Updated d/gbp.conf to enforce the use of pristine-tar." debian
/gbp.conf
57 # Update to latest Standards-Version.
58 SV
="$(grep ^Standards-Version: debian/control|awk '{print $2}')"
59 if [ $SV_LATEST != $SV ]; then
60 sed -i "s/\(Standards-Version: \)\(.*\)/\1$SV_LATEST/" debian
/control
61 git commit
-m "Updated Standards-Version from $SV to $SV_LATEST." debian
/control
64 # Sort debian control files
66 git commit
-m "Use wrap-and-sort -at for debian control files" debian
/*
68 if [ ! -e debian
/source
/format
] ; then
70 echo '3.0 (quilt)' > debian
/source
/format
71 git add debian
/source
/format
72 git commit
-m "Set Debian source package format to 3.0 (quilt)." debian
/source
/format
75 if grep -q pkg
-config debian
/control
; then
76 sed -i s
/pkg
-config/pkgconf
/ debian
/control
77 git commit
-m "Replaced obsolete pkg-config build dependency with pkgconf." debian
/control
80 if grep -q libncurses5
-dev debian
/control
; then
81 sed -i s
/libncurses5
-dev/libncurses
-dev/ debian
/control
82 git commit
-m "Replaced obsolete libncurses5-dev build dependency with libncurses-dev." debian
/control
85 lintian
-brush --no-update-changelog
87 # Create changelog entry