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

Revision 23568, 3.2 KB checked in by broder, 16 years ago (diff)
Change -dev to -development in the daupload scripts.
  • Property svn:executable set to *
RevLine 
[22687]1#!/bin/sh
2set -e
3
[22688]4# Usage: daupload-release [-A] [-S] CHANGESFILE
[23553]5#        daupload-proposed [-A] [-S] CHANGESFILE
6#        daupload-dev [-A] [-S] CHANGESFILE
[22688]7
8# After a package has been built for all Debian/Ubuntu versions and
9# platforms (typically using "da sbuildhack DSCFILE"), this script
[23553]10# uploads the package into the release, proposed, or beta apt
11# repository.  If -A is specified, only one architecture per
12# Debian/Ubuntu version is uploaded.  If -S is specified, only the
13# source package is uploaded.
[22688]14
15# Upon completion, moves all of the generated files into the "built"
16# subdirectory.
17
[23072]18# This script will skip dists listed in ./nobuild.
19
[22740]20: ${DEBATHENA_APT=/mit/debathena/apt}
[22748]21. $(dirname "$0")/debian-versions.sh
[22700]22
[22687]23case "$(basename "$0")" in
24    daupload-release)
[23553]25        release=""
[22687]26        ;;
[23553]27    daupload-proposed)
28        release="-proposed"
[22687]29        ;;
[23553]30    daupload-dev)
[23568]31        release="-development"
[23553]32        ;;
[22687]33    *)
[23553]34        echo "Unknown release." >&2
[22687]35        exit 1
36        ;;
37esac
38
39v () {
40    echo "$@"
41    "$@"
42}
43
44A=0
45if [ "$1" = "-A" ]; then A=1; shift; fi
46S=0
47if [ "$1" = "-S" ]; then S=1; shift; fi
48
49change=$1
50cd "$(dirname "$change")"
51change=$(basename "$change")
[22730]52base=${change%_source.changes}
[22687]53
54check () {
55    [ -s "$1" ] || missing="$missing$1 "
56}
57uncheck () {
58    ! [ -s "$1" ] || missing="$missing-$1 "
59}
60
[23072]61# If ./nobuild exists, filter out its contents from DEBIAN_CODES.
62if [ -e nobuild ]; then
63    newcodes=
64    for code in $DEBIAN_CODES; do
65        if ! fgrep -q "$code" nobuild; then
66            newcodes="$newcodes $code"
67        fi
68    done
69    DEBIAN_CODES=$newcodes
70fi
71
[22687]72missing=
73[ -s "$change" ]
74if [ $S -ne 1 ]; then
[22739]75    for code in $DEBIAN_CODES; do
[22977]76        tag=$(gettag "$code")
77        check "${base}${tag}_amd64.changes"
[22739]78    done
[22687]79    if [ $A -eq 1 ]; then
[22739]80        for code in $DEBIAN_CODES; do
[22977]81            tag=$(gettag "$code")
82            uncheck "${base}${tag}_i386.changes"
[22739]83        done
[22687]84    else
[22739]85        for code in $DEBIAN_CODES; do
[22977]86            tag=$(gettag "$code")
87            check "${base}${tag}_i386.changes"
[22739]88        done
[22687]89    fi
90fi
91
92if [ -n "$missing" ]; then
93    echo "Missing $missing" >&2
94    echo -n "Continue? [y/N]"
95    read a
96    [ "$a" = "y" ]
97fi
98
[23553]99REPREPRO="v reprepro -Vb $DEBATHENA_APT"
[22687]100REPREPROI="$REPREPRO --ignore=wrongdistribution"
101
[22739]102for code in $DEBIAN_CODES; do
[23553]103    $REPREPROI include "${code}${release}" "$change"
[22739]104done
[22687]105
106if [ $S -ne 1 ]; then
[22739]107    for code in $DEBIAN_CODES; do
[22977]108        tag=$(gettag "$code")
[23553]109        [ $A -eq 1 ] || $REPREPROI include "${code}${release}" "${base}${tag}_i386.changes"
110        $REPREPROI include "${code}${release}" "${base}${tag}_amd64.changes"
[22739]111    done
[22687]112fi
113
114changes=$change
[22751]115for code in $DEBIAN_CODES; do
[22977]116    tag=$(gettag "$code")
117    [ $A -eq 1 ] || changes=$changes\ "${base}${tag}"_i386.changes
118    changes=$changes\ "${base}${tag}"_amd64.changes
[22739]119done
[22687]120
121files=${change%.changes}.build\ $changes
122origfiles=
123for change in $changes; do
124    files=$files\ $(perl -0ne '$_ =~ /\nFiles: *\n(( [^\n]*\n)*)/; print $1;' "$change" | awk '{print $5}' | grep -v '\.orig\.tar\.gz$' || :)
125    origfiles=$origfiles\ $(perl -0ne '$_ =~ /\nFiles: *\n(( [^\n]*\n)*)/; print $1;' "$change" | awk '{print $5}' | grep '\.orig\.tar\.gz$' || :)
126done
127
128built=built/
129[ -d "$built" ] || mkdir "$built"
130mv -i $files "$built"
131if [ -n "$origfiles" ]; then
132    for orig in $origfiles; do
133        [ -e "$built/$orig" ] || cp -ai "$orig" "$built/"
134    done
135fi
Note: See TracBrowser for help on using the repository browser.