]>
pere.pagekite.me Git - homepage.git/blob - blog/images/2024-07-11-debian-snap-to-salsa.sh
3 # See also https://bugs.debian.org/804722#31
5 # To get install dependencies:
6 # apt install git-buildpackage devscripts \
7 # virtuoso-opensource-7-common lintian-brush
11 # Move to this Standards-Version.
16 if [ -z "$PKG" ]; then
17 echo "usage: $0 <PACKAGE>"
21 if [ -e "${PKG}-salsa" ]; then
22 echo "error: ${PKG}-salsa already exist, aborting."
26 if [ -z "ALLOWFAILURE" ] ; then
30 # Fetch every snapshotted source package. Manually loop until all
31 # transfers succeed, as 'gbp import-dscs --debsnap' do not fail on
34 until debsnap
--force -v $PKG || $ALLOWFAILURE ; do sleep 1; done
36 mkdir ${PKG}-salsa; cd ${PKG}-salsa
38 # Specify branches to override any debian/gbp.conf file present in the
39 # source package. Use DEP-14 branch layout.
41 --debian-branch=debian
/latest \
42 --upstream-branch=upstream
/latest \
43 --pristine-tar ..
/source-$PKG/*.dsc
44 # Document branch layout for gbp
45 inifile
+inifile debian
/gbp.conf
+create
+section DEFAULT
+key debian
-branch +value debian
/latest
46 inifile
+inifile debian
/gbp.conf
+section DEFAULT
+key upstream
-branch +value upstream
/latest
47 git add debian
/gbp.conf
48 git commit
-m "Added d/gbp.conf to describe branch layout." debian
/gbp.conf
50 # Add Vcs pointing to Salsa Debian project (must be manually created
52 if ! grep -q ^Vcs
- debian
/control
; then
53 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
54 git commit
-m "Updated vcs in d/control to Salsa." debian
/control
57 # Tell gbp to enforce the use of pristine-tar.
58 inifile
+inifile debian
/gbp.conf
+section DEFAULT
+key pristine
-tar +value True
59 git add debian
/gbp.conf
60 git commit
-m "Updated d/gbp.conf to enforce the use of pristine-tar." debian
/gbp.conf
62 # Update to latest Standards-Version.
63 SV
="$(grep ^Standards-Version: debian/control|awk '{print $2}')"
64 if [ $SV_LATEST != $SV ]; then
65 sed -i "s/\(Standards-Version: \)\(.*\)/\1$SV_LATEST/" debian
/control
66 git commit
-m "Updated Standards-Version from $SV to $SV_LATEST." debian
/control
69 # Sort debian control files
71 git commit
-m "Use wrap-and-sort -at for debian control files." debian
/*
73 if [ ! -e debian
/source
/format
] ; then
75 echo '3.0 (quilt)' > debian
/source
/format
76 git add debian
/source
/format
77 git commit
-m "Set Debian source package format to 3.0 (quilt)." debian
/source
/format
80 if grep -q pkg
-config debian
/control
; then
81 sed -i s
/pkg
-config/pkgconf
/ debian
/control
82 git commit
-m "Replaced obsolete pkg-config build dependency with pkgconf." debian
/control
85 if grep -q libncurses5
-dev debian
/control
; then
86 sed -i s
/libncurses5
-dev/libncurses
-dev/ debian
/control
87 git commit
-m "Replaced obsolete libncurses5-dev build dependency with libncurses-dev." debian
/control
90 if grep -q libfreetype6
-dev debian
/control
; then
91 sed -i s
/libfreetype6
-dev/libfreetype
-dev/ debian
/control
92 git commit
-m "Replaced obsolete libfreetype6-dev build dependency with libfreetype-dev." debian
/control
95 lintian
-brush --no-update-changelog
97 # Create changelog entry