From fdd3b2fe73bd12a1539e85180ba7c0f9bd9078ff Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sun, 11 Mar 2012 11:03:41 +0000 Subject: Hardcode "tor" name less often git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@500 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede --- build-tor-sources | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/build-tor-sources b/build-tor-sources index 2f6fb81..9270247 100755 --- a/build-tor-sources +++ b/build-tor-sources @@ -28,6 +28,7 @@ set -x # this is hardcoded to weasel's directory layout. sorry. GITDIR="$HOME/projects/tor/tor" +PKG="tor" assert_files_dont_exist () { local debian_version="$1"; @@ -36,20 +37,20 @@ assert_files_dont_exist () { exit 1; fi - if [ -e "tor_$debian_version.diff.gz" ] ; then - echo "tor_$debian_version.diff.gz already exists" >&2 + if [ -e "${PKG}_$debian_version.diff.gz" ] ; then + echo "${PKG}_$debian_version.diff.gz already exists" >&2 exit 1; fi - if [ -e "tor_$debian_version.dsc" ] ; then - echo "tor_$debian_version.dsc already exists" >&2 + if [ -e "${PKG}_$debian_version.dsc" ] ; then + echo "${PKG}_$debian_version.dsc already exists" >&2 exit 1; fi - if [ -e "tor_$debian_version""_i386.deb" ] ; then - echo "tor_$debian_version""_i386.deb already exists" >&2 + if [ -e "${PKG}_$debian_version""_amd64.deb" ] ; then + echo "${PKG}_$debian_version""_amd64.deb already exists" >&2 exit 1; fi - if [ -e "tor_$debian_version""_i386.changes" ] ; then - echo "tor_$debian_version""_i386.changes already exists" >&2 + if [ -e "${PKG}_$debian_version""_amd64.changes" ] ; then + echo "${PKG}_$debian_version""_amd64.changes already exists" >&2 exit 1; fi } @@ -101,7 +102,7 @@ bp1() { local sid_debian_version="$1"; shift local dist="$1"; shift - dpkg-source -x tor_$sid_debian_version.dsc + dpkg-source -x ${PKG}_$sid_debian_version.dsc (cd $dir; backport $dist) } bp2() { @@ -130,11 +131,11 @@ if [ ! -e "$ORIGTAR" ] ; then exit 1; fi -if [ "${ORIGTAR#tor-}" != $ORIGTAR ]; then +if [ "${ORIGTAR#${PKG}-}" != $ORIGTAR ]; then ver="$ORIGTAR" - ver=${ver#tor-} + ver=${ver#${PKG}-} ver=${ver%.tar.gz} - neworig="tor_$ver.orig.tar.gz" + neworig="${PKG}_$ver.orig.tar.gz" if ! [ -e "$neworig" ]; then ln -v "$ORIGTAR" "$neworig" fi @@ -144,14 +145,14 @@ fi DIR=`tar tzf $ORIGTAR | head -n1` DIR="${DIR%%/}" -DIR_VERSION="${DIR##tor-}" +DIR_VERSION="${DIR##${PKG}-}" if [ -e "$DIR" ] ; then echo "$DIR already exists." >&2 exit 1; fi tar xzf $ORIGTAR git clone -n -s "$GITDIR" git-"$DIR" -TAG="debian-tor-$DIR_VERSION-$DEB_REVISION" +TAG="debian-${PKG}-$DIR_VERSION-$DEB_REVISION" (cd "git-$DIR" && git checkout $TAG) if diff -qr "git-$DIR" "$DIR" --exclude .git | grep -v '^Only in ' | grep --color .; then echo "Differenced detected." @@ -163,7 +164,7 @@ rm -rf "git-$DIR" debian_upstream_version=$(get_debian_version $DIR upstream) -if [ "$ORIGTAR" != "tor_$debian_upstream_version.orig.tar.gz" ] ; then +if [ "$ORIGTAR" != "${PKG}_$debian_upstream_version.orig.tar.gz" ] ; then echo "possible mismatch: $ORIGTAR but $debian_upstream_version in debian/changelog" >&2 exit 1; fi @@ -179,8 +180,8 @@ rm -r $DIR # local ################################################# cd local-build -dpkg-source -x ../tor_$debian_version.dsc -cd tor-$debian_upstream_version +dpkg-source -x ../${PKG}_$debian_version.dsc +cd ${PKG}-$debian_upstream_version debuild -j8 -rfakeroot -uc -us cd ../.. -- cgit v1.2.3