Changeset 2297 for trunk/third/common


Ignore:
Timestamp:
Apr 25, 2009, 6:45:29 PM (16 years ago)
Author:
broder
Message:

Tear out anything that says "Debathena" and replace it with "Invirt"

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/third/common/invirtificator.sh

    r2296 r2297  
    1 # Interface: define variables name, daversionappend, and function
     1# Interface: define variables name, ivversionappend, and function
    22# hack_package ().
    33
    44set -e
    5 
    6 : ${DEBATHENA_APT=/mit/debathena/apt}
    75
    86# Process arguments.
     
    1917dist=$(echo "$dist_arch" | sed 's/^\(.*\)-\([^-]*\)$/\1/')
    2018arch=$(echo "$dist_arch" | sed 's/^\(.*\)-\([^-]*\)$/\2/')
    21 : ${section=debathena-system}
    22 : ${daname=$name}
     19: ${section=invirt-system}
     20: ${ivname=$name}
    2321: ${release=-proposed}
    24 . /mit/debathena/bin/debian-versions.sh
    25 tag=$(gettag $dist)
    2622
    2723# Create a chroot and define functions for using it.
     
    4541        dch "$@"
    4642    else
    47         echo | dch -v"${daversion}" -D unstable "$@"
     43        echo | dch -v"${ivversion}" -D unstable "$@"
    4844        dch_done=1
    4945    fi
     
    5854}
    5955
    60 add_debathena_provides () {
    61     [ "$name" = "$daname" ]
    62     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
    63     add_changelog "Provide debathena-$name."
     56add_invirt_provides () {
     57    [ "$name" = "$ivname" ]
     58    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
     59    add_changelog "Provide invirt-$name."
    6460}
    6561
    6662rename_source () {
    67     perl -pe "s{^Source: $name\$}{Source: $daname}" -i debian/control
    68     add_changelog "Rename package to $daname."
    69     perl -0pe "s/^$name/$daname/" -i debian/changelog
     63    perl -pe "s{^Source: $name\$}{Source: $ivname}" -i debian/control
     64    add_changelog "Rename package to $ivname."
     65    perl -0pe "s/^$name/$ivname/" -i debian/changelog
    7066}
    7167
     
    7571        return
    7672    fi
    77     echo "Building source for $daname-$daversion on $dist_arch" >&2
     73    echo "Building source for $ivname-$ivversion on $dist_arch" >&2
    7874   
    7975    if ! [ -e "${name}_$version.dsc" ]; then
     
    8177    fi
    8278   
    83     if ! [ -e "${daname}_$daversion.dsc" ]; then
     79    if ! [ -e "${ivname}_$ivversion.dsc" ]; then
    8480        (
    85             tmpdir=$(mktemp -td "debathenify.$$.XXXXXXXXXX")
     81            tmpdir=$(mktemp -td "invirtify.$$.XXXXXXXXXX")
    8682            trap 'rm -rf "$tmpdir"' EXIT
    8783            origversion=$(echo "$version" | sed 's/-[^-]*$//')
     
    9389            dch_done=
    9490            hack_package
    95             if [ "$name" != "$daname" ]; then
     91            if [ "$name" != "$ivname" ]; then
    9692                rename_source
    97                 cp -a "$tmpdir/${name}_$origversion.orig.tar.gz" "$tmpdir/${daname}_$origversion.orig.tar.gz"
    98                 cp -a "$tmpdir/${daname}_$origversion.orig.tar.gz" "$dscdir"
     93                cp -a "$tmpdir/${name}_$origversion.orig.tar.gz" "$tmpdir/${ivname}_$origversion.orig.tar.gz"
     94                cp -a "$tmpdir/${ivname}_$origversion.orig.tar.gz" "$dscdir"
    9995            fi
    10096            [ -n "$dch_done" ]
    10197            schr apt-get -q -y install devscripts pbuilder
    10298            schr /usr/lib/pbuilder/pbuilder-satisfydepends
    103             sch debuild -S -sa -us -uc -i -I.svn && cp -a "../${daname}_$daversion"* "$dscdir"
     99            sch debuild -S -sa -us -uc -i -I.svn && cp -a "../${ivname}_$ivversion"* "$dscdir"
    104100        )
    105101        [ $? -eq 0 ] || exit 1
    106102       
    107         if [ -n "$DA_CHECK_DIFFS" ]; then
    108             interdiff -z "${name}_$version.diff.gz" "${daname}_$daversion.diff.gz" | \
     103        if [ -n "$IV_CHECK_DIFFS" ]; then
     104            interdiff -z "${name}_$version.diff.gz" "${ivname}_$ivversion.diff.gz" | \
    109105                enscript --color --language=ansi --highlight=diffu --output=- -q | \
    110106                less -R
     
    116112
    117113cmd_binary () {
    118     sbuildhack "$dist_arch" $a "${daname}_$daversion.dsc"
     114    sbuildhack "$dist_arch" $a "${ivname}_$ivversion.dsc"
    119115}
    120116
     
    125121
    126122cmd_upload () {
    127     REPREPRO="v reprepro -Vb $DEBATHENA_APT"
    128     REPREPROI="$REPREPRO --ignore=wrongdistribution --ignore=missingfield"
    129 
    130123    if [ "$a" = "-A" ]; then
    131         $REPREPROI include "${dist}${release}" "${daname}_${daversion}_source.changes"
     124        v reprepro-env include "${dist}${release}" "${ivname}_${ivversion}_source.changes"
    132125    fi
    133     $REPREPROI include "${dist}${release}" "${daname}_${daversion}${tag}_${arch}.changes"
     126    v reprepro-env include "${dist}${release}" "${ivname}_${ivversion}_${arch}.changes"
    134127}
    135128
     
    139132        version='~~~'
    140133        while read -r newversion; do
    141             if [ $(expr "$newversion" : '.*debathena') = 0 ] && \
     134            if [ $(expr "$newversion" : '.*invirt') = 0 ] && \
    142135                dpkg --compare-versions "$newversion" '>' "$version"; then
    143136                version=$newversion
     
    151144        )
    152145    )
    153 daversion=$version$daversionappend
     146ivversion=$version$ivversionappend
    154147
    155148# Look for binary packages built from the named package with the right
     
    158151# Source: or a Package: header matching $name since there is no
    159152# Source: header for a package whose name matches its source.
    160 pkgfiles="$DEBATHENA_APT/dists/$dist/$section/binary-$arch/Packages.gz $DEBATHENA_APT/dists/${dist}-proposed/$section/binary-$arch/Packages.gz"
    161 if { zcat $pkgfiles | \
    162     dpkg-awk -f - "Package:^$daname\$" "Version:^$(quote "$daversion$tag")\$" -- Architecture;
     153pkgfile="/srv/repository/dists/$dist/$section/binary-$arch/Packages.gz"
     154if { zcat "$pkgfile" | \
     155    dpkg-awk -f - "Package:^$ivname\$" "Version:^$(quote "$ivversion")\$" -- Architecture;
    163156    zcat $pkgfiles | \
    164     dpkg-awk -f - "Source:^$daname\$" "Version:^$(quote "$daversion$tag")\$" -- Architecture; } \
     157    dpkg-awk -f - "Source:^$ivname\$" "Version:^$(quote "$ivversion")\$" -- Architecture; } \
    165158    | if [ "$a" = "-A" ]; then cat; else fgrep -vx 'Architecture: all'; fi \
    166159    | grep -q .; then
    167     echo "$daname $daversion already exists for $dist_arch." >&2
     160    echo "$ivname $ivversion already exists for $dist_arch." >&2
    168161    exit 0
    169162fi
Note: See TracChangeset for help on using the changeset viewer.