source: trunk/debathena/scripts/daupload-proposed @ 24570

Revision 24570, 3.1 KB checked in by broder, 14 years ago (diff)
Fix a screwup in daupload-proposed
  • 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
[22748]20. $(dirname "$0")/debian-versions.sh
[22700]21
[22687]22case "$(basename "$0")" in
23    daupload-release)
[23553]24        release=""
[22687]25        ;;
[23553]26    daupload-proposed)
27        release="-proposed"
[22687]28        ;;
[23553]29    daupload-dev)
[23568]30        release="-development"
[23553]31        ;;
[22687]32    *)
[23553]33        echo "Unknown release." >&2
[22687]34        exit 1
35        ;;
36esac
37
38v () {
39    echo "$@"
40    "$@"
41}
42
43A=0
44if [ "$1" = "-A" ]; then A=1; shift; fi
45S=0
46if [ "$1" = "-S" ]; then S=1; shift; fi
47
48change=$1
49cd "$(dirname "$change")"
50change=$(basename "$change")
[22730]51base=${change%_source.changes}
[22687]52
53check () {
54    [ -s "$1" ] || missing="$missing$1 "
55}
56uncheck () {
57    ! [ -s "$1" ] || missing="$missing-$1 "
58}
59
[23072]60# If ./nobuild exists, filter out its contents from DEBIAN_CODES.
61if [ -e nobuild ]; then
62    newcodes=
63    for code in $DEBIAN_CODES; do
64        if ! fgrep -q "$code" nobuild; then
65            newcodes="$newcodes $code"
66        fi
67    done
68    DEBIAN_CODES=$newcodes
69fi
70
[22687]71missing=
72[ -s "$change" ]
73if [ $S -ne 1 ]; then
[22739]74    for code in $DEBIAN_CODES; do
[22977]75        tag=$(gettag "$code")
76        check "${base}${tag}_amd64.changes"
[22739]77    done
[22687]78    if [ $A -eq 1 ]; then
[22739]79        for code in $DEBIAN_CODES; do
[22977]80            tag=$(gettag "$code")
81            uncheck "${base}${tag}_i386.changes"
[22739]82        done
[22687]83    else
[22739]84        for code in $DEBIAN_CODES; do
[22977]85            tag=$(gettag "$code")
86            check "${base}${tag}_i386.changes"
[22739]87        done
[22687]88    fi
89fi
90
91if [ -n "$missing" ]; then
92    echo "Missing $missing" >&2
93    echo -n "Continue? [y/N]"
94    read a
95    [ "$a" = "y" ]
96fi
97
[22739]98for code in $DEBIAN_CODES; do
[24566]99    v dareprepro include "${code}${release}" "$change"
[22739]100done
[22687]101
102if [ $S -ne 1 ]; then
[22739]103    for code in $DEBIAN_CODES; do
[22977]104        tag=$(gettag "$code")
[24566]105        [ $A -eq 1 ] || v dareprepro include "${code}${release}" "${base}${tag}_i386.changes"
[24570]106        v dareprepro include "${code}${release}" "${base}${tag}_amd64.changes"
[22739]107    done
[22687]108fi
109
110changes=$change
[22751]111for code in $DEBIAN_CODES; do
[22977]112    tag=$(gettag "$code")
113    [ $A -eq 1 ] || changes=$changes\ "${base}${tag}"_i386.changes
114    changes=$changes\ "${base}${tag}"_amd64.changes
[22739]115done
[22687]116
117files=${change%.changes}.build\ $changes
118origfiles=
119for change in $changes; do
120    files=$files\ $(perl -0ne '$_ =~ /\nFiles: *\n(( [^\n]*\n)*)/; print $1;' "$change" | awk '{print $5}' | grep -v '\.orig\.tar\.gz$' || :)
121    origfiles=$origfiles\ $(perl -0ne '$_ =~ /\nFiles: *\n(( [^\n]*\n)*)/; print $1;' "$change" | awk '{print $5}' | grep '\.orig\.tar\.gz$' || :)
122done
123
124built=built/
125[ -d "$built" ] || mkdir "$built"
126mv -i $files "$built"
127if [ -n "$origfiles" ]; then
128    for orig in $origfiles; do
129        [ -e "$built/$orig" ] || cp -ai "$orig" "$built/"
130    done
131fi
Note: See TracBrowser for help on using the repository browser.