source: trunk/debathena/scripts/da @ 22688

Revision 22688, 1.9 KB checked in by ghudson, 16 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 *
Line 
1#!/bin/sh
2
3# Usage: da [-A] PROGRAM ARGUMENTS
4
5# Runs PROGRAM over each of the build schroot names, like so:
6#
7#   PROGRAM SCHROOTNAME ARGUMENTS
8#
9# On one architecture of each Debian/Ubuntu version, passes the -A
10# option before ARGUMENTS.  If -A is passed to this script, the
11# program only gets run over one schroot per Debian/Ubuntu version.
12# At the end of the run, the script will display which schroots the
13# command succeeded and failed for.
14
15# Typically this script is used to build Debathena packages, in which
16# case PROGRAM is sbuildhack and ARGUMENTS is a path to a .dsc file.
17
18A=0
19if [ "$1" = -A ]; then A=1; shift; fi
20prog="$1"; shift
21succ=
22fail=
23
24# Display a horizontal rule on stderr.
25hr () {
26    for i in $(seq 60); do echo -n '═' >&2; done; echo >&2
27}
28
29# Run $prog with the provided arguments, with display annotations and
30# success/failure tracking.
31t () {
32    while true; do
33        tput bold >&2
34        hr
35        echo "Running: $prog $@" >&2
36        tput sgr0 >&2
37        if $prog "$@"; then
38            succ=$succ\ $1
39            break
40        else
41            tput bold >&2
42            tput setf 4; echo -n "Failed: " >&2
43            tput sgr0 >&2
44            echo -n "$prog $@ [a/R/f] " >&2
45            read -r x || exit $?
46            if [ "$x" = "a" ]; then exit 1; fi
47            if [ "$x" = "f" ]; then fail=$fail\ $1 break; fi
48        fi
49    done
50    echo >&2
51}
52
53t sarge-i386 -A "$@"
54t dapper-amd64 -A "$@"
55[ $A -eq 1 ] || t dapper-i386 "$@"
56t edgy-amd64 -A "$@"
57[ $A -eq 1 ] || t edgy-i386 "$@"
58t etch-amd64 -A "$@"
59[ $A -eq 1 ] || t etch-i386 "$@"
60t feisty-amd64 -A "$@"
61[ $A -eq 1 ] || t feisty-i386 "$@"
62t gutsy-amd64 -A "$@"
63[ $A -eq 1 ] || t gutsy-i386 "$@"
64t lenny-amd64 -A "$@"
65[ $A -eq 1 ] || t lenny-i386 "$@"
66
67tput bold >&2
68hr
69echo "Done: $prog \$dist $@" >&2
70tput setf 2 >&2; echo -n "Succeeded:" >&2
71tput sgr0 >&2; echo "$succ" >&2
72if [ -n "$fail" ]; then
73    tput bold >&2; tput setf 4 >&2; echo -n "Failed:" >&2
74    tput sgr0 >&2; echo "$fail" >&2
75    exit 1
76fi
77exit 0
Note: See TracBrowser for help on using the repository browser.