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