autodist-upstream-updates: fixes on packages match filters

This commit is contained in:
Silvan Calarco 2013-05-21 01:40:12 +02:00
parent 53163c856a
commit 45749c8a4a

View File

@ -52,18 +52,14 @@ function usage()
get_job_vector() {
local JNAME=$1
local JNAME_ESCAPED=`echo $JNAME | tr - _ | tr . _ | tr @ _`
# resolve JOB_NAME from distdb
# note: if JOB_NAME contains a "-" it can't be a distdb JOB, so skip it
if [ "${JNAME/-/}" = "${JNAME}" ]; then
local jobtmpfile=`tempfile`
# hack to get an array variable named as $j assigned to the JOB array
echo "echo \${$JNAME[*]}" > $jobtmpfile
JOB=(`. $jobtmpfile`)
rm -f $jobtmpfile
else
JOB=()
fi
local jobtmpfile=`tempfile`
# hack to get an array variable named as $j assigned to the JOB array
echo "echo \${$JNAME_ESCAPED[*]}" > $jobtmpfile
JOB=(`. $jobtmpfile`)
rm -f $jobtmpfile
if [ ${#JOB[*]} -eq 0 ]; then
# create a default job with given JOB_NAME
@ -186,14 +182,14 @@ for rep in core community extra; do
line=`echo $line | sed "s|.*href=\"\([^\"]*\)\">.*|\1|"`
pkg=`echo $line | sed "s|\(.*\)-[^-]*-[^-]*-[^-]*|\1|"`
ver=`echo $line | sed "s|.*-\([^-]*\)-[^-]*-[^-]*|\1|"`
alias=`grep "^$pkg" $ALIASES_DB`
alias=`grep "^$pkg " $ALIASES_DB`
[ "$alias" ] || alias=`grep "^lib$pkg " $ALIASES_DB`
[ "$alias" ] && pkg=$alias
line=`grep -i "^$pkg:" $buildstmp || grep -i "^lib$pkg:" $buildstmp || grep -i " $pkg[^-_A-Za-z0-9]" $buildstmp`
[ "$alias" ] && pkgalias=${alias/* /} || pkgalias=$pkg
line=`grep -i "^$pkgalias:" $buildstmp || grep -i "^lib$pkgalias:" $buildstmp || grep -i " $pkgalias[^-_A-Za-z0-9]" $buildstmp`
if [ "$line" ]; then
pkg=${line/:*}
[ "$pkg" != "$pkgalias" ] && alias=$pkgalias || alias=
[ "$pkg" -a "$ver" ] && {
echo "$pkg $ver $SOURCEURL ${alias/* /}" >> $tmpfile
echo "$pkg $ver $SOURCEURL ${alias}" >> $tmpfile
}
fi
done