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