From: Petter Reinholdtsen Date: Sat, 4 May 2024 08:07:00 +0000 (+0200) Subject: Updated migration script. X-Git-Url: https://pere.pagekite.me/gitweb/homepage.git/commitdiff_plain/2e5f50883c990105f83b7d60fdd705c45fbd3f3a?ds=sidebyside Updated migration script. --- diff --git a/blog/data/2024-04-25-debian-vcs-qa.txt b/blog/data/2024-04-25-debian-vcs-qa.txt index 4bf5fa7aec..fe4214f7e9 100644 --- a/blog/data/2024-04-25-debian-vcs-qa.txt +++ b/blog/data/2024-04-25-debian-vcs-qa.txt @@ -169,3 +169,8 @@ Perhaps you got twenty minutes to spare too?

As usual, if you use Bitcoin and want to show your support of my activities, please send Bitcoin donations to my address 15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b.

+ +

Update 2024-05-04: There is +an +updated edition of my migration script, last updated +2024-04-05.

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 index 0000000000..0a9ba17d1d --- /dev/null +++ b/blog/images/2024-05-04-debian-snap-to-salsa.sh @@ -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 " + 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