Changeset 2297 for trunk/third/common
- Timestamp:
- Apr 25, 2009, 6:45:29 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/third/common/invirtificator.sh
r2296 r2297 1 # Interface: define variables name, daversionappend, and function1 # Interface: define variables name, ivversionappend, and function 2 2 # hack_package (). 3 3 4 4 set -e 5 6 : ${DEBATHENA_APT=/mit/debathena/apt}7 5 8 6 # Process arguments. … … 19 17 dist=$(echo "$dist_arch" | sed 's/^\(.*\)-\([^-]*\)$/\1/') 20 18 arch=$(echo "$dist_arch" | sed 's/^\(.*\)-\([^-]*\)$/\2/') 21 : ${section= debathena-system}22 : ${ daname=$name}19 : ${section=invirt-system} 20 : ${ivname=$name} 23 21 : ${release=-proposed} 24 . /mit/debathena/bin/debian-versions.sh25 tag=$(gettag $dist)26 22 27 23 # Create a chroot and define functions for using it. … … 45 41 dch "$@" 46 42 else 47 echo | dch -v"${ daversion}" -D unstable "$@"43 echo | dch -v"${ivversion}" -D unstable "$@" 48 44 dch_done=1 49 45 fi … … 58 54 } 59 55 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/control63 add_changelog "Provide debathena-$name."56 add_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." 64 60 } 65 61 66 62 rename_source () { 67 perl -pe "s{^Source: $name\$}{Source: $ daname}" -i debian/control68 add_changelog "Rename package to $ daname."69 perl -0pe "s/^$name/$ daname/" -i debian/changelog63 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 70 66 } 71 67 … … 75 71 return 76 72 fi 77 echo "Building source for $ daname-$daversion on $dist_arch" >&273 echo "Building source for $ivname-$ivversion on $dist_arch" >&2 78 74 79 75 if ! [ -e "${name}_$version.dsc" ]; then … … 81 77 fi 82 78 83 if ! [ -e "${ daname}_$daversion.dsc" ]; then79 if ! [ -e "${ivname}_$ivversion.dsc" ]; then 84 80 ( 85 tmpdir=$(mktemp -td " debathenify.$$.XXXXXXXXXX")81 tmpdir=$(mktemp -td "invirtify.$$.XXXXXXXXXX") 86 82 trap 'rm -rf "$tmpdir"' EXIT 87 83 origversion=$(echo "$version" | sed 's/-[^-]*$//') … … 93 89 dch_done= 94 90 hack_package 95 if [ "$name" != "$ daname" ]; then91 if [ "$name" != "$ivname" ]; then 96 92 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" 99 95 fi 100 96 [ -n "$dch_done" ] 101 97 schr apt-get -q -y install devscripts pbuilder 102 98 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" 104 100 ) 105 101 [ $? -eq 0 ] || exit 1 106 102 107 if [ -n "$ DA_CHECK_DIFFS" ]; then108 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" | \ 109 105 enscript --color --language=ansi --highlight=diffu --output=- -q | \ 110 106 less -R … … 116 112 117 113 cmd_binary () { 118 sbuildhack "$dist_arch" $a "${ daname}_$daversion.dsc"114 sbuildhack "$dist_arch" $a "${ivname}_$ivversion.dsc" 119 115 } 120 116 … … 125 121 126 122 cmd_upload () { 127 REPREPRO="v reprepro -Vb $DEBATHENA_APT"128 REPREPROI="$REPREPRO --ignore=wrongdistribution --ignore=missingfield"129 130 123 if [ "$a" = "-A" ]; then 131 $REPREPROI include "${dist}${release}" "${daname}_${daversion}_source.changes"124 v reprepro-env include "${dist}${release}" "${ivname}_${ivversion}_source.changes" 132 125 fi 133 $REPREPROI include "${dist}${release}" "${daname}_${daversion}${tag}_${arch}.changes"126 v reprepro-env include "${dist}${release}" "${ivname}_${ivversion}_${arch}.changes" 134 127 } 135 128 … … 139 132 version='~~~' 140 133 while read -r newversion; do 141 if [ $(expr "$newversion" : '.* debathena') = 0 ] && \134 if [ $(expr "$newversion" : '.*invirt') = 0 ] && \ 142 135 dpkg --compare-versions "$newversion" '>' "$version"; then 143 136 version=$newversion … … 151 144 ) 152 145 ) 153 daversion=$version$daversionappend146 ivversion=$version$ivversionappend 154 147 155 148 # Look for binary packages built from the named package with the right … … 158 151 # Source: or a Package: header matching $name since there is no 159 152 # Source: header for a package whose name matches its source. 160 pkgfile s="$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;153 pkgfile="/srv/repository/dists/$dist/$section/binary-$arch/Packages.gz" 154 if { zcat "$pkgfile" | \ 155 dpkg-awk -f - "Package:^$ivname\$" "Version:^$(quote "$ivversion")\$" -- Architecture; 163 156 zcat $pkgfiles | \ 164 dpkg-awk -f - "Source:^$ daname\$" "Version:^$(quote "$daversion$tag")\$" -- Architecture; } \157 dpkg-awk -f - "Source:^$ivname\$" "Version:^$(quote "$ivversion")\$" -- Architecture; } \ 165 158 | if [ "$a" = "-A" ]; then cat; else fgrep -vx 'Architecture: all'; fi \ 166 159 | grep -q .; then 167 echo "$ daname $daversion already exists for $dist_arch." >&2160 echo "$ivname $ivversion already exists for $dist_arch." >&2 168 161 exit 0 169 162 fi
Note: See TracChangeset
for help on using the changeset viewer.