Package: apticron Version: 1.1.45 Severity: minor hi this patch avoids NUM_PACKAGES to be displayed at the beginning of the custom subject
sylvain -- System Information: Debian Release: 5.0.8 APT prefers oldstable APT policy: (500, 'oldstable') Architecture: i386 (x86_64) Kernel: Linux 2.6.26-2-amd64 (SMP w/2 CPU cores) Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash
diff --git a/apticron b/apticron index fdb9e5a..6313ba6 100755 --- a/apticron +++ b/apticron @@ -94,12 +94,6 @@ DISTRIB_ID="Debian" # Default to Debian # Source the config file [ -e /etc/apticron/apticron.conf ] && . /etc/apticron/apticron.conf -if [ -n "$CUSTOM_SUBJECT" ] ; then - MAILX_SUBJECT="$CUSTOM_SUBJECT" -else - MAILX_SUBJECT="$DISTRIB_ID package update(s) for $SYSTEM" -fi - if [ -z "$IPADDRESSES" ] && [ -x /sbin/ip ]; then # Set the IPv4 addresses IPADDRESSES=`(echo $( /bin/hostname -i ) ; @@ -170,6 +164,13 @@ fi NUM_PACKAGES=`echo $PKGNAMES |wc -w` +if [ -n "$CUSTOM_SUBJECT" ] ; then + MAILX_SUBJECT="$CUSTOM_SUBJECT" +else + MAILX_SUBJECT="$NUM_PACKAGES $DISTRIB_ID package update(s) for $SYSTEM" +fi + + # packages already reported won't be reported again if DIFF_ONLY option is marked LAST_RUN_FILE="/var/lib/apticron/last_run" if [ "$DIFF_ONLY" = "1" ] && [ -e "$LAST_RUN_FILE" ]; then @@ -279,7 +280,7 @@ EOF apticron EOF - ) 2>&1 | Mailx -s "$NUM_PACKAGES $MAILX_SUBJECT" $EMAIL + ) 2>&1 | Mailx -s "$MAILX_SUBJECT" $EMAIL fi