]> git.donarmstrong.com Git - neurodebian.git/blobdiff - tools/nd_backport
Fix little buggy introduced by recent little fixes for typos ;-)
[neurodebian.git] / tools / nd_backport
index 039b1f42169f5ab3ab64f1c91c30af981d2815fe..3392d6504300d83bdce31384b149b8ef1dcc6fc9 100755 (executable)
@@ -1,16 +1,11 @@
 #!/bin/bash
 
-family=$1
-dist=$2
+release=$1
+dscfile=$2
 
 set -e
 
-if [ -z "$family" ]; then
-  echo "You need to provide a distribution family ('debian', 'ubuntu'); prefix with 'nd+' to enable the NeuroDebian repository."
-  exit 1
-fi
-
-if [ -z "$dist" ]; then
+if [ -z "$release" ]; then
   echo "You need to provide a distribution codename (e.g. 'lenny', 'squeeze')."
   exit 1
 fi
@@ -19,14 +14,14 @@ fi
 set -e
 set -u
 
-if [ -z "$3" ]; then
+if [ -z "$2" ]; then
 cat << EOT
 Script to backport a source package to some target release.
 
 Synopsis
 --------
 
-  nd_backport <family> <codename> <dsc file>
+  nd_backport <codename> <dsc file>
 
 EOT
 exit 1
@@ -34,11 +29,10 @@ fi
 
 . /home/neurodebian/neurodebian.git/tools/nd_cmdsettings.sh
 
-DEBEMAIL="pkg-exppsy-maintainers@lists.alioth.debian.org"
+DEBEMAIL="team@neuro.debian.net"
 DEBFULLNAME="NeuroDebian Maintainers"
 export DEBEMAIL DEBFULLNAME
 
-dscfile=$3
 srcname=${dscfile%%_*}
 srcversion=${dscfile#*_}
 srcversion=${srcversion%%.dsc}
@@ -51,7 +45,7 @@ echo "Extracting source package to: $sdir"
 
 dpkg-source -x $dscfile $sdir
 
-echo "Backporting to: $family $dist"
+echo "Backporting to: $release"
 
 changelog_entry="Backport of Debian package version $srcversion for \
 NeuroDebian. Problems with the backport should be reported to the
@@ -60,11 +54,14 @@ NeuroDebian maintainers and not to the original Debian maintainer."
 echo | debchange \
          --noconf --force-bad-version \
          -c $sdir/debian/changelog \
-         -D neurodebian \
-         -b -l "~${dist}.nd" \
+         -D ${release} \
+         -b -l "~${release}.nd" \
          $changelog_entry
 
+bpversion=$(dpkg-parsechangelog -l$sdir/debian/changelog | egrep '^Version: ' | cut -d ' ' -f 2,2)
 dpkg-source -b $sdir
 
 # cleanup
 rm -rf $wdir
+
+echo ${srcname}_$bpversion.dsc