]>
Commit | Line | Data |
---|---|---|
b054f772 | 1 | #!/bin/sh |
33f5276d | 2 | # ----------- |
25fa34fe | 3 | # $Id$ |
33f5276d | 4 | # Exit codes: |
5 | # 0 - succesful | |
6 | # 1 - help dispayed | |
7 | # 2 - no spec file name in cmdl parameters | |
8 | # 3 - spec file not stored in repo | |
0ad50ce9 | 9 | # 4 - some source, patch or icon files not stored in repo |
10 | # 5 - package build failed | |
5a491465 | 11 | |
4003ad8c | 12 | VERSION="\ |
13 | Build package utility from PLD CVS repository | |
6cb7df6d | 14 | V 0.11 (C) 1999-2003 Free Penguins". |
5a491465 | 15 | PATH="/bin:/usr/bin:/usr/sbin:/sbin:/usr/X11R6/bin" |
a7af9862 | 16 | |
b03f053b | 17 | COMMAND="build" |
18 | ||
bde1c404 | 19 | SPECFILE="" |
d287305c | 20 | BE_VERBOSE="" |
4003ad8c | 21 | QUIET="" |
5dd89621 | 22 | CLEAN="" |
7c2dd1b2 | 23 | DEBUG="" |
cc97f1f3 | 24 | NOURLS="" |
157dc315 | 25 | NOCVS="" |
6fc910c7 | 26 | NOCVSSPEC="" |
fc0e5bb5 | 27 | NODIST="" |
b130abf2 | 28 | UPDATE="" |
a9d9a79a | 29 | UPDATE5="" |
de6b5b2a | 30 | ADD5="" |
81474543 | 31 | ALWAYS_CVSUP=${ALWAYS_CVSUP:-"yes"} |
c61a8d10 AM |
32 | if [ -s CVS/Root ]; then |
33 | CVSROOT=$(cat CVS/Root) | |
34 | else | |
35 | CVSROOT=${CVSROOT:-""} | |
36 | fi | |
d6a75d60 | 37 | # Example: LOGFILE='../log.$PACKAGE_NAME' |
38 | # Yes, you can use variable name! Note _single_ quotes! | |
39 | LOGFILE='' | |
00fcec7e | 40 | |
41 | LOGDIR="" | |
42 | LOGDIROK="" | |
43 | LOGDIRFAIL="" | |
44 | LASTLOG_FILE="" | |
45 | LTAG="" | |
79d76918 | 46 | CHMOD="no" |
d6a75d60 | 47 | CHMOD_MODE="0444" |
33a9d2d1 | 48 | RPMOPTS="" |
6049c3d1 | 49 | BCOND="" |
d287305c | 50 | |
51 | PATCHES="" | |
52 | SOURCES="" | |
7053d3fd | 53 | ICONS="" |
d287305c | 54 | PACKAGE_RELEASE="" |
55 | PACKAGE_VERSION="" | |
56 | PACKAGE_NAME="" | |
34c911e6 | 57 | WGET_RETRIES=${MAX_WGET_RETRIES:-0} |
b92ecfc9 | 58 | CVS_RETRIES=${MAX_CVS_RETRIES:-1000} |
5a491465 | 59 | |
00fcec7e | 60 | CVSTAG="" |
61 | RES_FILE="" | |
62 | ||
62546902 | 63 | CVS_SERVER="cvs.pld-linux.org" |
6cb7df6d | 64 | DISTFILES_SERVER="ftp://distfiles.pld-linux.org" |
ea15df77 | 65 | |
3ae81a20 | 66 | DEF_NICE_LEVEL=0 |
67 | ||
c6a390a1 AM |
68 | FAIL_IF_NO_SOURCES="yes" |
69 | ||
8f7b338e | 70 | GETURI="wget --passive-ftp -c -nd -t$WGET_RETRIES --inet" |
71 | GETURI2="wget -c -nd -t$WGET_RETRIES --inet" | |
6aefe77b | 72 | GETLOCAL="cp -a" |
11f33a0c | 73 | |
7147050f AM |
74 | if (rpm --version 2>&1 | grep -q '4.0.[0-2]'); then |
75 | RPM="rpm" | |
76 | RPMBUILD="rpm" | |
77 | else | |
78 | RPM="rpm" | |
79 | RPMBUILD="rpmbuild" | |
80 | fi | |
81 | ||
6eb44b93 | 82 | if [ -f ~/etc/builderrc ]; then |
7922b3ec | 83 | . ~/etc/builderrc |
6eb44b93 | 84 | elif [ -f ~/.builderrc ]; then |
7922b3ec | 85 | . ~/.builderrc |
5aa0ef93 AF |
86 | fi |
87 | ||
da946cd6 | 88 | #--------------------------------------------- |
89 | # functions | |
90 | ||
5a491465 | 91 | usage() |
92 | { | |
7c2dd1b2 | 93 | if [ -n "$DEBUG" ]; then set -xv; fi |
94 | echo "\ | |
7922b3ec | 95 | Usage: builder [-D|--debug] [-V|--version] [-a|--as_anon] [-b|-ba|--build] |
81f85806 | 96 | |
97 | [-bb|--build-binary] [-bs|--build-source] [-u|--try-upgrade] | |
98 | [{-B|--branch} <branch>] [{-d|--cvsroot} <cvsroot>] [-g|--get] | |
99 | [-h|--help] [{-l,--logtofile} <logfile>] [-m|--mr-proper] | |
00fcec7e | 100 | [-q|--quiet] [--date <yyyy-mm-dd> [-r <cvstag>] [{-T--tag <cvstag>] |
a2164135 MM |
101 | [-Tvs|--tag-version-stable] [-Tvn|--tag-version-nest] |
102 | [-Ts|--tag-stable] [-Tn|--tag-nest] [-Tv|--tag-version] | |
81f85806 | 103 | [-nu|--no-urls] [-v|--verbose] [--opts <rpm opts>] |
c9ff8825 | 104 | [--with/--without <feature>] [--define <macro> <value>] <package>[.spec] |
5a491465 | 105 | |
de6b5b2a MM |
106 | -5, --update-md5 |
107 | - update md5 comments in spec, implies -nd | |
108 | -a5, --add-md5 - add md5 comments to URL sources, implies -nc -nd | |
a2a9c8df | 109 | -D, --debug - enable script debugging mode, |
5a491465 | 110 | -V, --version - output builder version |
62546902 | 111 | -a, --as_anon - get files via pserver as cvs@$CVS_SERVER, |
79b2ec0e | 112 | -b, -ba, |
cc97f1f3 | 113 | --build - get all files from CVS repo or HTTP/FTP and build |
5a491465 | 114 | package from <package>.spec, |
7922b3ec | 115 | -bb, --build-binary |
116 | - get all files from CVS repo or HTTP/FTP and build | |
79b2ec0e | 117 | binary only package from <package>.spec, |
118 | -bs, | |
cc97f1f3 SZ |
119 | --build-source - get all files from CVS repo or HTTP/FTP and only |
120 | pack them into src.rpm, | |
8ba5cdda | 121 | -B, --branch - add branch |
7922b3ec | 122 | -c, --clean - clean all temporarily created files (in BUILD, |
79b2ec0e | 123 | SOURCES, SPECS and \$RPM_BUILD_ROOT), |
7922b3ec | 124 | -d <cvsroot>, --cvsroot <cvsroot> |
125 | - setup \$CVSROOT, | |
e7bdc1b4 | 126 | --define <macro> <value> |
81f85806 | 127 | - define a macro <macro> with value <value>, |
7922b3ec | 128 | -g, --get - get <package>.spec and all related files from |
cc97f1f3 | 129 | CVS repo or HTTP/FTP, |
5a491465 | 130 | -h, --help - this message, |
7922b3ec | 131 | -l <logfile>, --logtofile <logfile> |
132 | - log all to file, | |
ff45a501 | 133 | -m, --mr-proper - only remove all files related to spec file and |
8bc51224 | 134 | all work resources, |
6fc910c7 | 135 | -nc, --no-cvs - don't download sources from CVS, if source URL is |
136 | given, | |
137 | -ncs, --no-cvs-specs | |
138 | - don't check specs in CVS | |
fc0e5bb5 TP |
139 | -nd, --no-distfiles |
140 | - don't download from distfiles | |
4ca52257 | 141 | -nm, --no-mirrors - don't download from mirror, if source URL is given, |
157dc315 | 142 | -nu, --no-urls - don't try to download from FTP/HTTP location, |
0143ec80 | 143 | -ns, --no-srcs - don't download Sources |
fd2b5687 | 144 | -ns0, --no-source0 |
0143ec80 | 145 | - don't download Source0 |
7922b3ec | 146 | --opts <rpm opts> |
147 | - additional options for rpm | |
5a491465 | 148 | -q, --quiet - be quiet, |
448deaa0 | 149 | --date yyyy-mm-dd |
150 | - build package using resources from specified CVS | |
151 | date, | |
7922b3ec | 152 | -r <cvstag>, --cvstag <cvstag> |
153 | - build package using resources from specified CVS | |
67fcd1e4 | 154 | tag, |
7922b3ec | 155 | -T <cvstag> , --tag <cvstag> |
156 | - add cvs tag <cvstag> for files, | |
78ce14b3 | 157 | -Tvs, --tag-version-stable |
158 | - add cvs tags STABLE and NAME-VERSION-RELESE for files, | |
a2164135 MM |
159 | -Tvn, --tag-version-nest |
160 | - add cvs tags NEST and NAME-VERSION-RELESE for files, | |
78ce14b3 | 161 | -Ts, --tag-stable |
162 | - add cvs tag STABLE for files, | |
a2164135 MM |
163 | -Tn, --tag-nest |
164 | - add cvs tag NEST for files, | |
7922b3ec | 165 | -Tv, --tag-version |
166 | - add cvs tag NAME-VERSION-RELESE for files, | |
5a491465 | 167 | -v, --verbose - be verbose, |
81f85806 | 168 | -u, --try-upgrade |
169 | - check version, and try to upgrade package | |
b130abf2 TP |
170 | -un, --try-upgrade-with-float-version |
171 | - as above, but allow float version | |
172 | -U, --update | |
de6b5b2a MM |
173 | - refetch sources, don't use distfiles, and update md5 |
174 | comments | |
d5787aec | 175 | --with/--without <feature> |
81f85806 | 176 | - conditional build package depending on |
d5787aec | 177 | %_with_<feature>/%_without_<feature> macro |
81f85806 | 178 | switch |
5a491465 | 179 | " |
180 | } | |
181 | ||
ad6f43de MM |
182 | rpm_dump () { |
183 | case "$RPMBUILD" in | |
184 | rpm ) | |
185 | rpm -bp --define 'prep %dump' $BCOND $SPECFILE 2>&1 | |
186 | ;; | |
187 | rpmbuild ) | |
188 | rpmbuild --define 'prep %dump' $BCOND $SPECFILE 2>&1 | |
189 | ;; | |
190 | esac | |
191 | } | |
192 | ||
59398507 | 193 | parse_spec() |
194 | { | |
c3428d50 | 195 | if [ -n "$DEBUG" ]; then |
a7af9862 | 196 | set -x; |
197 | set -v; | |
71d62f04 | 198 | fi |
7c2dd1b2 | 199 | |
25fa34fe | 200 | cd $SPECS_DIR |
72fb89b5 | 201 | if [ "$NOSRCS" != "yes" ]; then |
ad6f43de | 202 | SOURCES="`rpm_dump | awk '/SOURCEURL[0-9]+/ {print $3}'`" |
72fb89b5 | 203 | fi |
ad6f43de | 204 | if (rpm_dump | grep -qEi ":.*nosource.*1"); then |
a7af9862 | 205 | FAIL_IF_NO_SOURCES="no" |
c6a390a1 AM |
206 | fi |
207 | ||
ad6f43de | 208 | PATCHES="`rpm_dump | awk '/PATCHURL[0-9]+/ {print $3}'`" |
cc97f1f3 | 209 | ICONS="`awk '/^Icon:/ {print $2}' ${SPECFILE}`" |
7147050f AM |
210 | PACKAGE_NAME="`$RPM -q --qf '%{NAME}\n' --specfile ${SPECFILE} 2> /dev/null | head -1`" |
211 | PACKAGE_VERSION="`$RPM -q --qf '%{VERSION}\n' --specfile ${SPECFILE} 2> /dev/null| head -1`" | |
212 | PACKAGE_RELEASE="`$RPM -q --qf '%{RELEASE}\n' --specfile ${SPECFILE} 2> /dev/null | head -1`" | |
79379585 | 213 | |
9e06e5c3 | 214 | if [ -n "$BE_VERBOSE" ]; then |
00fcec7e | 215 | echo "- Sources : `nourl $SOURCES`" |
cc97f1f3 | 216 | if [ -n "$PATCHES" ]; then |
a7af9862 | 217 | echo "- Patches : `nourl $PATCHES`" |
cc97f1f3 | 218 | else |
a7af9862 | 219 | echo "- Patches : *no patches needed*" |
cc97f1f3 | 220 | fi |
7053d3fd | 221 | if [ -n "$ICONS" ]; then |
a7af9862 | 222 | echo "- Icon : `nourl $ICONS`" |
a3df415f | 223 | else |
a7af9862 | 224 | echo "- Icon : *no package icon*" |
a3df415f | 225 | fi |
9e06e5c3 | 226 | echo "- Name : $PACKAGE_NAME" |
227 | echo "- Version : $PACKAGE_VERSION" | |
39cbc282 | 228 | echo "- Release : $PACKAGE_RELEASE" |
d287305c | 229 | fi |
33f5276d | 230 | } |
231 | ||
232 | Exit_error() | |
233 | { | |
00fcec7e | 234 | if [ -n "$DEBUG" ]; then |
0dd6320d | 235 | set -x; |
00fcec7e | 236 | set -v; |
71d62f04 | 237 | fi |
7c2dd1b2 | 238 | |
33f5276d | 239 | cd $__PWD |
240 | ||
4849ca8d | 241 | case "$1" in |
33f5276d | 242 | "err_no_spec_in_cmdl" ) |
243 | echo "ERROR: spec file name not specified."; | |
244 | exit 2 ;; | |
245 | "err_no_spec_in_repo" ) | |
246 | echo "Error: spec file not stored in CVS repo."; | |
247 | exit 3 ;; | |
248 | "err_no_source_in_repo" ) | |
4849ca8d | 249 | echo "Error: some source, patch or icon files not stored in CVS repo. ($2)"; |
33f5276d | 250 | exit 4 ;; |
251 | "err_build_fail" ) | |
298c753e | 252 | echo "Error: package build failed. (${2:-no more info})"; |
33f5276d | 253 | exit 5 ;; |
254 | esac | |
255 | } | |
bc8d444f | 256 | |
33f5276d | 257 | init_builder() |
258 | { | |
00fcec7e | 259 | if [ -n "$DEBUG" ]; then |
0dd6320d | 260 | set -x; |
00fcec7e | 261 | set -v; |
71d62f04 | 262 | fi |
7c2dd1b2 | 263 | |
7147050f AM |
264 | SOURCE_DIR="`$RPM --eval '%{_sourcedir}'`" |
265 | SPECS_DIR="`$RPM --eval '%{_specdir}'`" | |
bc8d444f | 266 | |
33f5276d | 267 | __PWD=`pwd` |
59398507 | 268 | } |
269 | ||
270 | get_spec() | |
271 | { | |
00fcec7e | 272 | if [ -n "$DEBUG" ]; then |
0dd6320d | 273 | set -x; |
00fcec7e | 274 | set -v; |
71d62f04 | 275 | fi |
7c2dd1b2 | 276 | |
6fc910c7 | 277 | if [ "$NOCVSSPEC" != "yes" ]; then |
278 | cd $SPECS_DIR | |
5644bf7e | 279 | |
6fc910c7 | 280 | OPTIONS="up " |
67fcd1e4 | 281 | |
6fc910c7 | 282 | if [ -n "$CVSROOT" ]; then |
283 | OPTIONS="-d $CVSROOT $OPTIONS" | |
284 | else | |
285 | if [ ! -s CVS/Root -a "$NOCVSSPEC" != "yes" ]; then | |
286 | echo "warning: No cvs access defined - using local .spec file" | |
287 | NOCVSSPEC="yes" | |
288 | fi | |
289 | fi | |
00fcec7e | 290 | |
72e08ca8 | 291 | if [ -z "$CVSDATE" -a -z "$CVSTAG" ]; then |
6fc910c7 | 292 | OPTIONS="$OPTIONS -A" |
72e08ca8 AM |
293 | else |
294 | if [ -n "$CVSDATE" ]; then | |
0dd6320d | 295 | OPTIONS="$OPTIONS -D $CVSDATE" |
72e08ca8 AM |
296 | fi |
297 | if [ -n "$CVSTAG" ]; then | |
0dd6320d | 298 | OPTIONS="$OPTIONS -r $CVSTAG" |
72e08ca8 | 299 | fi |
6fc910c7 | 300 | fi |
33f5276d | 301 | |
b92ecfc9 AM |
302 | result=1 |
303 | retries_counter=0 | |
304 | while [ "$result" != "0" -a "$retries_counter" -le "$CVS_RETRIES" ]; do | |
305 | retries_counter=$(( $retries_counter + 1 )) | |
306 | output=$(LC_ALL=C cvs $OPTIONS $SPECFILE 2>&1) | |
307 | result=$? | |
fef1dc85 | 308 | [ -n "$output" ] && echo "$output" |
b92ecfc9 | 309 | if [ "$result" -ne "0" ]; then |
67a44175 | 310 | if (echo "$output" | grep -qE "(Cannot connect to|connect to .* failed|Connection reset by peer|Connection timed out)") && [ "$retries_counter" -le "$CVS_RETRIES" ]; then |
ee004885 | 311 | echo "Trying again [$SPECFILE]... ($retries_counter)" |
96686ae5 | 312 | sleep 2 |
b92ecfc9 | 313 | continue |
0dd6320d | 314 | fi |
315 | Exit_error err_no_spec_in_repo; | |
b92ecfc9 AM |
316 | fi |
317 | done | |
33f5276d | 318 | fi |
6fc910c7 | 319 | if [ ! -f "$SPECFILE" ]; then |
b857906d | 320 | Exit_error err_no_spec_in_repo; |
6fc910c7 | 321 | fi |
a7af9862 | 322 | |
d013b3df | 323 | if [ "$CHMOD" = "yes" -a -n "$SPECFILE" ]; then |
7922b3ec | 324 | chmod $CHMOD_MODE $SPECFILE |
5aa0ef93 | 325 | fi |
7c2dd1b2 | 326 | unset OPTIONS |
67da0368 | 327 | grep -E -m 1 "^#.*Revision:.*Date" $SPECFILE |
59398507 | 328 | } |
329 | ||
4ca52257 JK |
330 | find_mirror(){ |
331 | ||
332 | cd "$SPECS_DIR" | |
00fcec7e | 333 | url="$1" |
6631fc57 | 334 | if [ ! -f "mirrors" -a "$NOCVSSPEC" != "yes" ] ; then |
00fcec7e | 335 | cvs update mirrors >&2 |
4ca52257 JK |
336 | fi |
337 | ||
338 | IFS="|" | |
339 | while read origin mirror name rest; do | |
00fcec7e | 340 | ol=`echo -n "$origin"|wc -c` |
4ca52257 JK |
341 | prefix="`echo -n "$url" | head -c $ol`" |
342 | if [ "$prefix" = "$origin" ] ; then | |
6fc910c7 | 343 | suffix="`echo "$url"|cut -b $ol-`" |
344 | echo -n "$mirror$suffix" | |
345 | return 0 | |
4ca52257 JK |
346 | fi |
347 | done < mirrors | |
348 | echo "$url" | |
349 | } | |
350 | ||
00fcec7e | 351 | src_no () |
352 | { | |
353 | cd $SPECS_DIR | |
ad6f43de | 354 | rpm_dump | \ |
0dd6320d | 355 | grep "SOURCEURL[0-9]*[ ]*$1""[ ]*$" | \ |
356 | sed -e 's/.*SOURCEURL\([0-9][0-9]*\).*/\1/' | \ | |
357 | head -1 | xargs | |
00fcec7e | 358 | } |
359 | ||
360 | src_md5 () | |
361 | { | |
362 | no=$(src_no "$1") | |
363 | [ -z "$no" ] && return | |
364 | cd $SPECS_DIR | |
0dd6320d | 365 | spec_rev=$(grep $SPECFILE CVS/Entries | sed -e s:/$SPECFILE/:: -e s:/.*::) |
366 | if [ -z "$spec_rev" ]; then | |
367 | spec_rev="$(head -1 $SPECFILE | sed -e 's/.*\$Revision: \([0-9.]*\).*/\1/')" | |
368 | fi | |
369 | spec="$SPECFILE[0-9.,]*,$(echo $spec_rev | sed 's/\./\\./g')" | |
80dcd8ed | 370 | md5=$(grep -s -v '^#' additional-md5sums | \ |
0dd6320d | 371 | grep -E "[ ]$(basename "$1")[ ]+${spec}([ ,]|\$)" | \ |
372 | sed -e 's/^\([0-9a-f]\{32\}\).*/\1/' | \ | |
373 | grep -E '^[0-9a-f]{32}$') | |
6d2b8f55 | 374 | if [ X"$md5" = X"" ] ; then |
0dd6320d | 375 | grep -i "#[ ]*Source$no-md5[ ]*:" $SPECFILE | sed -e 's/.*://' | xargs |
6d2b8f55 | 376 | else |
0dd6320d | 377 | if [ $(echo "$md5" | wc -l) != 1 ] ; then |
378 | echo "$SPECFILE: more then one entry in additional-md5sums for $1" 1>&2 | |
379 | fi | |
380 | echo "$md5" | tail -1 | |
6d2b8f55 | 381 | fi |
00fcec7e | 382 | } |
383 | ||
384 | distfiles_url () | |
385 | { | |
8963720e | 386 | echo "$DISTFILES_SERVER/by-md5/$(src_md5 "$1" | sed -e 's|^\(.\)\(.\)|\1/\2/&|')/$(basename "$1")" |
00fcec7e | 387 | } |
388 | ||
d99ac371 MM |
389 | good_md5 () |
390 | { | |
391 | md5=$(src_md5 "$1") | |
392 | [ "$md5" = "" ] || \ | |
393 | [ "$md5" = "$(md5sum $(nourl "$1") 2> /dev/null | sed -e 's/ .*//')" ] | |
394 | } | |
395 | ||
25fa34fe | 396 | get_files() |
59398507 | 397 | { |
25fa34fe AM |
398 | GET_FILES="$@" |
399 | ||
00fcec7e | 400 | if [ -n "$DEBUG" ]; then |
0dd6320d | 401 | set -x; |
00fcec7e | 402 | set -v; |
71d62f04 | 403 | fi |
7c2dd1b2 | 404 | |
25fa34fe | 405 | if [ -n "$1$2$3$4$5$6$7$8$9${10}" ]; then |
7053d3fd | 406 | cd $SOURCE_DIR |
33f5276d | 407 | |
82c46005 | 408 | OPTIONS="up " |
7053d3fd | 409 | if [ -n "$CVSROOT" ]; then |
c1e79fcd | 410 | OPTIONS="-d $CVSROOT $OPTIONS" |
6fc910c7 | 411 | else |
412 | if [ ! -s CVS/Root -a "$NOCVS" != "yes" ]; then | |
413 | echo "warning: No cvs access defined for SOURCES" | |
414 | NOCVS="yes" | |
415 | fi | |
67fcd1e4 | 416 | fi |
0dd6320d | 417 | if [ -z "$CVSDATE" -a -z "$CVSTAG" ]; then |
418 | OPTIONS="$OPTIONS -A" | |
419 | else | |
420 | if [ -n "$CVSDATE" ]; then | |
421 | OPTIONS="$OPTIONS -D $CVSDATE" | |
422 | fi | |
423 | if [ -n "$CVSTAG" ]; then | |
424 | OPTIONS="$OPTIONS -r $CVSTAG" | |
425 | fi | |
426 | fi | |
25fa34fe | 427 | for i in $GET_FILES; do |
81474543 | 428 | if [ ! -f `nourl $i` ] || [ $ALWAYS_CVSUP = "yes" ]; then |
4a0bb672 | 429 | if echo $i | grep -vE '(http|ftp|https|cvs|svn)://' | grep -qE '\.(gz|bz2)$']; then |
6fc910c7 | 430 | echo "Warning: no URL given for $i" |
157dc315 | 431 | fi |
a7af9862 | 432 | |
fc0e5bb5 | 433 | if [ -n "$(src_md5 "$i")" ] && [ -z "$NODIST" ]; then |
d99ac371 | 434 | if good_md5 "$i"; then |
f67349b7 | 435 | echo "$(nourl "$i") having proper md5sum already exists" |
436 | continue | |
437 | fi | |
00fcec7e | 438 | target=$(nourl "$i") |
439 | url=$(distfiles_url "$i") | |
6aefe77b JR |
440 | if [ `echo $url | grep -E '^(\.|/)'` ] ; then |
441 | ${GETLOCAL} $url $target | |
442 | else | |
443 | if [ -z "$NOMIRRORS" ] ; then | |
444 | url="`find_mirror "$url"`" | |
00fcec7e | 445 | fi |
6aefe77b JR |
446 | ${GETURI} -O "$target" "$url" || \ |
447 | if [ `echo $url | grep -E 'ftp://'` ]; then | |
448 | ${GETURI2} -O "$target" "$url" | |
449 | fi | |
450 | test -s "$target" || rm -f "$target" | |
451 | fi | |
de6b5b2a MM |
452 | elif [ -z "$(src_md5 "$i")" ] && \ |
453 | ( [ -z "$NOCVS" ] || echo $i | grep -qvE '(ftp|http|https)://' ); then | |
b92ecfc9 | 454 | result=1 |
0dd6320d | 455 | retries_counter=0 |
456 | while [ "$result" != "0" -a "$retries_counter" -le "$CVS_RETRIES" ]; do | |
457 | retries_counter=$(( $retries_counter + 1 )) | |
b92ecfc9 | 458 | output=$(LC_ALL=C cvs $OPTIONS `nourl $i` 2>&1) |
0dd6320d | 459 | result=$? |
fef1dc85 | 460 | [ -n "$output" ] && echo "$output" |
67a44175 | 461 | if (echo "$output" | grep -qE "(Cannot connect to|connect to .* failed|Connection reset by peer|Connection timed out)") && [ "$result" -ne "0" -a "$retries_counter" -le "$CVS_RETRIES" ]; then |
ee004885 | 462 | echo "Trying again [`nourl $i`]... ($retries_counter)" |
96686ae5 | 463 | sleep 2 |
b92ecfc9 | 464 | continue |
711eb1e4 AM |
465 | else |
466 | break | |
b92ecfc9 AM |
467 | fi |
468 | done | |
157dc315 | 469 | fi |
a7af9862 | 470 | |
b130abf2 | 471 | if [ -z "$NOURLS" ] && [ ! -f "`nourl $i`" -o -n "$UPDATE" ] && [ `echo $i | grep -E 'ftp://|http://|https://'` ]; then |
00fcec7e | 472 | if [ -z "$NOMIRRORS" ] ; then |
3428d253 JB |
473 | im="`find_mirror "$i"`" |
474 | else | |
475 | im="$i" | |
6fc910c7 | 476 | fi |
3428d253 JB |
477 | ${GETURI} "$im" || \ |
478 | if [ `echo $im | grep -E 'ftp://'` ]; then ${GETURI2} "$im" ; fi | |
157dc315 SZ |
479 | fi |
480 | ||
de6b5b2a | 481 | |
422fbc56 TP |
482 | fi |
483 | srcno=$(src_no $i) | |
484 | if [ ! -f "`nourl $i`" -a "$FAIL_IF_NO_SOURCES" != "no" ]; then | |
485 | Exit_error err_no_source_in_repo $i; | |
486 | elif [ -n "$UPDATE5" ] && \ | |
487 | ( ( [ -n "$ADD5" ] && echo $i | grep -q -E 'ftp://|http://|https://' && \ | |
488 | [ -z "$(grep -E -i '^NoSource[ ]*:[ ]*'$i'([ ]|$)' $SPECS_DIR/$SPECFILE)" ] ) || \ | |
489 | grep -q -i -E '^#[ ]*source'$(src_no $i)'-md5[ ]*:' $SPECS_DIR/$SPECFILE ) | |
490 | then | |
491 | echo "Updating source-$srcno md5." | |
492 | md5=$(md5sum `nourl $i` | cut -f1 -d' ') | |
82db6b8d MM |
493 | perl -i -ne ' |
494 | print unless /^\s*#\s*Source'$srcno'-md5\s*:/i; | |
495 | print "# Source'$srcno'-md5:\t'$md5'\n" | |
496 | if /^Source'$srcno'\s*:\s+/; | |
497 | ' \ | |
422fbc56 TP |
498 | $SPECS_DIR/$SPECFILE |
499 | fi | |
500 | ||
501 | if good_md5 "$i"; then | |
502 | : | |
503 | else | |
504 | echo "MD5 sum mismatch. Use -U to refetch sources," | |
505 | echo "or -5 to update md5 sums, if you're sure files are correct." | |
506 | Exit_error err_no_source_in_repo $i | |
3ae81a20 | 507 | fi |
cc97f1f3 | 508 | done |
a7af9862 | 509 | |
5aa0ef93 | 510 | if [ "$CHMOD" = "yes" ]; then |
d013b3df AM |
511 | CHMOD_FILES="`nourl $GET_FILES`" |
512 | if [ -n "$CHMOD_FILES" ]; then | |
6fc910c7 | 513 | chmod $CHMOD_MODE $CHMOD_FILES |
d013b3df | 514 | fi |
5aa0ef93 | 515 | fi |
7c2dd1b2 | 516 | unset OPTIONS |
7053d3fd | 517 | fi |
59398507 | 518 | } |
519 | ||
1471f6d6 | 520 | tag_files() |
521 | { | |
522 | TAG_FILES="$@" | |
523 | ||
00fcec7e | 524 | if [ -n "$DEBUG" ]; then |
0dd6320d | 525 | set -x; |
00fcec7e | 526 | set -v; |
1471f6d6 | 527 | fi |
528 | ||
529 | if [ -n "$1$2$3$4$5$6$7$8$9${10}" ]; then | |
530 | echo $PACKAGE_VERSION | |
531 | echo $PACKAGE_RELEASE | |
b4fd0ec0 | 532 | TAGVER=$PACKAGE_NAME-`echo $PACKAGE_VERSION | sed -e "s/\./\_/g" -e "s/@/#/g"`-`echo $PACKAGE_RELEASE | sed -e "s/\./\_/g" -e "s/@/#/g"` |
01de2036 JB |
533 | if [ "$TAG_VERSION" = "yes" ]; then |
534 | echo "CVS tag: $TAGVER" | |
535 | fi | |
536 | if [ -n "$TAG" ]; then | |
537 | echo "CVS tag: $TAG" | |
538 | fi | |
1471f6d6 | 539 | |
540 | OPTIONS="tag -F" | |
541 | if [ -n "$CVSROOT" ]; then | |
542 | OPTIONS="-d $CVSROOT $OPTIONS" | |
543 | fi | |
544 | ||
545 | cd $SOURCE_DIR | |
546 | for i in $TAG_FILES; do | |
547 | if [ -f `nourl $i` ]; then | |
f02788de JB |
548 | if [ "$TAG_VERSION" = "yes" ]; then |
549 | cvs $OPTIONS $TAGVER `nourl $i` | |
550 | fi | |
551 | if [ -n "$TAG" ]; then | |
552 | cvs $OPTIONS $TAG `nourl $i` | |
553 | fi | |
1471f6d6 | 554 | else |
4849ca8d | 555 | Exit_error err_no_source_in_repo $i |
1471f6d6 | 556 | fi |
557 | done | |
558 | ||
559 | cd $SPECS_DIR | |
f02788de JB |
560 | if [ "$TAG_VERSION" = "yes" ]; then |
561 | cvs $OPTIONS $TAGVER $SPECFILE | |
562 | fi | |
563 | if [ -n "$TAG" ]; then | |
564 | cvs $OPTIONS $TAG $SPECFILE | |
565 | fi | |
1471f6d6 | 566 | |
567 | unset OPTIONS | |
568 | fi | |
569 | } | |
570 | ||
8ba5cdda PG |
571 | branch_files() |
572 | { | |
a7af9862 | 573 | TAG=$1 |
574 | echo "CVS branch tag: $TAG" | |
575 | shift; | |
8ba5cdda | 576 | |
a7af9862 | 577 | TAG_FILES="$@" |
8ba5cdda | 578 | |
a7af9862 | 579 | if [ -n "$DEBUG" ]; then |
580 | set -x; | |
581 | set -v; | |
582 | fi | |
8ba5cdda | 583 | |
a7af9862 | 584 | if [ -n "$1$2$3$4$5$6$7$8$9${10}" ]; then |
585 | ||
586 | OPTIONS="tag -b" | |
587 | if [ -n "$CVSROOT" ]; then | |
588 | OPTIONS="-d $CVSROOT $OPTIONS" | |
8ba5cdda | 589 | fi |
a7af9862 | 590 | cd $SOURCE_DIR |
591 | for i in $TAG_FILES; do | |
592 | if [ -f `nourl $i` ]; then | |
593 | cvs $OPTIONS $TAG `nourl $i` | |
594 | else | |
595 | Exit_error err_no_source_in_repo $i | |
596 | fi | |
597 | done | |
598 | cd $SPECS_DIR | |
599 | cvs $OPTIONS $TAG $SPECFILE | |
600 | ||
601 | unset OPTIONS | |
602 | fi | |
8ba5cdda PG |
603 | } |
604 | ||
f308b816 | 605 | |
606 | ||
59398507 | 607 | build_package() |
608 | { | |
00fcec7e | 609 | if [ -n "$DEBUG" ]; then |
7922b3ec | 610 | set -x; |
00fcec7e | 611 | set -v; |
71d62f04 | 612 | fi |
7c2dd1b2 | 613 | |
33f5276d | 614 | cd $SPECS_DIR |
3d97a432 | 615 | |
00fcec7e | 616 | if [ -n "$TRY_UPGRADE" ]; then |
a7af9862 | 617 | |
618 | if [ -n "FLOAT_VERSION" ]; then | |
619 | TNOTIFY=`./pldnotify.awk $SPECFILE -n` | |
620 | else | |
621 | TNOTIFY=`./pldnotify.awk $SPECFILE` | |
622 | fi | |
623 | ||
3d97a432 | 624 | TNEWVER=`echo $TNOTIFY | awk '{ match($4,/\[NEW\]/); print $5 }'` |
a7af9862 | 625 | |
0096b1ae | 626 | if [ -n "$TNEWVER" ]; then |
a7af9862 | 627 | |
3d97a432 | 628 | TOLDVER=`echo $TNOTIFY | awk '{ print $3; }'` |
a7af9862 | 629 | |
3d97a432 | 630 | echo "New version found, updating spec file to version " $TNEWVER |
a7af9862 | 631 | |
3d97a432 | 632 | cp -f $SPECFILE $SPECFILE.bak |
a7af9862 | 633 | |
3d97a432 | 634 | chmod +w $SPECFILE |
a7af9862 | 635 | |
3d97a432 MK |
636 | eval "perl -pi -e 's/Version:\t"$TOLDVER"/Version:\t"$TNEWVER"/gs' $SPECFILE" |
637 | eval "perl -pi -e 's/Release:\t[1-9]{0,4}/Release:\t1/' $SPECFILE" | |
a7af9862 | 638 | |
3d97a432 | 639 | parse_spec; |
a7af9862 | 640 | |
3d97a432 | 641 | get_files "$SOURCES $PATCHES"; |
a7af9862 | 642 | |
3d97a432 MK |
643 | unset TOLDVER TNEWVER TNOTIFY |
644 | fi | |
00fcec7e | 645 | |
3d97a432 MK |
646 | fi |
647 | ||
648 | ||
649 | cd $SPECS_DIR | |
650 | ||
79b2ec0e | 651 | case "$COMMAND" in |
652 | build ) | |
7922b3ec | 653 | BUILD_SWITCH="-ba" ;; |
79b2ec0e | 654 | build-binary ) |
655 | BUILD_SWITCH="-bb" ;; | |
656 | build-source ) | |
956d1492 | 657 | BUILD_SWITCH="-bs --nodeps" ;; |
79b2ec0e | 658 | esac |
d6a75d60 | 659 | if [ -n "$LOGFILE" ]; then |
00fcec7e | 660 | if [ -n "$CVSTAG" ]; then |
661 | LTAG="r_`echo $CVSTAG|sed -e 's/\./_/g'`_" | |
662 | else | |
663 | LTAG="" | |
664 | fi | |
972bd3c3 | 665 | LOG=`eval echo $LOGFILE` |
00fcec7e | 666 | if [ -n "$LASTLOG_FILE" ]; then |
667 | echo "LASTLOG=$LOG" > $LASTLOG_FILE | |
668 | fi | |
669 | RES_FILE=~/tmp/$RPMBUILD-exit-status.$RANDOM | |
670 | (nice -n ${DEF_NICE_LEVEL} time $RPMBUILD $BUILD_SWITCH -v $QUIET $CLEAN $RPMOPTS $BCOND $SPECFILE; echo $? > $RES_FILE) 2>&1 |tee $LOG | |
671 | RETVAL=`cat $RES_FILE` | |
672 | rm $RES_FILE | |
673 | if [ -n "$LOGDIROK" ] && [ -n "$LOGDIRFAIL" ]; then | |
0dd6320d | 674 | if [ "$RETVAL" -eq "0" ]; then |
00fcec7e | 675 | mv $LOG $LOGDIROK |
0dd6320d | 676 | else |
677 | mv $LOG $LOGDIRFAIL | |
00fcec7e | 678 | fi |
679 | fi | |
d6a75d60 | 680 | else |
7147050f | 681 | eval nice -n ${DEF_NICE_LEVEL} $RPMBUILD $BUILD_SWITCH -v $QUIET $CLEAN $RPMOPTS $BCOND $SPECFILE |
f308b816 | 682 | RETVAL=$? |
d6a75d60 | 683 | fi |
33f5276d | 684 | |
f308b816 | 685 | if [ "$RETVAL" -ne "0" ]; then |
a7af9862 | 686 | |
00fcec7e | 687 | if [ -n "$TRY_UPGRADE" ]; then |
3d97a432 | 688 | echo "\n!!! Package with new version cannot be build automagically\n" |
3d97a432 | 689 | mv -f $SPECFILE.bak $SPECFILE |
3d97a432 | 690 | fi |
a7af9862 | 691 | |
33f5276d | 692 | Exit_error err_build_fail; |
693 | fi | |
a7af9862 | 694 | |
79b2ec0e | 695 | unset BUILD_SWITCH |
59398507 | 696 | } |
697 | ||
cc97f1f3 SZ |
698 | nourl() |
699 | { | |
a7af9862 | 700 | echo "$@" | sed 's#\<\(ftp\|http\|https\|cvs\|svn\)://[^ ]*/##g' |
cc97f1f3 | 701 | } |
da946cd6 | 702 | #--------------------------------------------- |
703 | # main() | |
704 | ||
ba877a00 | 705 | if [ "$#" = 0 ]; then |
da946cd6 | 706 | usage; |
d764d255 | 707 | exit 1 |
da946cd6 | 708 | fi |
709 | ||
5a491465 | 710 | while test $# -gt 0 ; do |
711 | case "${1}" in | |
de6b5b2a | 712 | -5 | --update-md5 ) |
a9d9a79a TP |
713 | COMMAND="get"; |
714 | NODIST="yes" | |
715 | UPDATE5="yes" | |
716 | shift ;; | |
de6b5b2a MM |
717 | -a5 | --add-md5 ) |
718 | COMMAND="get"; | |
719 | NODIST="yes" | |
720 | NOCVS="yes" | |
721 | UPDATE5="yes" | |
722 | ADD5="yes" | |
723 | shift ;; | |
7c2dd1b2 | 724 | -D | --debug ) |
725 | DEBUG="yes"; shift ;; | |
bde1c404 | 726 | -V | --version ) |
4003ad8c | 727 | COMMAND="version"; shift ;; |
bde1c404 | 728 | -a | --as_anon ) |
62546902 | 729 | CVSROOT=":pserver:cvs@$CVS_SERVER:/cvsroot"; shift ;; |
79b2ec0e | 730 | -b | -ba | --build ) |
4003ad8c | 731 | COMMAND="build"; shift ;; |
79b2ec0e | 732 | -bb | --build-binary ) |
733 | COMMAND="build-binary"; shift ;; | |
734 | -bs | --build-source ) | |
735 | COMMAND="build-source"; shift ;; | |
8ba5cdda PG |
736 | -B | --branch ) |
737 | COMMAND="branch"; shift; TAG="${1}"; shift;; | |
5dd89621 | 738 | -c | --clean ) |
739 | CLEAN="--clean --rmspec --rmsource"; shift ;; | |
bde1c404 | 740 | -d | --cvsroot ) |
4003ad8c | 741 | shift; CVSROOT="${1}"; shift ;; |
bde1c404 | 742 | -g | --get ) |
743 | COMMAND="get"; shift ;; | |
744 | -h | --help ) | |
745 | COMMAND="usage"; shift ;; | |
5a491465 | 746 | -l | --logtofile ) |
4003ad8c | 747 | shift; LOGFILE="${1}"; shift ;; |
3ae81a20 | 748 | -ni| --nice ) |
749 | shift; DEF_NICE_LEVEL=${1}; shift ;; | |
8bc51224 | 750 | -m | --mr-proper ) |
751 | COMMAND="mr-proper"; shift ;; | |
157dc315 SZ |
752 | -nc | --no-cvs ) |
753 | NOCVS="yes"; shift ;; | |
37f54b4a | 754 | -ncs | --no-cvs-specs ) |
6fc910c7 | 755 | NOCVSSPEC="yes"; shift ;; |
fc0e5bb5 TP |
756 | -nd | --no-distfiles ) |
757 | NODIST="yes"; shift ;; | |
4ca52257 JK |
758 | -nm | --no-mirrors ) |
759 | NOMIRRORS="yes"; shift ;; | |
157dc315 SZ |
760 | -nu | --no-urls ) |
761 | NOURLS="yes"; shift ;; | |
72fb89b5 | 762 | -ns | --no-srcs ) |
763 | NOSRCS="yes"; shift ;; | |
fd2b5687 MM |
764 | -ns0 | --no-source0 ) |
765 | NOSOURCE0="yes"; shift ;; | |
33a9d2d1 SZ |
766 | --opts ) |
767 | shift; RPMOPTS="${1}"; shift ;; | |
6049c3d1 | 768 | --with | --without ) |
a2d6aca2 | 769 | BCOND="$BCOND $1 $2" ; shift 2 ;; |
bde1c404 | 770 | -q | --quiet ) |
33f5276d | 771 | QUIET="--quiet"; shift ;; |
448deaa0 | 772 | --date ) |
773 | CVSDATE="${2}"; shift 2 ;; | |
67fcd1e4 | 774 | -r | --cvstag ) |
775 | shift; CVSTAG="${1}"; shift ;; | |
78ce14b3 | 776 | -Tvs | --tag-version-stable ) |
7922b3ec | 777 | COMMAND="tag"; |
78ce14b3 | 778 | TAG="STABLE" |
7922b3ec | 779 | TAG_VERSION="yes" |
780 | shift;; | |
a2164135 | 781 | -Tvn | --tag-version-nest ) |
7922b3ec | 782 | COMMAND="tag"; |
a2164135 | 783 | TAG="NEST" |
7922b3ec | 784 | TAG_VERSION="yes" |
785 | shift;; | |
78ce14b3 | 786 | -Ts | --tag-stable ) |
7922b3ec | 787 | COMMAND="tag"; |
78ce14b3 | 788 | TAG="STABLE" |
7922b3ec | 789 | TAG_VERSION="no" |
790 | shift;; | |
a2164135 | 791 | -Tn | --tag-nest ) |
7922b3ec | 792 | COMMAND="tag"; |
a2164135 | 793 | TAG="NEST" |
7922b3ec | 794 | TAG_VERSION="no" |
795 | shift;; | |
796 | -Tv | --tag-version ) | |
797 | COMMAND="tag"; | |
f02788de | 798 | TAG="" |
7922b3ec | 799 | TAG_VERSION="yes" |
800 | shift;; | |
1471f6d6 | 801 | -T | --tag ) |
7922b3ec | 802 | COMMAND="tag"; |
803 | shift | |
804 | TAG="$1" | |
805 | TAG_VERSION="no" | |
806 | shift;; | |
b130abf2 | 807 | -U | --update ) |
de6b5b2a MM |
808 | UPDATE="yes" |
809 | NODIST="yes" | |
810 | UPDATE5="yes" | |
811 | COMMAND="get" | |
812 | shift ;; | |
0096b1ae | 813 | -u | --try-upgrade ) |
3d97a432 | 814 | TRY_UPGRADE="1"; shift ;; |
a7af9862 | 815 | -un | --try-upgrade-with-float-version ) |
816 | TRY_UPGRADE="1"; FLOAT_VERSION="1"; shift ;; | |
b130abf2 TP |
817 | -v | --verbose ) |
818 | BE_VERBOSE="1"; shift ;; | |
c7ab67cf | 819 | --define) |
c24b056c | 820 | shift |
c7ab67cf SZ |
821 | MACRO="${1}" |
822 | VALUE="${2}" | |
823 | shift 2 | |
824 | RPMOPTS="${RPMOPTS} --define \"${MACRO} ${VALUE}\"" | |
825 | ;; | |
bde1c404 | 826 | * ) |
0fc6e9ec | 827 | SPECFILE="`basename ${1} .spec`.spec"; shift ;; |
5a491465 | 828 | esac |
829 | done | |
830 | ||
00fcec7e | 831 | if [ -n "$DEBUG" ]; then |
a7af9862 | 832 | set -x; |
00fcec7e | 833 | set -v; |
71d62f04 | 834 | fi |
7c2dd1b2 | 835 | |
bde1c404 | 836 | case "$COMMAND" in |
79b2ec0e | 837 | "build" | "build-binary" | "build-source" ) |
33f5276d | 838 | init_builder; |
8a7fc6f7 | 839 | if [ -n "$SPECFILE" ]; then |
59398507 | 840 | get_spec; |
841 | parse_spec; | |
298c753e AM |
842 | |
843 | if [ -n "$FAIL_IF_CHANGED_BUT_NOT_BUMPED" ]; then | |
b4fd0ec0 | 844 | TAGVER=$PACKAGE_NAME-`echo $PACKAGE_VERSION | sed -e "s/\./\_/g" -e "s/@/#/g"`-`echo $PACKAGE_RELEASE | sed -e "s/\./\_/g" -e "s/@/#/g"` |
298c753e | 845 | CURTAGREL=$(cvs status $SPECFILE | grep "Working revision:" | awk '{ print $3 }') |
1f188001 | 846 | TAGREL=$(cvs status -v $SPECFILE | grep -E "^[[:space:]]*${TAGVER}[[[:space:]]" | sed -e 's#.*(revision: ##g' -e 's#).*##g') |
298c753e AM |
847 | |
848 | if [ -n "$TAGREL" -a "$TAGREL" != "$CURTAGREL" ]; then | |
849 | Exit_error err_build_fail "not bumped ver-rel - was already used in rev $TAGREL" | |
850 | fi | |
851 | fi | |
852 | ||
25fa34fe | 853 | if [ -n "$ICONS" ]; then |
0dd6320d | 854 | get_files $ICONS; |
855 | parse_spec; | |
25fa34fe | 856 | fi |
f9a62a6a | 857 | if [ -n "$NOSOURCE0" ] ; then |
858 | SOURCES=`echo $SOURCES | xargs | sed -e 's/[^ ]*//'` | |
859 | fi | |
25fa34fe | 860 | get_files "$SOURCES $PATCHES"; |
59398507 | 861 | build_package; |
862 | else | |
33f5276d | 863 | Exit_error err_no_spec_in_cmdl; |
59398507 | 864 | fi |
865 | ;; | |
8ba5cdda | 866 | "branch" ) |
0dd6320d | 867 | init_builder; |
8ba5cdda PG |
868 | if [ -n "$SPECFILE" ]; then |
869 | get_spec; | |
870 | parse_spec; | |
871 | if [ -n "$ICONS" ]; then | |
872 | get_files $ICONS | |
873 | parse_spec; | |
874 | fi | |
875 | get_files $SOURCES $PATCHES; | |
876 | branch_files $TAG "$SOURCES $PATCHES $ICONS"; | |
877 | else | |
878 | Exit_error err_no_spec_in_cmdl; | |
879 | fi | |
0dd6320d | 880 | ;; |
bde1c404 | 881 | "get" ) |
33f5276d | 882 | init_builder; |
8a7fc6f7 | 883 | if [ -n "$SPECFILE" ]; then |
59398507 | 884 | get_spec; |
885 | parse_spec; | |
25fa34fe | 886 | if [ -n "$ICONS" ]; then |
7922b3ec | 887 | get_files $ICONS |
888 | parse_spec; | |
25fa34fe | 889 | fi |
fd2b5687 MM |
890 | if [ -n "$NOSOURCE0" ] ; then |
891 | SOURCES=`echo $SOURCES | xargs | sed -e 's/[^ ]*//'` | |
892 | fi | |
bc441b0c | 893 | get_files $SOURCES $PATCHES |
bde1c404 | 894 | else |
33f5276d | 895 | Exit_error err_no_spec_in_cmdl; |
bde1c404 | 896 | fi |
897 | ;; | |
1471f6d6 | 898 | "tag" ) |
899 | init_builder; | |
900 | if [ -n "$SPECFILE" ]; then | |
901 | get_spec; | |
902 | parse_spec; | |
903 | if [ -n "$ICONS" ]; then | |
7922b3ec | 904 | get_files $ICONS |
905 | parse_spec; | |
1471f6d6 | 906 | fi |
bc441b0c | 907 | get_files $SOURCES $PATCHES; |
1471f6d6 | 908 | tag_files "$SOURCES $PATCHES $ICONS"; |
909 | else | |
910 | Exit_error err_no_spec_in_cmdl; | |
911 | fi | |
912 | ;; | |
8bc51224 | 913 | "mr-proper" ) |
7147050f | 914 | $RPM --clean --rmsource --rmspec --force --nodeps $SPECFILE |
8bc51224 | 915 | ;; |
bde1c404 | 916 | "usage" ) |
917 | usage;; | |
4003ad8c | 918 | "version" ) |
919 | echo "$VERSION";; | |
bde1c404 | 920 | esac |
9e06e5c3 | 921 | |
922 | cd $__PWD |