Tear out anything that says "Debathena" and replace it with "Invirt"
authorEvan Broder <broder@mit.edu>
Sat, 25 Apr 2009 22:45:29 +0000 (18:45 -0400)
committerEvan Broder <broder@mit.edu>
Sat, 25 Apr 2009 22:45:29 +0000 (18:45 -0400)
svn path=/trunk/third/common/; revision=2297

invirtificator.sh

index 2e30844..1f102d4 100644 (file)
@@ -1,10 +1,8 @@
-# Interface: define variables name, daversionappend, and function
+# Interface: define variables name, ivversionappend, and function
 # hack_package ().
 
 set -e
 
 # hack_package ().
 
 set -e
 
-: ${DEBATHENA_APT=/mit/debathena/apt}
-
 # Process arguments.
 dist_arch=$1; shift
 a=
 # Process arguments.
 dist_arch=$1; shift
 a=
@@ -18,11 +16,9 @@ fi
 
 dist=$(echo "$dist_arch" | sed 's/^\(.*\)-\([^-]*\)$/\1/')
 arch=$(echo "$dist_arch" | sed 's/^\(.*\)-\([^-]*\)$/\2/')
 
 dist=$(echo "$dist_arch" | sed 's/^\(.*\)-\([^-]*\)$/\1/')
 arch=$(echo "$dist_arch" | sed 's/^\(.*\)-\([^-]*\)$/\2/')
-: ${section=debathena-system}
-: ${daname=$name}
+: ${section=invirt-system}
+: ${ivname=$name}
 : ${release=-proposed}
 : ${release=-proposed}
-. /mit/debathena/bin/debian-versions.sh
-tag=$(gettag $dist)
 
 # Create a chroot and define functions for using it.
 sid=$(schroot -b -c "$chroot")
 
 # Create a chroot and define functions for using it.
 sid=$(schroot -b -c "$chroot")
@@ -44,7 +40,7 @@ add_changelog () {
     if [ -n "$dch_done" ]; then
        dch "$@"
     else
     if [ -n "$dch_done" ]; then
        dch "$@"
     else
-       echo | dch -v"${daversion}" -D unstable "$@"
+       echo | dch -v"${ivversion}" -D unstable "$@"
        dch_done=1
     fi
 }
        dch_done=1
     fi
 }
@@ -57,16 +53,16 @@ add_build_depends () {
     perl -0pe 's/^(Build-Depends:.*(?:\n[ \t].*)*)$/$1, '"$1"'/m or die' -i debian/control
 }
 
     perl -0pe 's/^(Build-Depends:.*(?:\n[ \t].*)*)$/$1, '"$1"'/m or die' -i debian/control
 }
 
