source: trunk/packages/invirt-dev/invirt-build-release @ 2415

Last change on this file since 2415 was 2371, checked in by broder, 15 years ago

Use a descriptive variable name, instead of $REPLY.

  • Property svn:executable set to *
File size: 2.0 KB
RevLine 
[16]1#!/bin/bash
[1863]2distribution=hardy
[1486]3svnuri="$(invirt-getconf svn.uri)"
[10]4
5set -e
[1671]6if  [ $# -eq 0 ] ; then
7        echo " usage: invirt-build-release package_name [package_name [...]]"
[10]8        exit 1
9fi
10
[1671]11for package; do
12    rm -rf build-release/$package
13    svn export $svnuri/trunk/packages/$package build-release/$package
14    cd build-release/$package
15   
[1860]16    eval $(perl -ne 'print if s/^(Version|Source|Distribution): /\1=/' \
17             <(dpkg-parsechangelog))
[1671]18    dpkg-buildpackage -us -uc -rfakeroot -S
19    cd ..
[2370]20    arch_any=0
[2371]21    sed -ne 's/^Architecture: //p' ${Source}_${Version}.dsc | while read arch; do
22        case "$arch" in
[2370]23            all)
24                ;;
25            any)
26                arch_any=1;;
27            *)
28                echo "invirt-build-release: arch '$Architecture' unimplemented" >&2
29                exit 1;;
30        esac
31    done
32    if [ $arch_any -eq 0 ]; then
33        sbuild -d $distribution --arch-all   ${Source}_${Version}.dsc
34    else
[2320]35        sbuild -d $distribution --arch amd64 --arch-all ${Source}_${Version}.dsc
[2370]36        sbuild -d $distribution --arch i386  ${Source}_${Version}.dsc
37    fi
[1859]38
[1671]39    if ! svn ls $svnuri/package_tags/$Source >/dev/null 2>&1; then
40        svn mkdir $svnuri/package_tags/$Source \
41            -m "Create package tags directory"
42    fi
43    if ! svn ls $svnuri/package_tags/$Source/$Version >/dev/null 2>&1; then
44        svn cp $svnuri/trunk/packages/$package $svnuri/package_tags/$Source/$Version \
45            -m "Tag $Version of $Source"
46    else
47        echo "$(basename $0): tag already exists, not making again"
48    fi
49   
50    [ $Distribution = 'unstable' ] \
[1860]51        || echo "$(basename $0): warning: Distribution is $Distribution, script expects unstable"
[1671]52    changesfile=`pwd`/${Source}_*${Version}*.changes
53    for i in $changesfile; do
54        reprepro-env include unstable $i
[1860]55        reprepro-env copy stable unstable $(sed -ne 's/^Binary: //p' $i)
[1671]56    done
[1860]57    reprepro-env copy stable unstable $Source
[1671]58   
59    cd ..
[1860]60    rm -rf build-release/$package
[1172]61done
Note: See TracBrowser for help on using the repository browser.