GETLOCAL="cp -a"
if (rpm --version 2>&1 | grep -q '4.0.[0-2]'); then
- RPM="rpm"
- RPMBUILD="rpm"
+ RPM="rpm"
+ RPMBUILD="rpm"
else
- RPM="rpm"
- RPMBUILD="rpmbuild"
+ RPM="rpm"
+ RPMBUILD="rpmbuild"
fi
POLDEK_INDEX_DIR="`$RPM --eval %_rpmdir`/"
# in command line.
# This one reads global system environment settings:
if [ -f ~/etc/builderrc ]; then
- . ~/etc/builderrc
+ . ~/etc/builderrc
fi
# And this one cascades settings using user personal
# builder settings.
PATCHES="`rpm_dump | awk '/PATCHURL[0-9]+/ {print $3}'`"
ICONS="`awk '/^Icon:/ {print $2}' ${SPECFILE}`"
- PACKAGE_NAME="`$RPM -q --qf '%{NAME}\n' --specfile ${SPECFILE} 2> /dev/null | head -1`"
- PACKAGE_VERSION="`$RPM -q --qf '%{VERSION}\n' --specfile ${SPECFILE} 2> /dev/null| head -1`"
- PACKAGE_RELEASE="`$RPM -q --qf '%{RELEASE}\n' --specfile ${SPECFILE} 2> /dev/null | head -1`"
+ PACKAGE_NAME="`$RPM -q --qf '%{NAME}\n' --specfile ${SPECFILE} 2> /dev/null | head -n 1`"
+ PACKAGE_VERSION="`$RPM -q --qf '%{VERSION}\n' --specfile ${SPECFILE} 2> /dev/null| head -n 1`"
+ PACKAGE_RELEASE="`$RPM -q --qf '%{RELEASE}\n' --specfile ${SPECFILE} 2> /dev/null | head -n 1`"
if [ -n "$BE_VERBOSE" ]; then
echo "- Sources : `nourl $SOURCES`"
rpm_dump | \
grep "SOURCEURL[0-9]*[ ]*$1""[ ]*$" | \
sed -e 's/.*SOURCEURL\([0-9][0-9]*\).*/\1/' | \
- head -1 | xargs
+ head -n 1 | xargs
}
src_md5 ()
cd $SPECS_DIR
spec_rev=$(grep $SPECFILE CVS/Entries | sed -e s:/$SPECFILE/:: -e s:/.*::)
if [ -z "$spec_rev" ]; then
- spec_rev="$(head -1 $SPECFILE | sed -e 's/.*\$Revision: \([0-9.]*\).*/\1/')"
+ spec_rev="$(head -n 1 $SPECFILE | sed -e 's/.*\$Revision: \([0-9.]*\).*/\1/')"
fi
spec="$SPECFILE[0-9.,]*,$(echo $spec_rev | sed 's/\./\\./g')"
md5=$(grep -s -v '^#' additional-md5sums | \
if [ $(echo "$md5" | wc -l) != 1 ] ; then
echo "$SPECFILE: more then one entry in additional-md5sums for $1" 1>&2
fi
- echo "$md5" | tail -1
+ echo "$md5" | tail -n 1
fi
}
${GETURI2} -O "$target" "$url"
fi
fi
- if ! test -s "$target"; then
- rm -f "$target"
+ if ! test -s "$target"; then
+ rm -f "$target"
if [ `echo $url_attic | grep -E '^(\.|/)'` ]; then
${GETLOCAL} $url_attic $target
else
fi
fi
fi
- if ! test -s "$target"; then
- rm -f "$target"
- FROM_DISTFILES=0
- fi
+ if ! test -s "$target"; then
+ rm -f "$target"
+ FROM_DISTFILES=0
+ fi
elif [ -z "$(src_md5 "$i")" -a "$NOCVS" != "yes" ]; then
# ( echo $i | grep -qvE '(ftp|http|https)://' ); -- if CVS should be used, but URLs preferred
result=1
fi
done
fi
-
+
if [ -z "$NOURLS" ] && [ ! -f "`nourl $i`" -o -n "$UPDATE" ] && [ `echo $i | grep -E 'ftp://|http://|https://'` ]; then
if [ -z "$NOMIRRORS" ]; then
im="`find_mirror "$i"`"
fi
fi
-
fi
srcno=$(src_no $i)
if [ ! -f "`nourl $i`" -a "$FAIL_IF_NO_SOURCES" != "no" ]; then
cd $SOURCE_DIR
for i in $TAG_FILES
do
- # don't tag non cvs files (ie. stored on distfiles)
-# FIXME! file_has_url != file_is_on_distfiles
-# [ "`nourl $i`" != "$i" ] && continue
+ # don't tag files stored on distfiles
+ [ -n "`src_md5 $i`" ] && continue
if [ -f "`nourl $i`" ]; then
if [ "$TAG_VERSION" = "yes" ]; then
cvs $OPTIONS $TAGVER `nourl $i`
fi
;;
"tag" )
+ NOURLS=1
+ NODIST=1
init_builder;
if [ -n "$SPECFILE" ]; then
get_spec;
new_SOURCES=""
for file in $SOURCES
do
- [ "`nourl $file`" != "$file" ] && continue
+ [ -n "`src_md5 $file`" ] && continue
new_SOURCES="$new_SOURCES $file"
done
SOURCES="$new_SOURCES"