From 2574e70a3086267f655a6c23add7d5d285ee5e5c Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Thu, 5 Jul 2012 08:21:31 +0000 Subject: Do not use a global PKG variable git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@535 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede --- build-tor-sources | 48 ++++++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/build-tor-sources b/build-tor-sources index 33cc929..fc89c09 100755 --- a/build-tor-sources +++ b/build-tor-sources @@ -28,6 +28,7 @@ set -e SKIP_HARDY=0 assert_files_dont_exist () { + local pkg="$1"; shift local debian_version="$1"; if [ -z "$debian_version" ]; then echo "assert_files_dont_exist called without debian_version" >&2 @@ -103,24 +104,27 @@ remove_apparmor() { } bp1() { + local pkg="$1"; shift local dir="$1"; shift local sid_debian_version="$1"; shift local dist="$1"; shift - dpkg-source -x ${PKG}_$sid_debian_version.dsc + dpkg-source -x ${pkg}_$sid_debian_version.dsc (cd $dir; backport $dist) } bp2() { + local pkg="$1"; shift local dir="$1"; shift local origtar="$1"; shift local debian_version=$(get_debian_version $dir) - assert_files_dont_exist $debian_version + assert_files_dont_exist $pkg $debian_version dpkg-source -b $dir $origtar rm -r $dir } backport_all() { + local pkg="$1"; shift local dir="$1"; shift local origtar="$1"; shift local sid_debian_version="$1"; shift @@ -131,57 +135,57 @@ backport_all() { # LENNY ################################################# - bp1 $dir $sid_debian_version lenny + bp1 $pkg $dir $sid_debian_version lenny (cd $dir; hardening_backport 0) (cd $dir; remove_apparmor) - bp2 $dir $origtar + bp2 $pkg $dir $origtar # SQUEEZE ################################################# - bp1 $dir $sid_debian_version squeeze + bp1 $pkg $dir $sid_debian_version squeeze (cd $dir; remove_apparmor) - bp2 $dir $origtar + bp2 $pkg $dir $origtar # WHEEZY ################################################# - bp1 $dir $sid_debian_version wheezy - bp2 $dir $origtar + bp1 $pkg $dir $sid_debian_version wheezy + bp2 $pkg $dir $origtar # HARDY (EOL: April 2013) ################################################# if [ -z "${SKIP_HARDY:-}" ] || [ "${SKIP_HARDY:-}" -eq 0 ]; then - bp1 $dir $sid_debian_version hardy + bp1 $pkg $dir $sid_debian_version hardy (echo "/Conflicts:"; echo d; echo i; echo "Conflicts: libssl0.9.8 (<< 0.9.8g-4ubuntu3.1)"; echo . ; echo w) | ed "$dir/debian/control" (cd $dir; dch "Conflict with libssl0.9.8 (<< 0.9.8g-4ubuntu3.1) on hardy") # hardy's dpkg-parsechangelog cannot deal with dots in the distribution field, remove them. (cd $dir; dch --force-distribution --distribution "$(dpkg-parsechangelog | grep-dctrl -n -s Distribution '' | tr -d .)" '') (cd $dir; hardening_backport 0) (cd $dir; remove_apparmor) - bp2 $dir $origtar + bp2 $pkg $dir $origtar fi # LUCID (EOL: April 2015) ################################################# - bp1 $dir $sid_debian_version lucid + bp1 $pkg $dir $sid_debian_version lucid (cd $dir; remove_apparmor) - bp2 $dir $origtar + bp2 $pkg $dir $origtar # NATTY (EOL: October 2012) ################################################# - bp1 $dir $sid_debian_version natty + bp1 $pkg $dir $sid_debian_version natty (cd $dir; remove_apparmor) - bp2 $dir $origtar + bp2 $pkg $dir $origtar # ONEIRIC (EOL: April 2013) ################################################# - bp1 $dir $sid_debian_version oneiric + bp1 $pkg $dir $sid_debian_version oneiric (cd $dir; remove_apparmor) - bp2 $dir $origtar + bp2 $pkg $dir $origtar # PRECISE (EOL: April 2017) ################################################# - bp1 $dir $sid_debian_version precise - bp2 $dir $origtar + bp1 $pkg $dir $sid_debian_version precise + bp2 $pkg $dir $origtar ################################################# @@ -190,8 +194,8 @@ backport_all() { # SQUEEZE-BPO ################################################# - bp1 $dir $sid_debian_version squeeze-bpo - bp2 $dir $origtar + bp1 $pkg $dir $sid_debian_version squeeze-bpo + bp2 $pkg $dir $origtar mkdir bpo mv *'~bpo'* bpo/ @@ -258,7 +262,7 @@ main() { debian_version=$(get_debian_version $dir) sid_debian_version="$debian_version" - assert_files_dont_exist $debian_version + assert_files_dont_exist $pkg $debian_version dpkg-source -b $dir $origtar rm -r $dir @@ -274,7 +278,7 @@ main() { cd ../.. - backport_all "$dir" "$origtar" "$sid_debian_version" + backport_all "$pkg" "$dir" "$origtar" "$sid_debian_version" echo echo "All done" -- cgit v1.2.3