From 9d5c15961776e288a1838c6ca2289eb96babee17 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Thu, 23 Jun 2022 05:58:04 +0200 Subject: [PATCH] ubuntu-backport-cockpit: Adjust for Ubuntu 22.04 Add a version query fallback for the first backport in a series. --- ubuntu-backport-cockpit | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ubuntu-backport-cockpit b/ubuntu-backport-cockpit index 6346ed5..8d46bf8 100755 --- a/ubuntu-backport-cockpit +++ b/ubuntu-backport-cockpit @@ -1,12 +1,15 @@ #!/bin/sh set -eu PACKAGE=${1:-cockpit} -TARGET=${2:-impish} +TARGET=${2:-jammy} POCKET="${TARGET}-backports" series_ver() { ver=$(wget -q -O- http://de.archive.ubuntu.com/ubuntu/dists/$1/universe/source/Sources.xz | xz -d | grep-dctrl -n -sVersion -XP $PACKAGE | sort -u | tail -n1) ver=${ver%~bpo*} + if [ -z "$ver" ]; then + ver=$(wget -q -O- http://de.archive.ubuntu.com/ubuntu/dists/${1%-*}/universe/source/Sources.xz | xz -d | grep-dctrl -n -sVersion -XP $PACKAGE | sort -u | tail -n1) + fi } upload() { @@ -28,13 +31,13 @@ apt-get source $PACKAGE cd ${PACKAGE}-* case "$TARGET" in + jammy) VER=22.04 ;; impish) VER=21.10 ;; focal) VER=20.04 ;; *) echo "Unknown target $TARGET" >&2; exit 1 ;; esac series_ver "$POCKET" -[ ! -x debian/adjust-for-release ] || debian/adjust-for-release $TARGET dch --local ~bpo${VER}. --distribution $POCKET --force-distribution "No-change backport to $TARGET" dpkg-buildpackage -S -sd -nc -v$ver upload -- 2.39.5