1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
|
#!/bin/bash
#
# Simple frontend for backport-dsc to do it the NeuroDebian way
#
set -e
release=$1
dscfile=$2
if [ -z "$release" ]; then
echo "You need to provide a distribution codename (e.g. 'lenny', 'squeeze')."
exit 1
fi
if [ -z "$2" ]; then
cat << EOT
Script to backport a source package to some target release.
Synopsis
--------
nd_backport <codename> <dsc file>
EOT
exit 1
fi
set -u
if echo "$release" | grep -q "^ndall.*"; then
echo "I: backporting to be uploaded for all releases"
if [ "$release" = ndall ]; then
# TODO: move to configuration
release=buster # current stable
else
release=${release##*-}
fi
version_suffix=ndall
else
version_suffix=$(nd_querycfg "release backport ids" "$release")
fi
upstream_name=${dscfile%%_*}
# To overcome bash desire to claim empty array unbound under 'set -u'
# above, lets just specify empty rule for sed when nothing to be done
mod_control=""
if [ "$upstream_name" != "neurodebian" ]; then
# Avoid injection into neurodebian package itself
mod_control='s/\(^Depends:\) */\1 neurodebian-popularity-contest, /g'
fi
# assemble an appropriate backport-dsc call
backport-dsc \
--maint-name "NeuroDebian Maintainers" \
--maint-email "team@neuro.debian.net" \
--target-distribution "$release" \
--version-suffix "$version_suffix" \
--mod-control "$mod_control" \
"$dscfile"
|