source: trunk/debathena/scripts/da @ 22977

Revision 22977, 1.7 KB checked in by broder, 16 years ago (diff)
Desupport Sarge - the new version of sbuild doesn't play nice with sarge, and we don't care enough to fix it
  • 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
18. $(dirname "$0")/debian-versions.sh
19
20A=0
21if [ "$1" = -A ]; then A=1; shift; fi
22prog="$1"; shift
23succ=
24fail=
25
26# Display a horizontal rule on stderr.
27hr () {
28    for i in $(seq 60); do echo -n '═' >&2; done; echo >&2
29}
30
31# Run $prog with the provided arguments, with display annotations and
32# success/failure tracking.
33t () {
34    while true; do
35        tput bold >&2
36        hr
37        echo "Running: $prog $@" >&2
38        tput sgr0 >&2
39        if $prog "$@"; then
40            succ=$succ\ $1
41            break
42        else
43            tput bold >&2
44            tput setf 4; echo -n "Failed: " >&2
45            tput sgr0 >&2
46            echo -n "$prog $@ [a/R/f] " >&2
47            read -r x || exit $?
48            if [ "$x" = "a" ]; then exit 1; fi
49            if [ "$x" = "f" ]; then fail=$fail\ $1 break; fi
50        fi
51    done
52    echo >&2
53}
54
55for code in $DEBIAN_CODES; do
56    t "$code"-amd64 -A "$@"
57    [ $A -eq 1 ] || t "$code"-i386 "$@"
58done
59
60tput bold >&2
61hr
62echo "Done: $prog \$dist $@" >&2
63tput setf 2 >&2; echo -n "Succeeded:" >&2
64tput sgr0 >&2; echo "$succ" >&2
65if [ -n "$fail" ]; then
66    tput bold >&2; tput setf 4 >&2; echo -n "Failed:" >&2
67    tput sgr0 >&2; echo "$fail" >&2
68    exit 1
69fi
70exit 0
Note: See TracBrowser for help on using the repository browser.