projects
/
spamassassin_config.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* Tweak fashion url some more
[spamassassin_config.git]
/
update_spamassassin
diff --git
a/update_spamassassin
b/update_spamassassin
index
3b25d6a
..
1769913
100755
(executable)
--- a/
update_spamassassin
+++ b/
update_spamassassin
@@
-9,12
+9,12
@@
SVN=$(which svn)
TMPDIR=$(mktemp -d);
TMPDIR=$(mktemp -d);
-if [ "$HOSTNAME" =
=
"rietz" ]; then
+if [ "$HOSTNAME" = "rietz" ]; then
BASEDIR="/org/bugs.debian.org"
USERCONF="bugs/user_prefs";
BASEDIR="/org/bugs.debian.org"
USERCONF="bugs/user_prefs";
-elif [ "$HOSTNAME" =
= "murphy
" ]; then
+elif [ "$HOSTNAME" =
"liszt
" ]; then
BASEDIR="/var/list/.etc";
BASEDIR="/var/list/.etc";
- USERCONF="
bug
s/user_prefs";
+ USERCONF="
list
s/user_prefs";
else
echo "Unknown hostname '$HOSTNAME'";
exit 1;
else
echo "Unknown hostname '$HOSTNAME'";
exit 1;
@@
-28,11
+28,11
@@
ORIGREV=$(svn info $SACONFIG |awk '/^Revision:/{print $2}')
NEWREV=$(svn info $(svn info $SACONFIG|awk '/^URL:/{print $2}')|awk '/^Revision:/{print $2}')
# no changes, bug out.
NEWREV=$(svn info $(svn info $SACONFIG|awk '/^URL:/{print $2}')|awk '/^Revision:/{print $2}')
# no changes, bug out.
-if [
$ORIGREV -ge $NEWREV
]; then
+if [
"0$ORIGREV" -ge "0$NEWREV"
]; then
exit 0;
fi;
exit 0;
fi;
-if [ -e "$SACONFIG/.update_spamassassin" ] && kill -0 $(cat "$SACONFIG/.update_spamassassin"); then
+if [ -e "$SACONFIG/.update_spamassassin" ] && kill -0 $(cat "$SACONFIG/.update_spamassassin")
>/dev/null 2>&1
; then
echo "Another update_spamassassin appears to be running"
exit 1;
else
echo "Another update_spamassassin appears to be running"
exit 1;
else
@@
-50,6
+50,7
@@
function report_failure(){
# Hrm; a previous update failed; don't report again until the file
# is removed
if [ -e "$SACONFIG/failed_update" ]; then
# Hrm; a previous update failed; don't report again until the file
# is removed
if [ -e "$SACONFIG/failed_update" ]; then
+ rm -rf "$TMPDIR"
exit 0;
fi;
echo "$FAILUREMESSAGE" >> "$SACONFIG/failed_update"
exit 0;
fi;
echo "$FAILUREMESSAGE" >> "$SACONFIG/failed_update"
@@
-62,6
+63,7
@@
is fixed.
Please fix the problem and then remove
$SACONFIG/failed_update
EOF
Please fix the problem and then remove
$SACONFIG/failed_update
EOF
+ rm -rf "$TMPDIR"
exit 1;
}
exit 1;
}
@@
-69,26
+71,27
@@
cp -ar $SACONFIG $TMPDIR/.
cd $TMPDIR/spamassassin_config;
svn update -q --non-interactive;
if svn status |grep -q '^C'; then
cd $TMPDIR/spamassassin_config;
svn update -q --non-interactive;
if svn status |grep -q '^C'; then
- FAILUREMESSAGE=
"$(echo -e 'The following conflicts were found\n')"
+ FAILUREMESSAGE=
$'The following conflicts were found\n\n'
FAILUREMESSAGE="$FAILUREMESSAGE$(svn status|grep ^C)";
report_failure
fi;
cd - >/dev/null 2>&1
FAILUREMESSAGE="$FAILUREMESSAGE$(svn status|grep ^C)";
report_failure
fi;
cd - >/dev/null 2>&1
-if ! spamassassin -
C
$TMPDIR/spamassassin_config/$USERCONF --lint > $TMPDIR/sa_lint 2>&1; then
- FAILUREMESSAGE="$(echo -e 'spamassassin -
C
$TMPDIR/spamassassin_config/$USERCONF --lint\nfailed with\n'| cat - $TMPDIR/sa_lint)";
+if ! spamassassin -
p
$TMPDIR/spamassassin_config/$USERCONF --lint > $TMPDIR/sa_lint 2>&1; then
+ FAILUREMESSAGE="$(echo -e 'spamassassin -
p
$TMPDIR/spamassassin_config/$USERCONF --lint\nfailed with\n'| cat - $TMPDIR/sa_lint)";
report_failure
fi;
mv "$SACONFIG" "$BAKDIR/spamassassin_config_r$ORIGREV"
mv "$TMPDIR/spamassassin_config" "$SACONFIG"
report_failure
fi;
mv "$SACONFIG" "$BAKDIR/spamassassin_config_r$ORIGREV"
mv "$TMPDIR/spamassassin_config" "$SACONFIG"
-trap ERR
+trap
-
ERR
remove_pidfile
rm -rf "$TMPDIR"
if [ "$HOSTNAME" == "rietz" ]; then
touch /home/debbugs/.spamassassin/user_prefs
remove_pidfile
rm -rf "$TMPDIR"
if [ "$HOSTNAME" == "rietz" ]; then
touch /home/debbugs/.spamassassin/user_prefs
-elif [ "$HOSTNAME" == "
murphy
" ]; then
+elif [ "$HOSTNAME" == "
liszt
" ]; then
# do nothing
# do nothing
+ true;
else
echo "Unknown hostname '$HOSTNAME'";
exit 1;
else
echo "Unknown hostname '$HOSTNAME'";
exit 1;