From a719c1bc44e47b34f70090f7c299b4d97650234c Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Thu, 30 Apr 2020 11:58:01 +0200 Subject: logrotate: update to 3.16.0 Signed-off-by: Alexander Kanavin Signed-off-by: Richard Purdie --- .../logrotate/0001-Update-the-manual.patch | 39 +++++++++ .../logrotate/act-as-mv-when-rotate.patch | 25 +++--- .../disable-check-different-filesystems.patch | 14 ++- .../logrotate/logrotate/update-the-manual.patch | 38 --------- .../recipes-extended/logrotate/logrotate_3.15.1.bb | 99 ---------------------- .../recipes-extended/logrotate/logrotate_3.16.0.bb | 99 ++++++++++++++++++++++ 6 files changed, 156 insertions(+), 158 deletions(-) create mode 100644 meta/recipes-extended/logrotate/logrotate/0001-Update-the-manual.patch delete mode 100644 meta/recipes-extended/logrotate/logrotate/update-the-manual.patch delete mode 100644 meta/recipes-extended/logrotate/logrotate_3.15.1.bb create mode 100644 meta/recipes-extended/logrotate/logrotate_3.16.0.bb diff --git a/meta/recipes-extended/logrotate/logrotate/0001-Update-the-manual.patch b/meta/recipes-extended/logrotate/logrotate/0001-Update-the-manual.patch new file mode 100644 index 0000000000..50a3852078 --- /dev/null +++ b/meta/recipes-extended/logrotate/logrotate/0001-Update-the-manual.patch @@ -0,0 +1,39 @@ +From 3e2cfa88b6538bb0fee3d9a6e99622055d05ac4a Mon Sep 17 00:00:00 2001 +From: Robert Yang +Date: Tue, 17 Feb 2015 21:14:37 -0800 +Subject: [PATCH] Update the manual + +Update the manual for rotating on different filesystems. + +Upstream-Status: Pending + +Signed-off-by: Robert Yang + +--- + logrotate.8.in | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +diff --git a/logrotate.8.in b/logrotate.8.in +index 98fea91..70b4c44 100644 +--- a/logrotate.8.in ++++ b/logrotate.8.in +@@ -202,12 +202,10 @@ at all (use with caution, may waste performance and disk space). Default is 0. + + .TP + \fBolddir \fIdirectory\fR +-Logs are moved into \fIdirectory\fR for rotation. The \fIdirectory\fR must be +-on the same physical device as the log file being rotated, unless \fBcopy\fR, +-\fBcopytruncate\fR or \fBrenamecopy\fR option is used. The \fIdirectory\fR +-is assumed to be relative to the directory holding the log file +-unless an absolute path name is specified. When this option is used all +-old versions of the log end up in \fIdirectory\fR. This option may be ++Logs are moved into \fIdirectory\fR for rotation. The \fIdirectory\fR ++is assumed to be relative to the directory holding the log file unless ++an absolute path name is specified. When this option is used all old ++versions of the log end up in \fIdirectory\fR. This option may be + overridden by the \fBnoolddir\fR option. + + .TP +-- +2.24.0 + diff --git a/meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch b/meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch index 79805b5148..acef5ccbe9 100644 --- a/meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch +++ b/meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch @@ -1,4 +1,4 @@ -From c637948ebab5aff5641700c5cf613321ca0a6e6b Mon Sep 17 00:00:00 2001 +From ef1ea905831c5bcd63e04149571c10d75ff8f028 Mon Sep 17 00:00:00 2001 From: Robert Yang Date: Tue, 17 Feb 2015 21:08:07 -0800 Subject: [PATCH] Act as the "mv" command when rotate log @@ -9,15 +9,16 @@ read and write. Upstream-Status: Pending Signed-off-by: Robert Yang + --- logrotate.c | 71 ++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 59 insertions(+), 12 deletions(-) diff --git a/logrotate.c b/logrotate.c -index 54dac90..bf3ec23 100644 +index 25902bc..afa1a90 100644 --- a/logrotate.c +++ b/logrotate.c -@@ -1360,6 +1360,53 @@ static int findNeedRotating(struct logInfo *log, int logNum, int force) +@@ -1434,6 +1434,53 @@ static int findNeedRotating(struct logInfo *log, int logNum, int force) return 0; } @@ -71,7 +72,7 @@ index 54dac90..bf3ec23 100644 /* find the rotated file with the highest index */ static int findLastRotated(const struct logNames *rotNames, const char *fileext, const char *compext) -@@ -1800,15 +1847,15 @@ static int prerotateSingleLog(struct logInfo *log, int logNum, +@@ -1911,15 +1958,15 @@ static int prerotateSingleLog(struct logInfo *log, int logNum, } message(MESS_DEBUG, @@ -90,7 +91,7 @@ index 54dac90..bf3ec23 100644 oldName, newName, strerror(errno)); hasErrors = 1; } -@@ -1891,21 +1938,21 @@ static int rotateSingleLog(struct logInfo *log, int logNum, +@@ -2002,10 +2049,10 @@ static int rotateSingleLog(struct logInfo *log, int logNum, return 1; } @@ -104,7 +105,8 @@ index 54dac90..bf3ec23 100644 log->files[logNum], tmpFilename, strerror(errno)); hasErrors = 1; - } +@@ -2014,11 +2061,11 @@ static int rotateSingleLog(struct logInfo *log, int logNum, + free(tmpFilename); } else { - message(MESS_DEBUG, "renaming %s to %s\n", log->files[logNum], @@ -118,7 +120,7 @@ index 54dac90..bf3ec23 100644 log->files[logNum], rotNames->finalName, strerror(errno)); hasErrors = 1; -@@ -2297,7 +2344,7 @@ static int rotateLogSet(struct logInfo *log, int force) +@@ -2424,7 +2471,7 @@ static int rotateLogSet(struct logInfo *log, int force) return hasErrors; } @@ -127,7 +129,7 @@ index 54dac90..bf3ec23 100644 { struct logState *p; FILE *f; -@@ -2460,7 +2507,7 @@ static int writeState(const char *stateFilename) +@@ -2629,7 +2676,7 @@ static int writeState(const char *stateFilename) fclose(f); if (error == 0) { @@ -135,8 +137,8 @@ index 54dac90..bf3ec23 100644 + if (mvFile(tmpFilename, stateFilename, log, prev_acl)) { unlink(tmpFilename); error = 1; - message(MESS_ERROR, "error renaming temp state file %s\n", -@@ -2805,7 +2852,7 @@ int main(int argc, const char **argv) + message(MESS_ERROR, "error renaming temp state file %s to %s\n", +@@ -2987,7 +3034,7 @@ int main(int argc, const char **argv) rc |= rotateLogSet(log, force); if (!debug) @@ -145,6 +147,3 @@ index 54dac90..bf3ec23 100644 return (rc != 0); } --- -2.18.1 - diff --git a/meta/recipes-extended/logrotate/logrotate/disable-check-different-filesystems.patch b/meta/recipes-extended/logrotate/logrotate/disable-check-different-filesystems.patch index 96ff098a3f..9ba531f815 100644 --- a/meta/recipes-extended/logrotate/logrotate/disable-check-different-filesystems.patch +++ b/meta/recipes-extended/logrotate/logrotate/disable-check-different-filesystems.patch @@ -1,4 +1,4 @@ -From e47796c8e8270a3d14f0b06af8a9e916c2225514 Mon Sep 17 00:00:00 2001 +From a3fdf3dbdd6ecc0f2550a765dcb9bb274bce8ea8 Mon Sep 17 00:00:00 2001 From: Robert Yang Date: Tue, 8 Jan 2019 06:27:06 +0000 Subject: [PATCH] Disable the check for different filesystems @@ -9,18 +9,19 @@ disable the check for different filesystems. Upstream-Status: Pending Signed-off-by: Robert Yang + --- config.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/config.c b/config.c -index 633b843..99a4a3b 100644 +index f027c7e..026136c 100644 --- a/config.c +++ b/config.c -@@ -1765,15 +1765,6 @@ duperror: - goto error; - } +@@ -1873,15 +1873,6 @@ duperror: } + + free(ld); - - if (sb.st_dev != sb2.st_dev - && !(newlog->flags & (LOG_FLAG_COPYTRUNCATE | LOG_FLAG_COPY | LOG_FLAG_TMPFILENAME))) { @@ -33,6 +34,3 @@ index 633b843..99a4a3b 100644 } } --- -2.18.1 - diff --git a/meta/recipes-extended/logrotate/logrotate/update-the-manual.patch b/meta/recipes-extended/logrotate/logrotate/update-the-manual.patch deleted file mode 100644 index 725567e0c9..0000000000 --- a/meta/recipes-extended/logrotate/logrotate/update-the-manual.patch +++ /dev/null @@ -1,38 +0,0 @@ -From bf22e8805df69344f6f20cea390e829a22fa741b Mon Sep 17 00:00:00 2001 -From: Robert Yang -Date: Tue, 17 Feb 2015 21:14:37 -0800 -Subject: [PATCH] Update the manual - -Update the manual for rotating on different filesystems. - -Upstream-Status: Pending - -Signed-off-by: Robert Yang ---- - logrotate.8.in | 10 ++++------ - 1 file changed, 4 insertions(+), 6 deletions(-) - -diff --git a/logrotate.8.in b/logrotate.8.in -index 951e406..581bf48 100644 ---- a/logrotate.8.in -+++ b/logrotate.8.in -@@ -445,12 +445,10 @@ Do not rotate the log if it is empty (this overrides the \fBifempty\fR option). - - .TP - \fBolddir \fIdirectory\fR --Logs are moved into \fIdirectory\fR for rotation. The \fIdirectory\fR must be --on the same physical device as the log file being rotated, unless \fBcopy\fR, --\fBcopytruncate\fR or \fBrenamecopy\fR option is used. The \fIdirectory\fR --is assumed to be relative to the directory holding the log file --unless an absolute path name is specified. When this option is used all --old versions of the log end up in \fIdirectory\fR. This option may be -+Logs are moved into \fIdirectory\fR for rotation. The \fIdirectory\fR -+is assumed to be relative to the directory holding the log file unless -+an absolute path name is specified. When this option is used all old -+versions of the log end up in \fIdirectory\fR. This option may be - overridden by the \fBnoolddir\fR option. - - .TP --- -1.8.3.1 - diff --git a/meta/recipes-extended/logrotate/logrotate_3.15.1.bb b/meta/recipes-extended/logrotate/logrotate_3.15.1.bb deleted file mode 100644 index 7c7d51b39e..0000000000 --- a/meta/recipes-extended/logrotate/logrotate_3.15.1.bb +++ /dev/null @@ -1,99 +0,0 @@ -SUMMARY = "Rotates, compresses, removes and mails system log files" -SECTION = "console/utils" -HOMEPAGE = "https://github.com/logrotate/logrotate/issues" -LICENSE = "GPLv2" - -# TODO: Document coreutils dependency. Why not RDEPENDS? Why not busybox? - -DEPENDS="coreutils popt" - -LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" - -# When updating logrotate to latest upstream, SRC_URI should point to -# a proper release tarball from https://github.com/logrotate/logrotate/releases -# and we have to take the snapshot for now because there is no such -# tarball available for 3.9.1. - -S = "${WORKDIR}/${BPN}-${PV}" - -UPSTREAM_CHECK_URI = "https://github.com/${BPN}/${BPN}/releases" -UPSTREAM_CHECK_REGEX = "logrotate-(?P\d+(\.\d+)+).tar" - -SRC_URI = "https://github.com/${BPN}/${BPN}/releases/download/${PV}/${BP}.tar.xz \ - file://act-as-mv-when-rotate.patch \ - file://update-the-manual.patch \ - file://disable-check-different-filesystems.patch \ - " - -SRC_URI[md5sum] = "afe109afea749c306ff489203fde6beb" -SRC_URI[sha256sum] = "491fec9e89f1372f02a0ab66579aa2e9d63cac5178dfa672c204c88e693a908b" - -PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'acl selinux', d)}" - -PACKAGECONFIG[acl] = ",,acl" -PACKAGECONFIG[selinux] = ",,libselinux" - -CONFFILES_${PN} += "${localstatedir}/lib/logrotate.status \ - ${sysconfdir}/logrotate.conf \ - ${sysconfdir}/logrotate.d/btmp \ - ${sysconfdir}/logrotate.d/wtmp" - -# If RPM_OPT_FLAGS is unset, it adds -g itself rather than obeying our -# optimization variables, so use it rather than EXTRA_CFLAGS. -EXTRA_OEMAKE = "\ - LFS= \ - OS_NAME='${OS_NAME}' \ - 'CC=${CC}' \ - 'RPM_OPT_FLAGS=${CFLAGS}' \ - 'EXTRA_LDFLAGS=${LDFLAGS}' \ - ${@bb.utils.contains('PACKAGECONFIG', 'acl', 'WITH_ACL=yes', '', d)} \ - ${@bb.utils.contains('PACKAGECONFIG', 'selinux', 'WITH_SELINUX=yes', '', d)} \ -" - -# OS_NAME in the makefile defaults to `uname -s`. The behavior for -# freebsd/netbsd is questionable, so leave it as Linux, which only sets -# INSTALL=install and BASEDIR=/usr. -OS_NAME = "Linux" - -inherit autotools systemd - -SYSTEMD_SERVICE_${PN} = "\ - ${BPN}.service \ - ${BPN}.timer \ -" - -LOGROTATE_OPTIONS ?= "" - -LOGROTATE_SYSTEMD_TIMER_BASIS ?= "daily" -LOGROTATE_SYSTEMD_TIMER_ACCURACY ?= "12h" -LOGROTATE_SYSTEMD_TIMER_PERSISTENT ?= "true" - -do_install(){ - oe_runmake install DESTDIR=${D} PREFIX=${D} MANDIR=${mandir} - mkdir -p ${D}${sysconfdir}/logrotate.d - mkdir -p ${D}${localstatedir}/lib - install -p -m 644 ${S}/examples/logrotate.conf ${D}${sysconfdir}/logrotate.conf - install -p -m 644 ${S}/examples/btmp ${D}${sysconfdir}/logrotate.d/btmp - install -p -m 644 ${S}/examples/wtmp ${D}${sysconfdir}/logrotate.d/wtmp - touch ${D}${localstatedir}/lib/logrotate.status - - if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then - install -d ${D}${systemd_system_unitdir} - install -m 0644 ${S}/examples/logrotate.service ${D}${systemd_system_unitdir}/logrotate.service - install -m 0644 ${S}/examples/logrotate.timer ${D}${systemd_system_unitdir}/logrotate.timer - [ -z "${LOGROTATE_OPTIONS}" ] || - sed -ri \ - -e 's|(ExecStart=.*/logrotate.*)$|\1 ${LOGROTATE_OPTIONS}|g' \ - ${D}${systemd_system_unitdir}/logrotate.service - sed -ri \ - -e 's|(OnCalendar=).*$|\1${LOGROTATE_SYSTEMD_TIMER_BASIS}|g' \ - -e 's|(AccuracySec=).*$|\1${LOGROTATE_SYSTEMD_TIMER_ACCURACY}|g' \ - -e 's|(Persistent=).*$|\1${LOGROTATE_SYSTEMD_TIMER_PERSISTENT}|g' \ - ${D}${systemd_system_unitdir}/logrotate.timer - fi - - if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then - mkdir -p ${D}${sysconfdir}/cron.daily - install -p -m 0755 ${S}/examples/logrotate.cron ${D}${sysconfdir}/cron.daily/logrotate - fi -} diff --git a/meta/recipes-extended/logrotate/logrotate_3.16.0.bb b/meta/recipes-extended/logrotate/logrotate_3.16.0.bb new file mode 100644 index 0000000000..2b6ee0a19a --- /dev/null +++ b/meta/recipes-extended/logrotate/logrotate_3.16.0.bb @@ -0,0 +1,99 @@ +SUMMARY = "Rotates, compresses, removes and mails system log files" +SECTION = "console/utils" +HOMEPAGE = "https://github.com/logrotate/logrotate/issues" +LICENSE = "GPLv2" + +# TODO: Document coreutils dependency. Why not RDEPENDS? Why not busybox? + +DEPENDS="coreutils popt" + +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" + +# When updating logrotate to latest upstream, SRC_URI should point to +# a proper release tarball from https://github.com/logrotate/logrotate/releases +# and we have to take the snapshot for now because there is no such +# tarball available for 3.9.1. + +S = "${WORKDIR}/${BPN}-${PV}" + +UPSTREAM_CHECK_URI = "https://github.com/${BPN}/${BPN}/releases" +UPSTREAM_CHECK_REGEX = "logrotate-(?P\d+(\.\d+)+).tar" + +SRC_URI = "https://github.com/${BPN}/${BPN}/releases/download/${PV}/${BP}.tar.xz \ + file://act-as-mv-when-rotate.patch \ + file://0001-Update-the-manual.patch \ + file://disable-check-different-filesystems.patch \ + " + +SRC_URI[md5sum] = "faf729e0e24bfaafaa677bc6deb46ed8" +SRC_URI[sha256sum] = "442f6fdf61c349eeae5f76799878b88fe45a11c8863a38b618bac6988f4a7ce5" + +PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'acl selinux', d)}" + +PACKAGECONFIG[acl] = ",,acl" +PACKAGECONFIG[selinux] = ",,libselinux" + +CONFFILES_${PN} += "${localstatedir}/lib/logrotate.status \ + ${sysconfdir}/logrotate.conf \ + ${sysconfdir}/logrotate.d/btmp \ + ${sysconfdir}/logrotate.d/wtmp" + +# If RPM_OPT_FLAGS is unset, it adds -g itself rather than obeying our +# optimization variables, so use it rather than EXTRA_CFLAGS. +EXTRA_OEMAKE = "\ + LFS= \ + OS_NAME='${OS_NAME}' \ + 'CC=${CC}' \ + 'RPM_OPT_FLAGS=${CFLAGS}' \ + 'EXTRA_LDFLAGS=${LDFLAGS}' \ + ${@bb.utils.contains('PACKAGECONFIG', 'acl', 'WITH_ACL=yes', '', d)} \ + ${@bb.utils.contains('PACKAGECONFIG', 'selinux', 'WITH_SELINUX=yes', '', d)} \ +" + +# OS_NAME in the makefile defaults to `uname -s`. The behavior for +# freebsd/netbsd is questionable, so leave it as Linux, which only sets +# INSTALL=install and BASEDIR=/usr. +OS_NAME = "Linux" + +inherit autotools systemd + +SYSTEMD_SERVICE_${PN} = "\ + ${BPN}.service \ + ${BPN}.timer \ +" + +LOGROTATE_OPTIONS ?= "" + +LOGROTATE_SYSTEMD_TIMER_BASIS ?= "daily" +LOGROTATE_SYSTEMD_TIMER_ACCURACY ?= "12h" +LOGROTATE_SYSTEMD_TIMER_PERSISTENT ?= "true" + +do_install(){ + oe_runmake install DESTDIR=${D} PREFIX=${D} MANDIR=${mandir} + mkdir -p ${D}${sysconfdir}/logrotate.d + mkdir -p ${D}${localstatedir}/lib + install -p -m 644 ${S}/examples/logrotate.conf ${D}${sysconfdir}/logrotate.conf + install -p -m 644 ${S}/examples/btmp ${D}${sysconfdir}/logrotate.d/btmp + install -p -m 644 ${S}/examples/wtmp ${D}${sysconfdir}/logrotate.d/wtmp + touch ${D}${localstatedir}/lib/logrotate.status + + if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then + install -d ${D}${systemd_system_unitdir} + install -m 0644 ${S}/examples/logrotate.service ${D}${systemd_system_unitdir}/logrotate.service + install -m 0644 ${S}/examples/logrotate.timer ${D}${systemd_system_unitdir}/logrotate.timer + [ -z "${LOGROTATE_OPTIONS}" ] || + sed -ri \ + -e 's|(ExecStart=.*/logrotate.*)$|\1 ${LOGROTATE_OPTIONS}|g' \ + ${D}${systemd_system_unitdir}/logrotate.service + sed -ri \ + -e 's|(OnCalendar=).*$|\1${LOGROTATE_SYSTEMD_TIMER_BASIS}|g' \ + -e 's|(AccuracySec=).*$|\1${LOGROTATE_SYSTEMD_TIMER_ACCURACY}|g' \ + -e 's|(Persistent=).*$|\1${LOGROTATE_SYSTEMD_TIMER_PERSISTENT}|g' \ + ${D}${systemd_system_unitdir}/logrotate.timer + fi + + if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then + mkdir -p ${D}${sysconfdir}/cron.daily + install -p -m 0755 ${S}/examples/logrotate.cron ${D}${sysconfdir}/cron.daily/logrotate + fi +} -- cgit 1.2.3-korg