aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-09-02 15:18:40 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-09-02 15:18:40 +0000
commit6c890d6e6624ff6debcfb070d1d7fa88db0bc4ad (patch)
treef30455349f1f70b1f584b789d8ea34eaed680f6e /main
parent595935f999281e7de19fe7b1135adf0f2cdd290e (diff)
downloadaports-6c890d6e6624ff6debcfb070d1d7fa88db0bc4ad.tar.bz2
aports-6c890d6e6624ff6debcfb070d1d7fa88db0bc4ad.tar.xz
main/sysklogd: fix logrotation script
the syslogd_listfiles didnt handle the --auth option properly. We fix this and make it slightly more readable with -e ref #408
Diffstat (limited to 'main')
-rw-r--r--main/sysklogd/APKBUILD4
-rwxr-xr-xmain/sysklogd/sysklogd.daily21
2 files changed, 16 insertions, 9 deletions
diff --git a/main/sysklogd/APKBUILD b/main/sysklogd/APKBUILD
index 3e0fecdab1..43240eb47a 100644
--- a/main/sysklogd/APKBUILD
+++ b/main/sysklogd/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=sysklogd
pkgver=1.5
-pkgrel=6
+pkgrel=7
pkgdesc="System and kernel log daemons"
url="http://www.infodrom.org/projects/sysklogd/"
license="GPL BSD"
@@ -48,7 +48,7 @@ build ()
}
md5sums="e053094e8103165f98ddafe828f6ae4b sysklogd-1.5.tar.gz
6bc1d1c65076b104a8f78d0fb4f21db7 sysklogd.logrotate
-5ba669cf356796bdef20962a143eca72 sysklogd.daily
+d66d2ad2c4d0905b42963af9e86edacb sysklogd.daily
e4c9a51499f1eb8d45dfdfe0d52737a5 sysklogd.initd
e25d7b583b7e4bd8be503b89e1771e90 sysklogd.confd
3b7ba3aa6519f96f11165a7d5900a8b1 sysklogd-1.4.2-caen-owl-klogd-drop-root.diff
diff --git a/main/sysklogd/sysklogd.daily b/main/sysklogd/sysklogd.daily
index ccd63d61e4..6c5692ba3d 100755
--- a/main/sysklogd/sysklogd.daily
+++ b/main/sysklogd/sysklogd.daily
@@ -10,8 +10,8 @@ CONF="/etc/syslog.conf"
syslogd_listfiles() {
# List the target files from syslog.conf
- local skip="auth"
- [ "$1" = "--auth" ] && skip=" "
+ local skip=
+ [ "$1" = "--auth" ] && skip="!"
# the while loop joins lines that end in "\"
# the sed (in order)-
@@ -19,14 +19,21 @@ syslogd_listfiles() {
# collapses spaces/tabs to 1 space;
# deletes the "-" in front of the filename;
# deletes whitespace before ';'
- # deletes lines that have the "skip" facility
+ # deletes lines that have/dont have the "auth" facility
# deletes the facility (leaving just the filename)
# deletes lines that are not filenames with leading "/"
+ # print it
while read a ; do echo "$a"; done < $CONF |\
- sed -n "/^[ \t]*#/D; /^[ \t]*$/D; s/[ \t]\+/ /g; \
- s+ -/+ /+g; s/ *; */;/; /^.*\($skip\)[^ ]* /D; \
- s/^[^ ]* //; /^[^\\/]/D; P" |\
- sort | uniq
+ sed -n -e "s/\#.*//" \
+ -e "/^\s*$/D" \
+ -e "s/\s\+/ /g" \
+ -e "s: -/: /:g" \
+ -e "s/ *; */;/" \
+ -e "/^.*\(auth\)[^ ]* /${skip}D" \
+ -e "s:^.* /:/:" \
+ -e "/^[^\\/]/D" \
+ -e "P" \
+ | sort | uniq
}
# dumb little savelog - no error checking here