Add do-fedora-bot.sh
[bin.git] / debian-backport-cockpit
1 #!/bin/sh
2 set -eu
3 PACKAGE=${1:-cockpit}
4
5 series_ver() {
6     ver=$(wget -q -O- http://ftp.debian.org/debian/dists/${1}/main/source/Sources.xz | xz -d | grep-dctrl -n -sVersion -XP $PACKAGE | sort -u | tail -n1)
7     ver=${ver%~bpo*}
8 }
9
10 upload() {
11     cat ../${PACKAGE}*_source.changes
12
13     read -p "Upload? [y/N] " answer
14     if [ "$answer" = y ]; then
15         dput ../${PACKAGE}_*_source.changes
16     fi
17
18     cd ..
19     rm *bpo*
20     rm -r ${PACKAGE}-*
21 }
22
23 mkdir /tmp/backport
24 cd  /tmp/backport
25 apt-get source $PACKAGE
26 cd ${PACKAGE}-*
27
28 # bullseye
29 series_ver bullseye-backports
30 [ ! -x debian/adjust-for-release ] || debian/adjust-for-release bullseye
31 dch --local ~bpo11+ --distribution bullseye-backports --force-distribution "No-change backport to Debian Bullseye"
32 dpkg-buildpackage -S -sd -nc -v$ver
33 upload