find_mirror - what to do with mirrors file
-src_md5 - is it still used
+src_md5: is it worth to keep additional-md5sums
init_rpm_dir
local md5
if [ -f additional-md5sums ]; then
- local spec_rev=$(grep $SPECFILE CVS/Entries 2>/dev/null | sed -e s:/$SPECFILE/:: -e s:/.*::)
- if [ -z "$spec_rev" ]; then
- spec_rev=$(head -n 1 $SPECFILE | sed -e 's/.*\$Revision: \([0-9.]*\).*/\1/')
- fi
- local spec="$SPECFILE[0-9.,]*,$(echo $spec_rev | sed 's/\./\\./g')"
md5=$(grep -s -v '^#' additional-md5sums | \
- grep -E "[ ]$(basename "$1")[ ]+${spec}([ ,]|\$)" | \
+ grep -E "[ ]$(basename "$1")([ ,]|\$)" | \
sed -e 's/^\([0-9a-f]\{32\}\).*/\1/' | \
grep -E '^[0-9a-f]{32}$')
# remove spec and sources
$RPMBUILD --clean --rmsource --rmspec --nodeps --define "_specdir $PACKAGE_DIR" --define "_sourcedir $PACKAGE_DIR" $SPECFILE
- rm -rf $PACKAGE_DIR/.git
+ rm -rf $PACKAGE_DIR/.git .gitignore
+ cd $__PWD
+ rmdir --ignore-fail-on-non-empty $PACKAGE_DIR
}
#---------------------------------------------