]> git.donarmstrong.com Git - neurodebian.git/blob - tools/nd_backport
Also for stats report which repo and which job number use our setup
[neurodebian.git] / tools / nd_backport
1 #!/bin/bash
2 #
3 # Simple frontend for backport-dsc to do it the NeuroDebian way
4 #
5
6 set -e
7
8 release=$1
9 dscfile=$2
10
11 if [ -z "$release" ]; then
12   echo "You need to provide a distribution codename (e.g. 'lenny', 'squeeze')."
13   exit 1
14 fi
15
16 if [ -z "$2" ]; then
17 cat << EOT
18 Script to backport a source package to some target release.
19
20 Synopsis
21 --------
22
23   nd_backport <codename> <dsc file>
24
25 EOT
26 exit 1
27 fi
28
29 set -u
30
31 upstream_name=${dscfile%%_*}
32
33 # To overcome bash desire to claim empty array unbound under 'set -u'
34 # above, lets just specify empty rule for sed when nothing to be done
35 mod_control=""
36 if [ "$upstream_name" != "neurodebian" ]; then
37         # Avoid injection into neurodebian package itself
38         mod_control='s/\(^Depends:\) */\1 neurodebian-popularity-contest, /g'
39 fi
40
41 # assemble an appropriate backport-dsc call
42 backport-dsc \
43         --maint-name "NeuroDebian Maintainers" \
44         --maint-email "team@neuro.debian.net" \
45         --target-distribution "$release" \
46         --version-suffix "$(nd_querycfg "release backport ids" "$release")" \
47         --mod-control "$mod_control" \
48         "$dscfile"