Changeset 2300 for trunk


Ignore:
Timestamp:
Apr 25, 2009, 8:52:51 PM (15 years ago)
Author:
broder
Message:

Make a bunch of other changes to the invirtificator:

  • Don't require it to be run twice for each architecture
  • Figure out on its own if a package is arch any or arch all
  • Deal with packages with a non-zero epoch
  • Upload to unstable instead of "hardy" - we don't have a "hardy"
File:
1 edited

Legend:

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

    r2297 r2300  
    44set -e
    55
    6 # Process arguments.
    7 dist_arch=$1; shift
    8 a=
    9 if [ "$1" = "-A" ]; then a=-A; shift; fi
    10 chroot=$dist_arch-sbuild
     6dist=hardy
     7chroot=$dist-amd64
    118
    12 if [ -z "$dist_arch" -o $# -eq 0 ]; then
    13     echo 'No arguments!' >&2
    14     exit 2
    15 fi
    16 
    17 dist=$(echo "$dist_arch" | sed 's/^\(.*\)-\([^-]*\)$/\1/')
    18 arch=$(echo "$dist_arch" | sed 's/^\(.*\)-\([^-]*\)$/\2/')
    199: ${section=invirt-system}
    2010: ${ivname=$name}
    21 : ${release=-proposed}
     11: ${release=unstable}
    2212
    2313# Create a chroot and define functions for using it.
     
    6656}
    6757
     58find_arch () {
     59    if grep -iq '^Architecture: all' "${ivname}_$ivfilever.dsc"; then
     60        a=-A
     61    fi
     62}
     63
    6864cmd_source () {
    69     if [ "$a" != "-A" ]; then
    70         echo "Not building source package for $dist_arch." >&2
    71         return
    72     fi
    73     echo "Building source for $ivname-$ivversion on $dist_arch" >&2
     65    echo "Building source for $ivname-$ivfilever on ${dist}-amd64" >&2
    7466   
    75     if ! [ -e "${name}_$version.dsc" ]; then
     67    if ! [ -e "${name}_$filever.dsc" ]; then
    7668        sch apt-get -d source "$name"
    7769    fi
    7870   
    79     if ! [ -e "${ivname}_$ivversion.dsc" ]; then
     71    if ! [ -e "${ivname}_$ivfilever.dsc" ]; then
    8072        (
    8173            tmpdir=$(mktemp -td "invirtify.$$.XXXXXXXXXX")
    8274            trap 'rm -rf "$tmpdir"' EXIT
    83             origversion=$(echo "$version" | sed 's/-[^-]*$//')
     75            origversion=$(echo "$filever" | sed 's/-[^-]*$//')
    8476            cp -a "${name}_$origversion.orig.tar.gz" "$tmpdir/"
    8577            dscdir=$(pwd)
    8678            cd "$tmpdir/"
    87             dpkg-source -x "$dscdir/${name}_$version.dsc" "$tmpdir/$name-$origversion"
     79            dpkg-source -x "$dscdir/${name}_$filever.dsc" "$tmpdir/$name-$origversion"
    8880            cd "$tmpdir/$name-$origversion"
    8981            dch_done=
     
    9789            schr apt-get -q -y install devscripts pbuilder
    9890            schr /usr/lib/pbuilder/pbuilder-satisfydepends
    99             sch debuild -S -sa -us -uc -i -I.svn && cp -a "../${ivname}_$ivversion"* "$dscdir"
     91            sch debuild -S -sa -us -uc -i -I.svn && cp -a "../${ivname}_$ivfilever"* "$dscdir"
    10092        )
    10193        [ $? -eq 0 ] || exit 1
    10294       
    10395        if [ -n "$IV_CHECK_DIFFS" ]; then
    104             interdiff -z "${name}_$version.diff.gz" "${ivname}_$ivversion.diff.gz" | \
     96            interdiff -z "${name}_$filever.diff.gz" "${ivname}_$ivfilever.diff.gz" | \
    10597                enscript --color --language=ansi --highlight=diffu --output=- -q | \
    10698                less -R
     
    112104
    113105cmd_binary () {
    114     sbuildhack "$dist_arch" $a "${ivname}_$ivversion.dsc"
     106    find_arch
     107
     108    if [ "$a" = "-A" ]; then
     109        sbuild -d "$dist" --arch-all "${ivname}_$ivfilever.dsc"
     110    else
     111        sbuild -d "$dist" --arch amd64 "${ivname}_$ivfilever.dsc"
     112        sbuild -d "$dist" --arch i386 "${ivname}_$ivfilever.dsc"
     113    fi
    115114}
    116115
     
    121120
    122121cmd_upload () {
    123     if [ "$a" = "-A" ]; then
    124         v reprepro-env include "${dist}${release}" "${ivname}_${ivversion}_source.changes"
     122    find_arch
     123
     124    v reprepro-env include "${release}" "${ivname}_${ivfilever}_source.changes"
     125    v reprepro-env include "${release}" "${ivname}_${ivfilever}_amd64.changes"
     126    if [ -z "$a" ]; then
     127        v reprepro-env include "${release}" "${ivname}_${ivfilever}_i386.changes"
    125128    fi
    126     v reprepro-env include "${dist}${release}" "${ivname}_${ivversion}_${arch}.changes"
    127129}
    128130
     
    146148ivversion=$version$ivversionappend
    147149
     150filever=$(echo "$version" | perl -pe 's/([^:]*:)?//')
     151ivfilever=$(echo "$ivversion" | perl -pe 's/([^:]*:)?//')
     152
    148153# Look for binary packages built from the named package with the right
    149154# version, and exit out if we find one (an architecture-specific one
     
    151156# Source: or a Package: header matching $name since there is no
    152157# Source: header for a package whose name matches its source.
    153 pkgfile="/srv/repository/dists/$dist/$section/binary-$arch/Packages.gz"
    154 if { zcat "$pkgfile" | \
     158pkgfiles="/srv/repository/dists/$release/$section/binary-*/Packages.gz"
     159if { zcat $pkgfiles | \
    155160    dpkg-awk -f - "Package:^$ivname\$" "Version:^$(quote "$ivversion")\$" -- Architecture;
    156161    zcat $pkgfiles | \
     
    158163    | if [ "$a" = "-A" ]; then cat; else fgrep -vx 'Architecture: all'; fi \
    159164    | grep -q .; then
    160     echo "$ivname $ivversion already exists for $dist_arch." >&2
     165    echo "$ivname $ivversion already exists." >&2
    161166    exit 0
    162167fi
Note: See TracChangeset for help on using the changeset viewer.