Revision 22688,
1.4 KB
checked in by ghudson, 17 years ago
(diff) |
Add leading comments documenting (hopefully correctly) the scripts
snapshotted from /mit/debathena/bin.
* debathena/scripts/dadch,
debathena/scripts/clean-schroot,
debathena/scripts/da,
debathena/scripts/daequivsupload,
debathena/scripts/upgrade-schroot,
debathena/scripts/daupload-release,
debathena/scripts/sbuildhack,
debathena/scripts/all-schroots: Comment.
|
-
Property svn:executable set to
*
|
Rev | Line | |
---|
[22687] | 1 | #!/bin/bash |
---|
| 2 | |
---|
[22688] | 3 | # Usage: dadch |
---|
| 4 | |
---|
| 5 | # Wrapper around dch for Debathena. Increments the version number |
---|
| 6 | # according to Debathena rules if the current version has been |
---|
| 7 | # released, and leaves it alone otherwise. |
---|
| 8 | |
---|
[22687] | 9 | if [ -e debian/changelog ]; then |
---|
| 10 | debian=debian |
---|
| 11 | elif [ "$(basename "$PWD")" = debian ] && [ -e changelog ]; then |
---|
| 12 | debian=. |
---|
| 13 | else |
---|
| 14 | echo "Cannot find debian/changelog." >&2 |
---|
| 15 | exit 1 |
---|
| 16 | fi |
---|
| 17 | |
---|
| 18 | package=$(head -n1 "$debian/changelog" | sed -n 's/^\([^ ]*\).*$/\1/ p') |
---|
| 19 | version=$(head -n1 "$debian/changelog" | sed -n 's/^[^ ]* (\([^)]*\)).*$/\1/ p') |
---|
| 20 | if [ -z "$package" ] || [ -z "$version" ]; then |
---|
| 21 | echo "Invalid debian/changelog." >&2 |
---|
| 22 | fi |
---|
| 23 | |
---|
| 24 | dch_opts=() |
---|
| 25 | |
---|
| 26 | newversion=$( |
---|
| 27 | newversion=$version |
---|
| 28 | dpkg-awk -f <(zcat /mit/debathena/apt*/dists/*/*/source/Sources.gz) \ |
---|
| 29 | 'Package:^'"$package"'$' -- Version | \ |
---|
| 30 | sed -n 's/Version: // p' | \ |
---|
| 31 | ( |
---|
| 32 | while read aptversion; do |
---|
| 33 | if dpkg --compare-versions "$aptversion" '>=' "$newversion"; then |
---|
| 34 | newversion=$( |
---|
| 35 | echo "$aptversion" | \ |
---|
| 36 | sed -n 's/debathena\([0-9]*\)/ \1/ p' | \ |
---|
| 37 | ( |
---|
| 38 | if read -r base darelease; then |
---|
| 39 | echo "${base}debathena$(($darelease + 1))" |
---|
| 40 | else |
---|
| 41 | echo "${aptversion}debathena1" |
---|
| 42 | fi |
---|
| 43 | ) |
---|
| 44 | ) |
---|
| 45 | fi |
---|
| 46 | done |
---|
| 47 | echo "$newversion" |
---|
| 48 | ) |
---|
| 49 | ) |
---|
| 50 | |
---|
| 51 | if [ "$newversion" != "$version" ]; then |
---|
| 52 | echo "Changing version to $newversion" |
---|
| 53 | dch_opts+=(--newversion "$newversion" --distribution unstable) |
---|
| 54 | fi |
---|
| 55 | |
---|
| 56 | dch "${dch_opts[@]}" "$@" |
---|
Note: See
TracBrowser
for help on using the repository browser.