1 |
commit: 74a6a06fa5fecb0b403bfbce3f0318a19eb92b26 |
2 |
Author: Chema Alonso Josa <nimiux <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Aug 4 19:24:04 2017 +0000 |
4 |
Commit: José María Alonso <nimiux <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Aug 4 19:24:30 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=74a6a06f |
7 |
|
8 |
app-admin/logrotate: Moves state file to /var/lib/misc/ |
9 |
|
10 |
Gentoo-Bug: 357275 |
11 |
|
12 |
Package-Manager: Portage-2.3.6, Repoman-2.3.1 |
13 |
|
14 |
app-admin/logrotate/logrotate-3.12.3.ebuild | 18 ++++++++++++++++-- |
15 |
1 file changed, 16 insertions(+), 2 deletions(-) |
16 |
|
17 |
diff --git a/app-admin/logrotate/logrotate-3.12.3.ebuild b/app-admin/logrotate/logrotate-3.12.3.ebuild |
18 |
index 410660a032a..34807c80e88 100644 |
19 |
--- a/app-admin/logrotate/logrotate-3.12.3.ebuild |
20 |
+++ b/app-admin/logrotate/logrotate-3.12.3.ebuild |
21 |
@@ -27,6 +27,18 @@ RDEPEND="${CDEPEND} |
22 |
cron? ( virtual/cron ) |
23 |
bzip2? ( app-arch/bzip2 )" |
24 |
|
25 |
+STATEFILE="/var/lib/misc/logrotate.status" |
26 |
+OLDSTATEFILE="/var/lib/logrotate.status" |
27 |
+ |
28 |
+move_old_state_file() { |
29 |
+ elog "logrotate state file is now located at ${STATEFILE}" |
30 |
+ elog "See bug #357275" |
31 |
+ if [[ -e "${OLDSTATEFILE}" ]] ; then |
32 |
+ elog "Moving your current state file to new location: ${STATEFILE}" |
33 |
+ mv -n "${OLDSTATEFILE}" "${STATEFILE}" |
34 |
+ fi |
35 |
+} |
36 |
+ |
37 |
install_cron_file() { |
38 |
exeinto /etc/cron.daily |
39 |
newexe "${S}"/examples/logrotate.cron "${PN}" |
40 |
@@ -46,7 +58,7 @@ src_configure() { |
41 |
if use bzip2 ; then |
42 |
compressconf="--with-compress-command=/bin/bzip2 --with-uncompress-command=/bin/bunzip2 --with-compress-extension=.bz2" |
43 |
fi |
44 |
- econf $(use_with acl) $(use_with selinux) ${compressconf} |
45 |
+ econf $(use_with acl) $(use_with selinux) ${compressconf} --with-state-file-path="${STATEFILE}" |
46 |
} |
47 |
|
48 |
src_test() { |
49 |
@@ -73,12 +85,14 @@ pkg_postinst() { |
50 |
elog "The ${PN} binary is now installed under /usr/bin. Please" |
51 |
elog "update your links" |
52 |
elog |
53 |
+ move_old_state_file |
54 |
+ elog |
55 |
if [[ -z ${REPLACING_VERSIONS} ]] ; then |
56 |
elog "If you wish to have logrotate e-mail you updates, please" |
57 |
elog "emerge virtual/mailx and configure logrotate in" |
58 |
elog "/etc/logrotate.conf appropriately" |
59 |
elog |
60 |
elog "Additionally, /etc/logrotate.conf may need to be modified" |
61 |
- elog "for your particular needs. See man logrotate for details." |
62 |
+ elog "for your particular needs. See man logrotate for details." |
63 |
fi |
64 |
} |