Preserve timestamp and context of /etc/sysconfig/spamassassin (#178580)

This commit is contained in:
Warren Togami 2006-05-11 15:18:01 +00:00
parent 3d590bfc82
commit e77373df4f

View File

@ -6,7 +6,7 @@
Summary: Spam filter for email which can be invoked from mail delivery agents.
Name: spamassassin
Version: 3.1.1
Release: 1.fc6
Release: 2.fc6
License: Apache License
Group: Applications/Internet
URL: http://spamassassin.apache.org/
@ -125,8 +125,13 @@ rm -rf $RPM_BUILD_ROOT
# -a and --auto-whitelist options were removed from 3.0.0
# prevent service startup failure
perl -p -i -e 's/(["\s]-\w+)a/$1/ ; s/(["\s]-)a(\w+)/$1$2/ ; s/(["\s])-a\b/$1/' /etc/sysconfig/spamassassin
perl -p -i -e 's/ --auto-whitelist//' /etc/sysconfig/spamassassin
TMPFILE=$(/bin/mktemp /etc/sysconfig/spamassassin.XXXXXX) || exit 1
cp /etc/sysconfig/spamassassin $TMPFILE
perl -p -i -e 's/(["\s]-\w+)a/$1/ ; s/(["\s]-)a(\w+)/$1$2/ ; s/(["\s])-a\b/$1/' $TMPFILE
perl -p -i -e 's/ --auto-whitelist//' $TMPFILE
# replace /etc/sysconfig/spamassassin only if it actually changed
cmp /etc/sysconfig/spamassassin $TMPFILE || cp $TMPFILE /etc/sysconfig/spamassassin
rm $TMPFILE
if [ -f /etc/spamassassin.cf ]; then
%{__mv} /etc/spamassassin.cf /etc/mail/spamassassin/migrated.cf
@ -149,6 +154,9 @@ fi
exit 0
%changelog
* Tue May 09 2006 Warren Togami <wtogami@redhat.com> - 3.0.5-4
- Preserve timestamp and context of /etc/sysconfig/spamassassin (#178580)
* Mon Mar 11 2006 Warren Togami <wtogami@redhat.com> - 3.1.1-1
- 3.1.1