~ubuntu-branches/ubuntu/wily/devscripts/wily

« back to all changes in this revision

Viewing changes to scripts/dcmd.sh

  • Committer: Package Import Robot
  • Author(s): James McCoy
  • Date: 2014-10-13 22:35:31 UTC
  • mfrom: (10.10.16 sid)
  • Revision ID: package-import@ubuntu.com-20141013223531-30s05ojsmnhbd2ir
Tags: 2.14.10
Fix all the other calls to dpkg-architecture in devscripts.
(Closes: #764963 ... again)

Show diffs side-by-side

added added

removed removed

Lines of Context:
80
80
DSC=1; BCHANGES=1; SCHANGES=1; ARCHDEB=1; INDEPDEB=1; TARBALL=1; DIFF=1
81
81
CHANGES=1; DEB=1; ARCHUDEB=1; INDEPUDEB=1; UDEB=1;
82
82
FILTERED=0; FAIL_MISSING=1
 
83
EXTRACT_PACKAGE_NAME=0
 
84
SORT=0
 
85
TAC=0
83
86
 
84
87
while [ $# -gt 0 ]; do
85
88
    TYPE=""
88
91
        --help|-h) usage; exit 0;;
89
92
        --no-fail-on-missing|-r) FAIL_MISSING=0;;
90
93
        --fail-on-missing) FAIL_MISSING=1;;
 
94
        --package|-p) EXTRACT_PACKAGE_NAME=1;;
 
95
        --sort|-s) SORT=1;;
 
96
        --tac|-t) TAC=1;;
91
97
        --) shift; break;;
92
98
        --no-*)
93
99
            TYPE=${1#--no-}
127
133
        archudeb) [ "$FILTERED" = "1" ] && ARCHUDEB=1 || ARCHUDEB=0;;
128
134
        indepudeb) [ "$FILTERED" = "1" ] && INDEPUDEB=1 || INDEPUDEB=0;;
129
135
        tar|orig) [ "$FILTERED" = "1" ] && TARBALL=1 || TARBALL=0;;
130
 
        diff) [ "$FILTERED" = "1" ] && DIFF=1 || DIFF=0;;
 
136
        diff|debtar) [ "$FILTERED" = "1" ] && DIFF=1 || DIFF=0;;
131
137
        *) echo "$PROGNAME: Unknown option '$1'" >&2; exit 1;;
132
138
    esac
133
139
    shift
175
181
                [ "$ARCHUDEB" = "0" ] || echo "newarg=\"\$newarg
176
182
$THISARG\";"
177
183
                echo "SEEN_ARCHUDEB=1;"
 
184
            elif endswith "$THISARG" .debian.tar.gz || \
 
185
                 endswith "$THISARG" .debian.tar.xz || \
 
186
                 endswith "$THISARG" .debian.tar.bz2; then
 
187
                [ "$DIFF" = "0" ] || echo "newarg=\"\$newarg
 
188
$THISARG\";"
 
189
                echo "SEEN_DIFF=1;"
178
190
            elif endswith "$THISARG" .tar.gz || \
179
191
                 endswith "$THISARG" .tar.xz || \
180
192
                 endswith "$THISARG" .tar.lzma || \
265
277
                MISSING=1; echo "$arg: upstream tar not found" >&2
266
278
            fi
267
279
            if [ "$DIFF" = "1" ] && [ "$SEEN_DIFF" = "0" ]; then
268
 
                MISSING=1; echo "$arg: Debian diff not found" >&2
 
280
                MISSING=1; echo "$arg: Debian debian.tar/diff not found" >&2
269
281
            fi
270
282
 
271
283
            [ "$MISSING" = "0" ] || exit 1
280
292
 
281
293
IFS='
282
294
'
 
295
if [ "$EXTRACT_PACKAGE_NAME" = "1" ]; then
 
296
    packages=""
 
297
    for arg in $args; do
 
298
        packages="$packages
 
299
$(echo "$arg" |sed s/_.*//)"
 
300
    done
 
301
    args="$packages"
 
302
fi
 
303
if [ "$SORT" = "1" ]; then
 
304
    args="$(echo "$args"| sort -)"
 
305
fi
 
306
if [ "$TAC" = "1" ]; then
 
307
    args="$(echo "$args"| tac -)"
 
308
fi
283
309
if [ -z "$cmd" ]; then
284
310
    for arg in $args; do
285
311
        echo $arg