[Piuparts-commits] rev 402 - in piatti/home: piupartsm/bin piupartss/bin
Holger Levsen
holger at alioth.debian.org
Mon May 11 11:09:34 UTC 2009
Author: holger
Date: 2009-05-11 11:09:34 +0000 (Mon, 11 May 2009)
New Revision: 402
Modified:
piatti/home/piupartsm/bin/detect_archive_issues
piatti/home/piupartsm/bin/detect_network_issues
piatti/home/piupartsm/bin/detect_slave_problems
piatti/home/piupartsm/bin/detect_well_known_errors
piatti/home/piupartsm/bin/prepare_backup
piatti/home/piupartsm/bin/report_untestable_packages
piatti/home/piupartss/bin/detect_leftover_processes
Log:
parse piuparts.conf instead of hardcoding those two values taken from there
Modified: piatti/home/piupartsm/bin/detect_archive_issues
===================================================================
--- piatti/home/piupartsm/bin/detect_archive_issues 2009-05-11 09:47:12 UTC (rev 401)
+++ piatti/home/piupartsm/bin/detect_archive_issues 2009-05-11 11:09:34 UTC (rev 402)
@@ -16,19 +16,29 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-MASTER=/org/piuparts.debian.org/master
-DISTROS="sid squeeze"
+#
+# parse config file
+#
+TEMPFILE=`mktemp`
+egrep "(^sections|^master-directory)" /etc/piuparts/piuparts.conf| sed -e "s# ##g" -e "s#sections#SECTIONS#" -e "s#master-directory#MASTER#" > $TEMPFILE
+source $TEMPFILE
+rm $TEMPFILE
+if [ -z $MASTER ] || [ -z $SECTIONS ] ; then
+ echo "sections and/or master-directory not set in /etc/piuparts/piuparts.conf, exiting."
+ exit 1
+fi
+
#
# detect packages which are/were untestable due to archive issue and mark them as such
#
LOGS=`mktemp`
-for distro in $DISTROS ; do
- rgrep -l "E: Broken packages" $MASTER/$distro/fail 2>/dev/null >> $LOGS
+for SECTION in $SECTIONS ; do
+ rgrep -l "E: Broken packages" $MASTER/$SECTION/fail 2>/dev/null >> $LOGS
if [ -s $LOGS ] ; then
- for package_log in $(grep $distro $LOGS) ; do
- mv $package_log $MASTER/$distro/untestable/
+ for package_log in $(grep $SECTION $LOGS) ; do
+ mv $package_log $MASTER/$SECTION/untestable/
done
fi
done
@@ -36,7 +46,7 @@
echo "Broken packages detected!"
echo "(By grep'ing for 'E: Broken packages' in failed logs.)"
echo
- echo 'The following packages have been moved to $distro/untestable and will be'
+ echo 'The following packages have been moved to $section/untestable and will be'
echo "tested again in 7 days."
echo
echo "Broken packages are usually a temporarily problem in the archive and are"
@@ -45,7 +55,7 @@
echo "If is is always the same package failing, it's likely to be an issue in the"
echo "package."
echo
- cat $LOGS | sed -e "s#/org/piuparts.debian.org/master/#http://piuparts.debian.org/#g" -e "s#/fail#/untestable#g"
+ cat $LOGS | sed -e "s#$MASTER#http://piuparts.debian.org/#g" -e "s#/fail#/untestable#g"
echo
fi
rm $LOGS
Modified: piatti/home/piupartsm/bin/detect_network_issues
===================================================================
--- piatti/home/piupartsm/bin/detect_network_issues 2009-05-11 09:47:12 UTC (rev 401)
+++ piatti/home/piupartsm/bin/detect_network_issues 2009-05-11 11:09:34 UTC (rev 402)
@@ -16,17 +16,28 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-MASTER=/org/piuparts.debian.org/master
-DISTROS="sid squeeze"
+#
+# parse config file
+#
+TEMPFILE=`mktemp`
+egrep "(^sections|^master-directory)" /etc/piuparts/piuparts.conf| sed -e "s# ##g" -e "s#sections#SECTIONS#" -e "s#master-directory#MASTER#" > $TEMPFILE
+source $TEMPFILE
+rm $TEMPFILE
+if [ -z $MASTER ] || [ -z $SECTIONS ] ; then
+ echo "sections and/or master-directory not set in /etc/piuparts/piuparts.conf, exiting."
+ exit 1
+fi
+
+#
+# detect network/mirror problems
+#
+
FILE=`mktemp`
-
-for distro in $DISTROS ; do
- rgrep -l "Cannot initiate the connection to" $MASTER/$distro/fail >> $FILE
- rgrep -l -e "W: Failed to fetch.*Could not resolve" $MASTER/$distro/fail >> $FILE
+for SECTION in $SECTIONS ; do
+ rgrep -l "Cannot initiate the connection to" $MASTER/$SECTION/fail >> $FILE
+ rgrep -l -e "W: Failed to fetch.*Could not resolve" $MASTER/$SECTION/fail >> $FILE
done
-
-
if [ -s $FILE ] ; then
echo "Network problems on detected!"
echo "(By grep'ing for 'Cannot initiate the connection to'"
@@ -37,13 +48,13 @@
echo "If it is always the same package failing, it's likely to be an issue in the"
echo "package."
echo
- sort -u $FILE | sed -e "s#/org/piuparts.debian.org/master/#http://piuparts.debian.org/#g"
+ sort -u $FILE | sed -e "s#$MASTER#http://piuparts.debian.org/#g"
echo
- sort -u $FILE | sed -e "s#/org/piuparts.debian.org/master/#less /org/piuparts.debian.org/master/#"
+ sort -u $FILE | sed -e "s#$MASTER#less $MASTER#"
echo
echo "----------------------------------------------------------------------"
echo
- sort -u $FILE | sed -e "s#/org/piuparts.debian.org/master/#rm /org/piuparts.debian.org/master/#"
+ sort -u $FILE | sed -e "s#$MASTER#rm $MASTER#"
echo
fi
rm $FILE
Modified: piatti/home/piupartsm/bin/detect_slave_problems
===================================================================
--- piatti/home/piupartsm/bin/detect_slave_problems 2009-05-11 09:47:12 UTC (rev 401)
+++ piatti/home/piupartsm/bin/detect_slave_problems 2009-05-11 11:09:34 UTC (rev 402)
@@ -17,16 +17,30 @@
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
+# parse config file
+#
+
+TEMPFILE=`mktemp`
+egrep "(^sections|^master-directory)" /etc/piuparts/piuparts.conf| sed -e "s# ##g" -e "s#sections#SECTIONS#" -e "s#master-directory#MASTER#" > $TEMPFILE
+source $TEMPFILE
+rm $TEMPFILE
+if [ -z $MASTER ] || [ -z $SECTIONS ] ; then
+ echo "sections and/or master-directory not set in /etc/piuparts/piuparts.conf, exiting."
+ exit 1
+fi
+
+#
# this scripts monitors the output of piuparts-slave
# when running in screen started by ~piupartss/bin/slave_run on piatti
#
+
HOSTNAME=`hostname`
if [ "$HOSTNAME" != "piatti" ] ; then
exit 0
fi
-SCREENLOG=/org/piuparts.debian.org/slave/screenlog.0
-MONITORDIR=/org/piuparts.debian.org/master/monitor-slave
+SCREENLOG=$MASTER/../slave/screenlog.0
+MONITORDIR=$MASTER/monitor-slave
LOCKFILE="$MONITORDIR/slave-problems"
mkdir -p $MONITORDIR
@@ -55,6 +69,7 @@
#
# disabled, report should be enough to confirm the slave is still running...
exit 0
+
HOUR=`date +%H`
if [ "$HOUR" = "00" ] ; then
touch screenlog.yesterday
Modified: piatti/home/piupartsm/bin/detect_well_known_errors
===================================================================
--- piatti/home/piupartsm/bin/detect_well_known_errors 2009-05-11 09:47:12 UTC (rev 401)
+++ piatti/home/piupartsm/bin/detect_well_known_errors 2009-05-11 11:09:34 UTC (rev 402)
@@ -16,16 +16,26 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-MASTER=/org/piuparts.debian.org/master
-DISTROS="sid squeeze"
+#
+# parse config file
+#
+TEMPFILE=`mktemp`
+egrep "(^sections|^master-directory)" /etc/piuparts/piuparts.conf| sed -e "s# ##g" -e "s#sections#SECTIONS#" -e "s#master-directory#MASTER#" > $TEMPFILE
+source $TEMPFILE
+rm $TEMPFILE
+if [ -z $MASTER ] || [ -z $SECTIONS ] ; then
+ echo "sections and/or master-directory not set in /etc/piuparts/piuparts.conf, exiting."
+ exit 1
+fi
+
#
# detect packages which leave stuff in /usr/local (see policy 9.1.2)
#
LOGS=`mktemp`
-for distro in $DISTROS ; do
- rgrep "not owned" $MASTER/$distro/fail|grep usr/local/|cut -d " " -f1|sed -e "s#log:#log#"|sort -u 2>/dev/null >> $LOGS
+for SECTION in $SECTIONS ; do
+ rgrep "not owned" $MASTER/$SECTION/fail|grep usr/local/|cut -d " " -f1|sed -e "s#log:#log#"|sort -u 2>/dev/null >> $LOGS
done
if [ -s $LOGS ] ; then
echo
@@ -35,12 +45,12 @@
echo
echo "Please file bugs!"
echo
- for distro in $DISTROS ; do
- COUNT=$(grep "/$distro/" $LOGS | cut -d "_" -f1|sort -u|wc -l)
- echo "Affected packages in $distro: " $COUNT
+ for SECTION in $SECTIONS ; do
+ COUNT=$(grep "/$SECTION/" $LOGS | cut -d "_" -f1|sort -u|wc -l)
+ echo "Affected packages in $SECTION: " $COUNT
done
echo
- cat $LOGS | sed -e "s#/org/piuparts.debian.org/master/#http://piuparts.debian.org/#g"
+ cat $LOGS | sed -e "s#$MASTER#http://piuparts.debian.org/#g"
echo
fi
rm $LOGS
@@ -50,8 +60,8 @@
#
LOGS=`mktemp`
-for distro in $DISTROS ; do
- rgrep "not owned" $MASTER/$distro/fail|grep -v "/usr/share/mime/"|grep -v usr/local/|cut -d " " -f1|sed -e "s#log:#log#"|sort -u 2>/dev/null >> $LOGS
+for SECTION in $SECTIONS ; do
+ rgrep "not owned" $MASTER/$SECTION/fail|grep -v "/usr/share/mime/"|grep -v usr/local/|cut -d " " -f1|sed -e "s#log:#log#"|sort -u 2>/dev/null >> $LOGS
done
if [ -s $LOGS ] ; then
echo "WARNING: this list might contain false positives."
@@ -65,12 +75,12 @@
echo
echo "Please file bugs!"
echo
- for distro in $DISTROS ; do
- COUNT=$(grep "/$distro/" $LOGS | cut -d "_" -f1|sort -u|wc -l)
- echo "Affected packages in $distro: " $COUNT
+ for SECTION in $SECTIONS ; do
+ COUNT=$(grep "/$SECTION/" $LOGS | cut -d "_" -f1|sort -u|wc -l)
+ echo "Affected packages in $SECTION: " $COUNT
done
echo
- cat $LOGS | sed -e "s#/org/piuparts.debian.org/master/#http://piuparts.debian.org/#g"
+ cat $LOGS | sed -e "s#$MASTER#http://piuparts.debian.org/#g"
echo
fi
rm $LOGS
Modified: piatti/home/piupartsm/bin/prepare_backup
===================================================================
--- piatti/home/piupartsm/bin/prepare_backup 2009-05-11 09:47:12 UTC (rev 401)
+++ piatti/home/piupartsm/bin/prepare_backup 2009-05-11 11:09:34 UTC (rev 402)
@@ -17,6 +17,18 @@
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
+# parse config file
+#
+TEMPFILE=`mktemp`
+egrep "(^sections|^master-directory)" /etc/piuparts/piuparts.conf| sed -e "s# ##g" -e "s#sections#SECTIONS#" -e "s#master-directory#MASTER#" > $TEMPFILE
+source $TEMPFILE
+rm $TEMPFILE
+if [ -z $MASTER ] || [ -z $SECTIONS ] ; then
+ echo "sections and/or master-directory not set in /etc/piuparts/piuparts.conf, exiting."
+ exit 1
+fi
+
+#
# backup statistiscs files to a single directory for DSA to backup
# piuparts.d.o's state is not backupped
# (currently it takes one month to run a full piuparts test on a suite
@@ -24,11 +36,10 @@
# not much value)
#
BACKUPDIR=/org/piuparts.debian.org/backup
-DISTROS="sid squeeze"
HTDOCS=/org/piuparts.debian.org/htdocs
-for distro in $DISTROS ; do
- mkdir -p $BACKUPDIR/$distro
- cp $HTDOCS/$distro/counts.txt $BACKUPDIR/$distro/
+for SECTION in $SECTIONS ; do
+ mkdir -p $BACKUPDIR/$SECTION
+ cp $HTDOCS/$SECTION/counts.txt $BACKUPDIR/$SECTION/
done
Modified: piatti/home/piupartsm/bin/report_untestable_packages
===================================================================
--- piatti/home/piupartsm/bin/report_untestable_packages 2009-05-11 09:47:12 UTC (rev 401)
+++ piatti/home/piupartsm/bin/report_untestable_packages 2009-05-11 11:09:34 UTC (rev 402)
@@ -16,19 +16,29 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-MASTER=/org/piuparts.debian.org/master
-DISTROS="sid squeeze"
-DAYS=7
+#
+# parse config file
+#
+TEMPFILE=`mktemp`
+egrep "(^sections|^master-directory)" /etc/piuparts/piuparts.conf| sed -e "s# ##g" -e "s#sections#SECTIONS#" -e "s#master-directory#MASTER#" > $TEMPFILE
+source $TEMPFILE
+rm $TEMPFILE
+if [ -z $MASTER ] || [ -z $SECTIONS ] ; then
+ echo "sections and/or master-directory not set in /etc/piuparts/piuparts.conf, exiting."
+ exit 1
+fi
+
#
# find packages which have been in untestable for more than $DAYS days and reschedule them for testing
#
+DAYS=7
LOGS=`mktemp`
find $MASTER/*/untestable/ -mtime +$DAYS -name "*.log" 2>/dev/null > $LOGS
if [ -s $LOGS ] ; then
- for distro in $DISTROS ; do
- for package_log in $(grep $distro $LOGS) ; do
+ for SECTION in $SECTIONS ; do
+ for package_log in $(grep $SECTION $LOGS) ; do
rm -f $package_log
done
done
Modified: piatti/home/piupartss/bin/detect_leftover_processes
===================================================================
--- piatti/home/piupartss/bin/detect_leftover_processes 2009-05-11 09:47:12 UTC (rev 401)
+++ piatti/home/piupartss/bin/detect_leftover_processes 2009-05-11 11:09:34 UTC (rev 402)
@@ -16,7 +16,24 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-MONITORDIR=/org/piuparts.debian.org/master/monitor-slave
+#
+# parse config file
+#
+
+TEMPFILE=`mktemp`
+egrep "(^sections|^master-directory)" /etc/piuparts/piuparts.conf| sed -e "s# ##g" -e "s#sections#SECTIONS#" -e "s#master-directory#MASTER#" > $TEMPFILE
+source $TEMPFILE
+rm $TEMPFILE
+if [ -z $MASTER ] || [ -z $SECTIONS ] ; then
+ echo "sections and/or master-directory not set in /etc/piuparts/piuparts.conf, exiting."
+ exit 1
+fi
+
+#
+# find processes running in deleted chroots
+#
+
+MONITORDIR=$MASTER/monitor-slave
LOCKFILE="$MONITORDIR/leftover_processes"
OUTPUT=$(sudo ls --color=never -lad /proc/*/root 2>/dev/null|grep "/org/piuparts.debian.org/tmp" | grep "(deleted)")
More information about the Piuparts-commits
mailing list