source: trunk/debathena/scripts/daupload-release @ 22688

Revision 22688, 5.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 *
Line 
1#!/bin/sh
2set -e
3
4# Usage: daupload-release [-A] [-S] CHANGESFILE
5#        daupload-beta [-A] [-S] CHANGESFILE
6
7# After a package has been built for all Debian/Ubuntu versions and
8# platforms (typically using "da sbuildhack DSCFILE"), this script
9# uploads the package into the release or beta apt repository.  If -A
10# is specified, only one architecture per Debian/Ubuntu version is
11# uploaded.  If -S is specified, only the source package is uploaded.
12
13# Upon completion, moves all of the generated files into the "built"
14# subdirectory.
15
16case "$(basename "$0")" in
17    daupload-release)
18        repo=/mit/debathena/apt
19        ;;
20    daupload-beta)
21        repo=/mit/debathena/apt-beta
22        ;;
23    *)
24        echo "Unknown repo." >&2
25        exit 1
26        ;;
27esac
28
29v () {
30    echo "$@"
31    "$@"
32}
33
34A=0
35if [ "$1" = "-A" ]; then A=1; shift; fi
36S=0
37if [ "$1" = "-S" ]; then S=1; shift; fi
38
39change=$1
40cd "$(dirname "$change")"
41change=$(basename "$change")
42
43check () {
44    [ -s "$1" ] || missing="$missing$1 "
45}
46uncheck () {
47    ! [ -s "$1" ] || missing="$missing-$1 "
48}
49
50missing=
51[ -s "$change" ]
52if [ $S -ne 1 ]; then
53    check "${change%_source.changes}~debian3.1_i386.changes"
54    check "${change%_source.changes}~debian4.0_amd64.changes"
55    check "${change%_source.changes}~debian4.1~0.1_amd64.changes"
56    check "${change%_source.changes}~ubuntu6.06_amd64.changes"
57    check "${change%_source.changes}~ubuntu6.10_amd64.changes"
58    check "${change%_source.changes}~ubuntu7.04_amd64.changes"
59    check "${change%_source.changes}~ubuntu7.10_amd64.changes"
60    if [ $A -eq 1 ]; then
61        uncheck "${change%_source.changes}~debian4.0_i386.changes"
62        uncheck "${change%_source.changes}~debian4.1~0.1_i386.changes"
63        uncheck "${change%_source.changes}~ubuntu6.06_i386.changes"
64        uncheck "${change%_source.changes}~ubuntu6.10_i386.changes"
65        uncheck "${change%_source.changes}~ubuntu7.04_i386.changes"
66        uncheck "${change%_source.changes}~ubuntu7.10_i386.changes"
67    else
68        check "${change%_source.changes}~debian4.0_i386.changes"
69        check "${change%_source.changes}~debian4.1~0.1_i386.changes"
70        check "${change%_source.changes}~ubuntu6.06_i386.changes"
71        check "${change%_source.changes}~ubuntu6.10_i386.changes"
72        check "${change%_source.changes}~ubuntu7.04_i386.changes"
73        check "${change%_source.changes}~ubuntu7.10_i386.changes"
74    fi
75fi
76
77if [ -n "$missing" ]; then
78    echo "Missing $missing" >&2
79    echo -n "Continue? [y/N]"
80    read a
81    [ "$a" = "y" ]
82fi
83
84REPREPRO="v reprepro -Vb $repo"
85REPREPROI="$REPREPRO --ignore=wrongdistribution"
86
87$REPREPROI include sarge "$change"
88$REPREPROI include etch "$change"
89$REPREPROI include lenny "$change"
90$REPREPROI include dapper "$change"
91$REPREPROI include edgy "$change"
92$REPREPROI include feisty "$change"
93$REPREPROI include gutsy "$change"
94
95if [ $S -ne 1 ]; then
96    $REPREPRO include sarge "${change%_source.changes}~debian3.1_i386.changes"
97    [ $A -eq 1 ] || $REPREPRO include etch "${change%_source.changes}~debian4.0_i386.changes"
98    $REPREPRO include etch "${change%_source.changes}~debian4.0_amd64.changes"
99    [ $A -eq 1 ] || $REPREPRO include lenny "${change%_source.changes}~debian4.1~0.1_i386.changes"
100    $REPREPRO include lenny "${change%_source.changes}~debian4.1~0.1_amd64.changes"
101    [ $A -eq 1 ] || $REPREPRO include dapper "${change%_source.changes}~ubuntu6.06_i386.changes"
102    $REPREPRO include dapper "${change%_source.changes}~ubuntu6.06_amd64.changes"
103    [ $A -eq 1 ] || $REPREPRO include edgy "${change%_source.changes}~ubuntu6.10_i386.changes"
104    $REPREPRO include edgy "${change%_source.changes}~ubuntu6.10_amd64.changes"
105    [ $A -eq 1 ] || $REPREPRO include feisty "${change%_source.changes}~ubuntu7.04_i386.changes"
106    $REPREPRO include feisty "${change%_source.changes}~ubuntu7.04_amd64.changes"
107    [ $A -eq 1 ] || $REPREPRO include gutsy "${change%_source.changes}~ubuntu7.10_i386.changes"
108    $REPREPRO include gutsy "${change%_source.changes}~ubuntu7.10_amd64.changes"
109fi
110
111
112changes=$change
113changes=$changes\ ${change%_source.changes}~debian3.1_i386.changes
114[ $A -eq 1 ] || changes=$changes\ ${change%_source.changes}~debian4.0_i386.changes
115changes=$changes\ ${change%_source.changes}~debian4.0_amd64.changes
116[ $A -eq 1 ] || changes=$changes\ ${change%_source.changes}~debian4.1~0.1_i386.changes
117changes=$changes\ ${change%_source.changes}~debian4.1~0.1_amd64.changes
118[ $A -eq 1 ] || changes=$changes\ ${change%_source.changes}~ubuntu6.06_i386.changes
119changes=$changes\ ${change%_source.changes}~ubuntu6.06_amd64.changes
120[ $A -eq 1 ] || changes=$changes\ ${change%_source.changes}~ubuntu6.10_i386.changes
121changes=$changes\ ${change%_source.changes}~ubuntu6.10_amd64.changes
122[ $A -eq 1 ] || changes=$changes\ ${change%_source.changes}~ubuntu7.04_i386.changes
123changes=$changes\ ${change%_source.changes}~ubuntu7.04_amd64.changes
124[ $A -eq 1 ] || changes=$changes\ ${change%_source.changes}~ubuntu7.10_i386.changes
125changes=$changes\ ${change%_source.changes}~ubuntu7.10_amd64.changes
126
127files=${change%.changes}.build\ $changes
128origfiles=
129for change in $changes; do
130    files=$files\ $(perl -0ne '$_ =~ /\nFiles: *\n(( [^\n]*\n)*)/; print $1;' "$change" | awk '{print $5}' | grep -v '\.orig\.tar\.gz$' || :)
131    origfiles=$origfiles\ $(perl -0ne '$_ =~ /\nFiles: *\n(( [^\n]*\n)*)/; print $1;' "$change" | awk '{print $5}' | grep '\.orig\.tar\.gz$' || :)
132done
133
134built=built/
135[ -d "$built" ] || mkdir "$built"
136mv -i $files "$built"
137if [ -n "$origfiles" ]; then
138    for orig in $origfiles; do
139        [ -e "$built/$orig" ] || cp -ai "$orig" "$built/"
140    done
141fi
Note: See TracBrowser for help on using the repository browser.