Skip to content
Commits on Source (2)
......@@ -18,14 +18,19 @@
#
publish_logs() {
local TEMPORARY_OUTPUT=$1
local HTDOCS="$2"
local LOG=$3
local LOG_OUTPUT=$1
local LOG_PREFIX=$2
local HTDOCS="$3"
local LOG=$4
local YEAR=$(date -u +%Y)
local MONTH=$(date -u +%m)
local DAY=$(date -u +%d)
local DIR="$HTDOCS/logs/$YEAR/$MONTH/$DAY"
mkdir -p "$DIR"
cat $TEMPORARY_OUTPUT >> "$DIR/$LOG.txt"
rm -f $TEMPORARY_OUTPUT >/dev/null
if [ -n "$LOG_PREFIX" ] && [ ! -s "$DIR/$LOG.txt" ] ; then
cat $LOG_PREFIX >> "$DIR/$LOG.txt"
rm -f $LOG_PREFIX >/dev/null
fi
cat $LOG_OUTPUT >> "$DIR/$LOG.txt"
rm -f $LOG_OUTPUT >/dev/null
}
......@@ -27,7 +27,8 @@ get_config_value URLBASE global urlbase https://piuparts.debian.org
get_config_value DAYS global reschedule-untestable-days 7
ISSUE_LOG="$MASTER/archive_issues.txt"
TEMPORARY_OUTPUT=`mktemp`
LOG_OUTPUT=`mktemp`
LOG_PREFIX=$(mktemp)
STARTDATE=$(date -u +%s)
......@@ -63,9 +64,6 @@ if [ -s $URLS ]; then
FINALDATE=$(date -u +%s)
RUNTIME=$(date -u -d "0 $FINALDATE seconds - $STARTDATE seconds" +%T)
(
echo "$(date -u)"
echo "Runtime: $RUNTIME"
echo
echo "Broken packages detected! The following packages have been moved to"
echo "$section/untestable and will be tested again in $DAYS days."
echo
......@@ -74,14 +72,19 @@ if [ -s $URLS ]; then
echo "If it is always the same package failing, it's likely to be an issue in the"
echo "package."
echo
grep -f $URLS $ISSUE_LOG | sort | uniq -c | sort -rn
echo
echo "Those problems were found in failed logs by grep'ing for these patterns:"
echo " 'E: Broken packages'"
echo " 'E: Unable to correct problems, you have held broken packages'"
echo " 'E: Error, pkgProblemResolver::Resolve generated breaks'"
echo
) > $TEMPORARY_OUTPUT
publish_logs $TEMPORARY_OUTPUT $HTDOCS archive_issues
) > $LOG_PREFIX
(
echo "$(date -u)"
echo "Runtime: $RUNTIME"
echo
grep -f $URLS $ISSUE_LOG | sort | uniq -c | sort -rn
echo
) > $LOG_OUTPUT
publish_logs $LOG_OUTPUT $LOG_PREFIX $HTDOCS archive_issues
fi
rm $LOGS $URLS
......@@ -25,7 +25,8 @@ get_config_value SECTIONS global sections
get_config_value HTDOCS global output-directory
STARTDATE=$(date -u +%s)
TEMPORARY_OUTPUT=$(mktemp)
LOG_OUTPUT=$(mktemp)
LOG_PREFIX=$(mktemp)
#
# detect network/mirror problems
......@@ -75,12 +76,17 @@ done
if [ -s $FILE ] ; then
FINALDATE=$(date -u +%s)
RUNTIME=$(date -u -d "0 $FINALDATE seconds - $STARTDATE seconds" +%T)
(
echo "Network problems detected! The following logfiles have been deleted:"
echo
echo "Those problems were found in failed logs by grep'ing for these patterns:"
echo "$DISPLAY_PATTERN"
echo
) > $LOG_PREFIX
(
echo "$(date -u)"
echo "Runtime: $RUNTIME"
echo
echo "Network problems detected! The following logfiles have been deleted:"
echo
for log in $(sort -u $FILE)
do
echo "$log" | cut -d "/" -f5-
......@@ -88,9 +94,7 @@ if [ -s $FILE ] ; then
rm -f "$log"
done
echo
echo "Those problems were found in failed logs by grep'ing for these patterns:"
echo "$DISPLAY_PATTERN"
) > $TEMPORARY_OUTPUT
publish_logs $TEMPORARY_OUTPUT $HTDOCS network_issues
) > $LOG_OUTPUT
publish_logs $LOG_OUTPUT $LOG_PREFIX $HTDOCS network_issues
fi
rm $FILE
......@@ -25,7 +25,8 @@ get_config_value SECTIONS global sections
get_config_value HTDOCS global output-directory
STARTDATE=$(date -u +%s)
TEMPORARY_OUTPUT=$(mktemp)
LOG_OUTPUT=$(mktemp)
LOG_PREFIX=$(mktemp)
#
# detect piuparts problems
......@@ -99,13 +100,18 @@ if [ -s $FILE ] ; then
FINALDATE=$(date -u +%s)
RUNTIME=$(date -u -d "0 $FINALDATE seconds - $STARTDATE seconds" +%T)
(
echo "$(date -u)"
echo "Runtime: $RUNTIME"
echo
echo "piuparts problems detected! Please review the following logfiles/packages."
echo "If it is always the same package failing, it's likely to be an issue in the"
echo "package."
echo
echo "Problems were found in failed logs by grep'ing for these patterns:"
echo "$DISPLAY_PATTERN"
echo
) > $LOG_PREFIX
(
echo "$(date -u)"
echo "Runtime: $RUNTIME"
echo
echo "The following logfiles have been deleted:"
echo
for log in $(sort -u $FILE)
......@@ -116,10 +122,7 @@ if [ -s $FILE ] ; then
rm -f "$log"
done
echo
echo "Those problems were found in failed logs by grep'ing for these patterns:"
echo "$DISPLAY_PATTERN"
echo
) > $TEMPORARY_OUTPUT
publish_logs $TEMPORARY_OUTPUT $HTDOCS piuparts_issues
) > $LOG_OUTPUT
publish_logs $LOG_OUTPUT $LOG_PREFIX $HTDOCS piuparts_issues
fi
rm $FILE
......@@ -20,7 +20,7 @@
get_config_value HTDOCS global output-directory
TEMPORARY_OUTPUT=$(mktemp)
LOG_OUTPUT=$(mktemp)
$1 >$TEMPORARY_OUTPUT 2>&1
publish_logs $TEMPORARY_OUTPUT $HTDOCS $1
$1 >$LOG_OUTPUT 2>&1
publish_logs $LOG_OUTPUT "" $HTDOCS $1
......@@ -26,7 +26,7 @@ get_config_value HTDOCS global output-directory
STARTDATE=$(date -u +%s)
OUTPUT=$(mktemp)
TEMPORARY_OUTPUT=$(mktemp)
LOG_OUTPUT=$(mktemp)
#
# reschedule 200 oldest log files, if they are older than 180 days
......@@ -41,7 +41,6 @@ get_config_value COUNT global reschedule-old-count 200
get_config_value EXPIRE_FAIL_AGE global expire-fail-days 0
get_config_value FAIL_AGE global reschedule-fail-days 30
get_config_value FAIL_COUNT global reschedule-fail-count 25
get_config_value AUTO_RESCHEDULE global auto-reschedule yes
......@@ -208,7 +207,9 @@ RUNTIME=$(date -u -d "0 $FINALDATE seconds - $STARTDATE seconds" +%T)
fi
echo
cat $OUTPUT
echo "##################################################################################################################" >> $OUTPUT
echo "##################################################################################################################" >> $OUTPUT
echo
) > $TEMPORARY_OUTPUT
publish_logs $TEMPORARY_OUTPUT $HTDOCS reschedule_oldest_logs
) > $LOG_OUTPUT
publish_logs $LOG_OUTPUT "" $HTDOCS reschedule_oldest_logs
rm -f $OUTPUT
......@@ -52,11 +52,11 @@ for SECTION in $SECTIONS ; do
done
if [ -s $OUTPUT ] ; then
TEMPORARY_OUTPUT=$(mktemp)
echo "$(date -u)" > $TEMPORARY_OUTPUT
echo >> $TEMPORARY_OUTPUT
cat $OUTPUT >> $TEMPORARY_OUTPUT
echo >> $TEMPORARY_OUTPUT
publish_logs $TEMPORARY_OUTPUT $HTDOCS rotate_master_logs
LOG_OUTPUT=$(mktemp)
echo "$(date -u)" > $LOG_OUTPUT
echo >> $LOG_OUTPUT
cat $OUTPUT >> $LOG_OUTPUT
echo >> $LOG_OUTPUT
publish_logs $LOG_OUTPUT "" $HTDOCS rotate_master_logs
fi
rm $OUTPUT