autodist-tool: use autodist --list-jobs instead of directly reading DISTDB

This commit is contained in:
Silvan Calarco 2014-06-13 12:47:16 +02:00
parent a59ea180af
commit 56f41ede80
1 changed files with 3 additions and 4 deletions

View File

@ -1,7 +1,7 @@
#!/bin/bash
#
# autodist-tool
# Copyright (c) 2008-2012 by Silvan Calarco <silvan.calarco@mambasoft.it>
# Copyright (c) 2008-2014 by Silvan Calarco <silvan.calarco@mambasoft.it>
#
. /etc/autodist/config
me=(${0##*/} $VERSION "Tue Oct 28 2008")
@ -14,7 +14,6 @@ SOURCESDIR=$AUTOUPDATEDIR/sources/
SRCPKGLIST=/var/ftp/pub/openmamba/$AUTODIST_REPOSITORY/srcpkglist
SUCCESSLISTDIR=$AUTOUPDATEDIR
SKIPPEDLISTDIR=$AUTOUPDATEDIR
DISTDBFILE=/etc/autodist/distdb
#eval `autospec -q --eval="srpms_dir"`
#eval `autospec -q --eval="rpms_dir"`
@ -133,7 +132,7 @@ elif [ "$COMMAND" = "schedule" ]; then
# while read line; do
# set -- $line
# if [ "`echo \" $1 \" | grep \" $JOB \"`" ]; then
if [ "`grep \"^$JOB \" $SRCPKGLIST`" -o "`grep \"^$JOB=(\" $DISTDBFILE`" ]; then
if [ "`grep \"^$JOB \" $SRCPKGLIST`" -o "`autodist --list-jobs | grep ^$JOB$`" ]; then
echo "Job $JOB scheduled for automatic update or rebuild"
sed -i "/^$JOB .*/d" $AUTOUPDATEDIR/manual.in
echo "$JOB $JOBVER 0" >> $AUTOUPDATEDIR/manual.in || exit 1
@ -165,7 +164,7 @@ elif [ "$COMMAND" = "skip" ]; then
if [ "$SKIPPEDLINE" ]; then
sed -i "/^$PKGNAME /d" $SKIPPEDLISTDIR/*.skip
fi
if [ "`grep \"^$JOB \" $SRCPKGLIST`" -o "`grep \"^$JOB=(\" $DISTDBFILE`" ]; then
if [ "`grep \"^$JOB \" $SRCPKGLIST`" -o "`autodist --list-jobs | grep ^$JOB$`" ]; then
echo "$JOB $DATE_NOW 101" >> $SKIPPEDLISTDIR/auto.skip
echo "Job $JOB skipped from automatic builds"
else