]> pere.pagekite.me Git - homepage.git/commitdiff
Updated migration script.
authorPetter Reinholdtsen <pere@hungry.com>
Sat, 4 May 2024 08:07:00 +0000 (10:07 +0200)
committerPetter Reinholdtsen <pere@hungry.com>
Sat, 4 May 2024 08:07:00 +0000 (10:07 +0200)
blog/data/2024-04-25-debian-vcs-qa.txt
blog/images/2024-05-04-debian-snap-to-salsa.sh [new file with mode: 0644]

index 4bf5fa7aec3c97c690bb0211867b0e9aa2833c76..fe4214f7e9c60e8e7bad02c0dca0edc31583cf99 100644 (file)
@@ -169,3 +169,8 @@ Perhaps you got twenty minutes to spare too?</p>
 <p>As usual, if you use Bitcoin and want to show your support of my
 activities, please send Bitcoin donations to my address
 <b><a href="bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b</a></b>.</p>
 <p>As usual, if you use Bitcoin and want to show your support of my
 activities, please send Bitcoin donations to my address
 <b><a href="bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b</a></b>.</p>
+
+<p><strong>Update 2024-05-04:</strong> There is
+<a href="https://people.skolelinux.org/pere/blog/images/2024-05-04-debian-snap-to-salsa.sh">an
+updated edition of my migration script</a>, last updated
+2024-04-05.</p>
diff --git a/blog/images/2024-05-04-debian-snap-to-salsa.sh b/blog/images/2024-05-04-debian-snap-to-salsa.sh
new file mode 100644 (file)
index 0000000..0a9ba17
--- /dev/null
@@ -0,0 +1,88 @@
+#!/bin/sh
+#
+# See also https://bugs.debian.org/804722#31
+
+set -e
+
+# Move to this Standards-Version.
+SV_LATEST=4.7.0
+
+PKG="$1"
+
+if [ -z "$PKG" ]; then
+    echo "usage: $0 <PACKAGE>"
+    exit 1
+fi
+
+if [ -e "${PKG}-salsa" ]; then
+    echo "error: ${PKG}-salsa already exist, aborting."
+    exit 1
+fi
+
+if [ -z "ALLOWFAILURE" ] ; then
+    ALLOWFAILURE=false
+fi
+
+# Fetch every snapshotted source package.  Manually loop until all
+# transfers succeed, as 'gbp import-dscs --debsnap' do not fail on
+# download failures.
+until debsnap --force -v $PKG || $ALLOWFAILURE ; do sleep 1; done
+mkdir ${PKG}-salsa; cd ${PKG}-salsa
+git init
+# Specify branches to override any debian/gbp.conf file present in the
+# source package.  Use DEP-14 branch layout.
+gbp import-dscs  \
+    --debian-branch=debian/latest \
+    --upstream-branch=upstream/latest \
+    --pristine-tar ../source-$PKG/*.dsc
+
+# Document branch layout for gbp
+inifile +inifile debian/gbp.conf +create +section DEFAULT +key debian-branch +value debian/latest
+inifile +inifile debian/gbp.conf +section DEFAULT +key upstream-branch +value upstream/latest
+git add debian/gbp.conf
+git commit -m "Added d/gbp.conf to describe branch layout." debian/gbp.conf
+
+# Add Vcs pointing to Salsa Debian project (must be manually created
+# and pushed to).
+if ! grep -q ^Vcs- debian/control ; then
+    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
+    git commit -m "Updated vcs in d/control to Salsa." debian/control
+fi
+
+# Tell gbp to enforce the use of pristine-tar.
+inifile +inifile debian/gbp.conf +section DEFAULT +key pristine-tar +value True
+git add debian/gbp.conf
+git commit -m "Updated d/gbp.conf to enforce the use of pristine-tar." debian/gbp.conf
+
+# Update to latest Standards-Version.
+SV="$(grep ^Standards-Version: debian/control|awk '{print $2}')"
+if [ $SV_LATEST != $SV ]; then
+    sed -i "s/\(Standards-Version: \)\(.*\)/\1$SV_LATEST/" debian/control
+    git commit -m "Updated Standards-Version from $SV to $SV_LATEST." debian/control
+fi
+
+# Sort debian control files
+wrap-and-sort -at
+git commit -m "Use wrap-and-sort -at for debian control files" debian/*
+
+if [ ! -e debian/source/format ] ; then
+    mkdir debian/source
+    echo '3.0 (quilt)' > debian/source/format
+    git add debian/source/format
+    git commit -m "Set Debian source package format to 3.0 (quilt)." debian/source/format
+fi
+
+if grep -q pkg-config debian/control; then
+    sed -i s/pkg-config/pkgconf/ debian/control
+    git commit -m "Replaced obsolete pkg-config build dependency with pkgconf." debian/control
+fi
+
+if grep -q libncurses5-dev debian/control; then
+    sed -i s/libncurses5-dev/libncurses-dev/ debian/control
+    git commit -m "Replaced obsolete libncurses5-dev build dependency with libncurses-dev." debian/control
+fi
+
+lintian-brush --no-update-changelog
+
+# Create changelog entry
+gbp dch --qa