Changeset 2300 for trunk/third/common
- Timestamp:
- Apr 25, 2009, 8:52:51 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/third/common/invirtificator.sh
r2297 r2300 4 4 set -e 5 5 6 # Process arguments. 7 dist_arch=$1; shift 8 a= 9 if [ "$1" = "-A" ]; then a=-A; shift; fi 10 chroot=$dist_arch-sbuild 6 dist=hardy 7 chroot=$dist-amd64 11 8 12 if [ -z "$dist_arch" -o $# -eq 0 ]; then13 echo 'No arguments!' >&214 exit 215 fi16 17 dist=$(echo "$dist_arch" | sed 's/^\(.*\)-\([^-]*\)$/\1/')18 arch=$(echo "$dist_arch" | sed 's/^\(.*\)-\([^-]*\)$/\2/')19 9 : ${section=invirt-system} 20 10 : ${ivname=$name} 21 : ${release= -proposed}11 : ${release=unstable} 22 12 23 13 # Create a chroot and define functions for using it. … … 66 56 } 67 57 58 find_arch () { 59 if grep -iq '^Architecture: all' "${ivname}_$ivfilever.dsc"; then 60 a=-A 61 fi 62 } 63 68 64 cmd_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 74 66 75 if ! [ -e "${name}_$ version.dsc" ]; then67 if ! [ -e "${name}_$filever.dsc" ]; then 76 68 sch apt-get -d source "$name" 77 69 fi 78 70 79 if ! [ -e "${ivname}_$iv version.dsc" ]; then71 if ! [ -e "${ivname}_$ivfilever.dsc" ]; then 80 72 ( 81 73 tmpdir=$(mktemp -td "invirtify.$$.XXXXXXXXXX") 82 74 trap 'rm -rf "$tmpdir"' EXIT 83 origversion=$(echo "$ version" | sed 's/-[^-]*$//')75 origversion=$(echo "$filever" | sed 's/-[^-]*$//') 84 76 cp -a "${name}_$origversion.orig.tar.gz" "$tmpdir/" 85 77 dscdir=$(pwd) 86 78 cd "$tmpdir/" 87 dpkg-source -x "$dscdir/${name}_$ version.dsc" "$tmpdir/$name-$origversion"79 dpkg-source -x "$dscdir/${name}_$filever.dsc" "$tmpdir/$name-$origversion" 88 80 cd "$tmpdir/$name-$origversion" 89 81 dch_done= … … 97 89 schr apt-get -q -y install devscripts pbuilder 98 90 schr /usr/lib/pbuilder/pbuilder-satisfydepends 99 sch debuild -S -sa -us -uc -i -I.svn && cp -a "../${ivname}_$iv version"* "$dscdir"91 sch debuild -S -sa -us -uc -i -I.svn && cp -a "../${ivname}_$ivfilever"* "$dscdir" 100 92 ) 101 93 [ $? -eq 0 ] || exit 1 102 94 103 95 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" | \ 105 97 enscript --color --language=ansi --highlight=diffu --output=- -q | \ 106 98 less -R … … 112 104 113 105 cmd_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 115 114 } 116 115 … … 121 120 122 121 cmd_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" 125 128 fi 126 v reprepro-env include "${dist}${release}" "${ivname}_${ivversion}_${arch}.changes"127 129 } 128 130 … … 146 148 ivversion=$version$ivversionappend 147 149 150 filever=$(echo "$version" | perl -pe 's/([^:]*:)?//') 151 ivfilever=$(echo "$ivversion" | perl -pe 's/([^:]*:)?//') 152 148 153 # Look for binary packages built from the named package with the right 149 154 # version, and exit out if we find one (an architecture-specific one … … 151 156 # Source: or a Package: header matching $name since there is no 152 157 # 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"| \158 pkgfiles="/srv/repository/dists/$release/$section/binary-*/Packages.gz" 159 if { zcat $pkgfiles | \ 155 160 dpkg-awk -f - "Package:^$ivname\$" "Version:^$(quote "$ivversion")\$" -- Architecture; 156 161 zcat $pkgfiles | \ … … 158 163 | if [ "$a" = "-A" ]; then cat; else fgrep -vx 'Architecture: all'; fi \ 159 164 | grep -q .; then 160 echo "$ivname $ivversion already exists for $dist_arch." >&2165 echo "$ivname $ivversion already exists." >&2 161 166 exit 0 162 167 fi
Note: See TracChangeset
for help on using the changeset viewer.