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