-add_debathena_provides () {
-    [ "$name" = "$daname" ]
-    perl -0pe 's/^(Package: (.*)\n(?:(?!Provides:).+\n)*)(?:Provides: (.*)\n((?:.+\n)*))?(?=\n|\z)/$1Provides: $3, debathena-$2\n$4/mg or die; s/^Provides: , /Provides: /mg' -i debian/control
-    add_changelog "Provide debathena-$name."
+add_invirt_provides () {
+    [ "$name" = "$ivname" ]
+    perl -0pe 's/^(Package: (.*)\n(?:(?!Provides:).+\n)*)(?:Provides: (.*)\n((?:.+\n)*))?(?=\n|\z)/$1Provides: $3, invirt-$2\n$4/mg or die; s/^Provides: , /Provides: /mg' -i debian/control
+    add_changelog "Provide invirt-$name."
 }
 
 rename_source () {
 }
 
 rename_source () {
-    perl -pe "s{^Source: $name\$}{Source: $daname}" -i debian/control
-    add_changelog "Rename package to $daname."
-    perl -0pe "s/^$name/$daname/" -i debian/changelog
+    perl -pe "s{^Source: $name\$}{Source: $ivname}" -i debian/control
+    add_changelog "Rename package to $ivname."
+    perl -0pe "s/^$name/$ivname/" -i debian/changelog
 }
 
 cmd_source () {
 }
 
 cmd_source () {
@@ -74,15 +70,15 @@ cmd_source () {
        echo "Not building source package for $dist_arch." >&2
        return
     fi
        echo "Not building source package for $dist_arch." >&2
        return
     fi
-    echo "Building source for $daname-$daversion on $dist_arch" >&2
+    echo "Building source for $ivname-$ivversion on $dist_arch" >&2
     
     if ! [ -e "${name}_$version.dsc" ]; then
        sch apt-get -d source "$name"
     fi
     
     
     if ! [ -e "${name}_$version.dsc" ]; then
        sch apt-get -d source "$name"
     fi
     
-    if ! [ -e "${daname}_$daversion.dsc" ]; then
+    if ! [ -e "${ivname}_$ivversion.dsc" ]; then
        (
        (
-           tmpdir=$(mktemp -td "debathenify.$$.XXXXXXXXXX")
+           tmpdir=$(mktemp -td "invirtify.$$.XXXXXXXXXX")
            trap 'rm -rf "$tmpdir"' EXIT
            origversion=$(echo "$version" | sed 's/-[^-]*$//')
            cp -a "${name}_$origversion.orig.tar.gz" "$tmpdir/"
            trap 'rm -rf "$tmpdir"' EXIT
            origversion=$(echo "$version" | sed 's/-[^-]*$//')
            cp -a "${name}_$origversion.orig.tar.gz" "$tmpdir/"
@@ -92,20 +88,20 @@ cmd_source () {
            cd "$tmpdir/$name-$origversion"
            dch_done=
            hack_package
            cd "$tmpdir/$name-$origversion"
            dch_done=
            hack_package
-            if [ "$name" != "$daname" ]; then
+            if [ "$name" != "$ivname" ]; then
                 rename_source
                 rename_source
-                cp -a "$tmpdir/${name}_$origversion.orig.tar.gz" "$tmpdir/${daname}_$origversion.orig.tar.gz"
-                cp -a "$tmpdir/${daname}_$origversion.orig.tar.gz" "$dscdir"
+                cp -a "$tmpdir/${name}_$origversion.orig.tar.gz" "$tmpdir/${ivname}_$origversion.orig.tar.gz"
+                cp -a "$tmpdir/${ivname}_$origversion.orig.tar.gz" "$dscdir"
             fi
            [ -n "$dch_done" ]
            schr apt-get -q -y install devscripts pbuilder
            schr /usr/lib/pbuilder/pbuilder-satisfydepends
             fi
            [ -n "$dch_done" ]
            schr apt-get -q -y install devscripts pbuilder
            schr /usr/lib/pbuilder/pbuilder-satisfydepends
-           sch debuild -S -sa -us -uc -i -I.svn && cp -a "../${daname}_$daversion"* "$dscdir"
+           sch debuild -S -sa -us -uc -i -I.svn && cp -a "../${ivname}_$ivversion"* "$dscdir"
        )
        [ $? -eq 0 ] || exit 1
        
        )
        [ $? -eq 0 ] || exit 1
        
-       if [ -n "$DA_CHECK_DIFFS" ]; then
-           interdiff -z "${name}_$version.diff.gz" "${daname}_$daversion.diff.gz" | \
+       if [ -n "$IV_CHECK_DIFFS" ]; then
+           interdiff -z "${name}_$version.diff.gz" "${ivname}_$ivversion.diff.gz" | \
                enscript --color --language=ansi --highlight=diffu --output=- -q | \
                less -R
            echo -n "Press Enter to continue: " >&2
                enscript --color --language=ansi --highlight=diffu --output=- -q | \
                less -R
            echo -n "Press Enter to continue: " >&2
@@ -115,7 +111,7 @@ cmd_source () {
 }
 
 cmd_binary () {
 }
 
 cmd_binary () {
-    sbuildhack "$dist_arch" $a "${daname}_$daversion.dsc"
+    sbuildhack "$dist_arch" $a "${ivname}_$ivversion.dsc"
 }
 
 v () {
 }
 
 v () {
@@ -124,13 +120,10 @@ v () {
 }
 
 cmd_upload () {
 }
 
 cmd_upload () {
-    REPREPRO="v reprepro -Vb $DEBATHENA_APT"
-    REPREPROI="$REPREPRO --ignore=wrongdistribution --ignore=missingfield"
-
     if [ "$a" = "-A" ]; then
     if [ "$a" = "-A" ]; then
-       $REPREPROI include "${dist}${release}" "${daname}_${daversion}_source.changes"
+       v reprepro-env include "${dist}${release}" "${ivname}_${ivversion}_source.changes"
     fi
     fi
-    $REPREPROI include "${dist}${release}" "${daname}_${daversion}${tag}_${arch}.changes"
+    v reprepro-env include "${dist}${release}" "${ivname}_${ivversion}_${arch}.changes"
 }
 
 version=$(
 }
 
 version=$(
@@ -138,7 +131,7 @@ version=$(
        sed -n 's/^Version: \(.*\)$/\1/ p' | (
        version='~~~'
        while read -r newversion; do
        sed -n 's/^Version: \(.*\)$/\1/ p' | (
        version='~~~'
        while read -r newversion; do
-           if [ $(expr "$newversion" : '.*debathena') = 0 ] && \
+           if [ $(expr "$newversion" : '.*invirt') = 0 ] && \
                dpkg --compare-versions "$newversion" '>' "$version"; then
                version=$newversion
            fi
                dpkg --compare-versions "$newversion" '>' "$version"; then
                version=$newversion
            fi
@@ -150,21 +143,21 @@ version=$(
        echo "$version"
        )
     )
        echo "$version"
        )
     )
-daversion=$version$daversionappend
+ivversion=$version$ivversionappend
 
 # Look for binary packages built from the named package with the right
 # version, and exit out if we find one (an architecture-specific one
 # if we weren't run with the -A flag).  We need to look for either a
 # Source: or a Package: header matching $name since there is no
 # Source: header for a package whose name matches its source.
 
 # Look for binary packages built from the named package with the right
 # version, and exit out if we find one (an architecture-specific one
 # if we weren't run with the -A flag).  We need to look for either a
 # Source: or a Package: header matching $name since there is no
 # Source: header for a package whose name matches its source.
-pkgfiles="$DEBATHENA_APT/dists/$dist/$section/binary-$arch/Packages.gz $DEBATHENA_APT/dists/${dist}-proposed/$section/binary-$arch/Packages.gz"
-if { zcat $pkgfiles | \
-    dpkg-awk -f - "Package:^$daname\$" "Version:^$(quote "$daversion$tag")\$" -- Architecture;
+pkgfile="/srv/repository/dists/$dist/$section/binary-$arch/Packages.gz"
+if { zcat "$pkgfile" | \
+    dpkg-awk -f - "Package:^$ivname\$" "Version:^$(quote "$ivversion")\$" -- Architecture;
     zcat $pkgfiles | \
     zcat $pkgfiles | \
-    dpkg-awk -f - "Source:^$daname\$" "Version:^$(quote "$daversion$tag")\$" -- Architecture; } \
+    dpkg-awk -f - "Source:^$ivname\$" "Version:^$(quote "$ivversion")\$" -- Architecture; } \
     | if [ "$a" = "-A" ]; then cat; else fgrep -vx 'Architecture: all'; fi \
     | grep -q .; then
     | if [ "$a" = "-A" ]; then cat; else fgrep -vx 'Architecture: all'; fi \
     | grep -q .; then
-    echo "$daname $daversion already exists for $dist_arch." >&2
+    echo "$ivname $ivversion already exists for $dist_arch." >&2
     exit 0
 fi
 
     exit 0
 fi