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

Last change on this file since 1862 was 1861, checked in by price, 16 years ago

invirt-build-release: separate distribution, architecture

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