Revision 22687,
1.2 KB
checked in by ghudson, 17 years ago
(diff) |
Snapshot scripts from /mit/debathena/bin and
/mit/debathena/machines/awesome-build-server.
|
-
Property svn:executable set to
*
|
Line | |
---|
1 | #!/bin/bash |
---|
2 | |
---|
3 | if [ -e debian/changelog ]; then |
---|
4 | debian=debian |
---|
5 | elif [ "$(basename "$PWD")" = debian ] && [ -e changelog ]; then |
---|
6 | debian=. |
---|
7 | else |
---|
8 | echo "Cannot find debian/changelog." >&2 |
---|
9 | exit 1 |
---|
10 | fi |
---|
11 | |
---|
12 | package=$(head -n1 "$debian/changelog" | sed -n 's/^\([^ ]*\).*$/\1/ p') |
---|
13 | version=$(head -n1 "$debian/changelog" | sed -n 's/^[^ ]* (\([^)]*\)).*$/\1/ p') |
---|
14 | if [ -z "$package" ] || [ -z "$version" ]; then |
---|
15 | echo "Invalid debian/changelog." >&2 |
---|
16 | fi |
---|
17 | |
---|
18 | dch_opts=() |
---|
19 | |
---|
20 | newversion=$( |
---|
21 | newversion=$version |
---|
22 | dpkg-awk -f <(zcat /mit/debathena/apt*/dists/*/*/source/Sources.gz) \ |
---|
23 | 'Package:^'"$package"'$' -- Version | \ |
---|
24 | sed -n 's/Version: // p' | \ |
---|
25 | ( |
---|
26 | while read aptversion; do |
---|
27 | if dpkg --compare-versions "$aptversion" '>=' "$newversion"; then |
---|
28 | newversion=$( |
---|
29 | echo "$aptversion" | \ |
---|
30 | sed -n 's/debathena\([0-9]*\)/ \1/ p' | \ |
---|
31 | ( |
---|
32 | if read -r base darelease; then |
---|
33 | echo "${base}debathena$(($darelease + 1))" |
---|
34 | else |
---|
35 | echo "${aptversion}debathena1" |
---|
36 | fi |
---|
37 | ) |
---|
38 | ) |
---|
39 | fi |
---|
40 | done |
---|
41 | echo "$newversion" |
---|
42 | ) |
---|
43 | ) |
---|
44 | |
---|
45 | if [ "$newversion" != "$version" ]; then |
---|
46 | echo "Changing version to $newversion" |
---|
47 | dch_opts+=(--newversion "$newversion" --distribution unstable) |
---|
48 | fi |
---|
49 | |
---|
50 | dch "${dch_opts[@]}" "$@" |
---|
Note: See
TracBrowser
for help on using the repository browser.