fi
update_shell_title "cache_rpm_dump"
-rpm_dump_cache=`
+ local rpm_dump=`
+
# we reset macros not to contain macros.build as all the %() macros are
# executed here, while none of them are actually needed
# what we need from dump is NAME, VERSION, RELEASE and PATCHES/SOURCES.
;;
esac`
if [ $? -gt 0 ]; then
- echo "$rpm_dump_cache" | sed -ne '/^error:/,$p' >&2
- Exit_error err_build_fail;
+ error=$(echo "$rpm_dump_cache" | sed -ne '/^error:/,$p')
+
+ # ignore error if it contains "Unable to open icon"
+ if [[ $error != *error:?Unable?to?open?icon* ]]; then
+ echo "$error" >&2
+ Exit_error err_build_fail;
+ fi
fi
+
+ # make small dump cache
+ rpm_dump_cache=`echo "$rpm_dump" | awk '
+ /SOURCEURL[0-9]+/ {print}
+ /PATCHURL[0-9]+/ {print}
+ /:.*nosource.*1"/ {print}
+ /PACKAGE_/ {print}
+ '`
+
update_shell_title "cache_rpm_dump: OK!"
}
echo "$rpm_dump_cache"
}
+get_icons()
+{
+ update_shell_title "get icons"
+ ICONS="`awk '/^Icon:/ {print $2}' ${SPECFILE}`"
+ if [ -z "$ICONS" ]; then
+ return
+ fi
+
+ rpm_dump_cache="böö" NODIST="yes" UPDATE5= get_files $ICONS
+}
+
parse_spec()
{
update_shell_title "parsing specfile"
set -v;
fi
+ # icons are needed for successful spec parse
+ get_icons;
+
cd $SPECS_DIR
cache_rpm_dump
local result=1
local retries_counter=0
- update_shell_title "cvsup: $# files"
+ if [ $# = 1 ]; then
+ update_shell_title "cvsup: $*"
+ else
+ update_shell_title "cvsup: $# files"
+ fi
while [ "$result" != "0" -a "$retries_counter" -le "$CVS_RETRIES" ]; do
retries_counter=$(( $retries_counter + 1 ))
output=$(LC_ALL=C cvs $OPTIONS "$@" 2>&1)
echo "Warning: no URL given for $i"
fi
- if [ -n "$(src_md5 "$i")" ] && [ -z "$NODIST" ]; then
+ if [ -z "$NODIST" ] && [ -n "$(src_md5 "$i")" ]; then
if good_md5 "$i" && good_size "$i"; then
echo "$(nourl "$i") having proper md5sum already exists"
continue
rm -f "$target"
FROM_DISTFILES=0
fi
- elif [ -z "$(src_md5 "$i")" -a "$NOCVS" != "yes" ]; then
- get_files_cvs="$get_files_cvs $fp"
- update_shell_title "$fp (will cvs up later)"
- cvsup=1
+ elif [ "$NOCVS" != "yes" -a -z "$(src_md5 "$i")" ]; then
+ if [ $# -gt 1 ]; then
+ get_files_cvs="$get_files_cvs $fp"
+ update_shell_title "$fp (will cvs up later)"
+ cvsup=1
+ else
+ cvsup $fp
+ fi
fi
if [ -z "$NOURLS" ] && [ ! -f "$fp" -o -n "$UPDATE" ] && [ "`echo $i | grep -E 'ftp://|http://|https://'`" ]; then
eval "perl -pi -e 's/Version:\t"$TOLDVER"/Version:\t"$TNEWVER"/gs' $SPECFILE"
eval "perl -pi -e 's/Release:\t[1-9]{0,4}/Release:\t0.1/' $SPECFILE"
parse_spec;
- if [ -n "$ICONS" ]; then
- get_files $ICONS;
- parse_spec;
- fi
NODIST="yes" UPDATE5="yes" get_files $SOURCES $PATCHES;
unset TOLDVER TNEWVER TNOTIFY
fi
fi
fi
- if [ -n "$ICONS" ]; then
- get_files $ICONS;
- parse_spec;
- fi
if [ -n "$NOSOURCE0" ] ; then
SOURCES=`echo $SOURCES | xargs | sed -e 's/[^ ]*//'`
fi
if [ -n "$SPECFILE" ]; then
get_spec;
parse_spec;
- if [ -n "$ICONS" ]; then
- get_files $ICONS
- parse_spec;
- fi
get_files $SOURCES $PATCHES;
branch_files $TAG "$SOURCES $PATCHES $ICONS";
else
init_builder;
if [ -n "$SPECFILE" ]; then
get_spec;
- parse_spec;
- if [ -n "$ICONS" ]; then
- OLD_UPDATE5=$UPDATE5
- UPDATE5= get_files $ICONS
- UPDATE5=$OLD_UPDATE5
- parse_spec;
- fi
+ parse_spec
+
if [ -n "$NOSOURCE0" ] ; then
SOURCES=`echo $SOURCES | xargs | sed -e 's/[^ ]*//'`
fi
if [ -n "$SPECFILE" ]; then
get_spec;
parse_spec;
- if [ -n "$ICONS" ]; then
- get_files $ICONS
- parse_spec;
- fi
+
# don't fetch sources from remote locations
new_SOURCES=""
for file in $SOURCES