diff options
author | Sam James <sam@gentoo.org> | 2021-08-20 03:16:53 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2021-08-20 03:18:09 +0100 |
commit | ce830c8d6fc7869fd559d36c71cf3b8af3b4fd80 (patch) | |
tree | 548f22fbeb58b047e71c2b4180092186c6481740 /app-admin/tmpwatch/tmpwatch-2.11-r3.ebuild | |
parent | app-admin/tmpwatch: fix metadata indentation (diff) | |
download | gentoo-ce830c8d6fc7869fd559d36c71cf3b8af3b4fd80.tar.gz gentoo-ce830c8d6fc7869fd559d36c71cf3b8af3b4fd80.tar.bz2 gentoo-ce830c8d6fc7869fd559d36c71cf3b8af3b4fd80.zip |
app-admin/tmpwatch: address bug 524698 (bashism)
Remove the use of the [[ keyword in favour of the POSIX test command
(SC3010).
Don't hard-code pathnames to external programs and define silly
variables such as TMPWATCH. Instead, define a sane PATH at the beginning
of the script.
Don't force the user to reason with whether certain variables need to be
set or not. Instead, call out to portageq in the samples. Further, check
the exit status of portageq, rather than blindly assume that it always
succeeds. As a result, there are no more hard-coded paths, other than
/tmp.
Use pgrep in a less sloppy way.
Query PORT_LOGDIR if the query for PORTAGE_LOGDIR fails.
Closes: https://bugs.gentoo.org/524698
Signed-off-by: Kerin Millar <kfm@plushkava.net>
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'app-admin/tmpwatch/tmpwatch-2.11-r3.ebuild')
-rw-r--r-- | app-admin/tmpwatch/tmpwatch-2.11-r3.ebuild | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/app-admin/tmpwatch/tmpwatch-2.11-r3.ebuild b/app-admin/tmpwatch/tmpwatch-2.11-r3.ebuild new file mode 100644 index 000000000000..cdc308efa9f9 --- /dev/null +++ b/app-admin/tmpwatch/tmpwatch-2.11-r3.ebuild @@ -0,0 +1,42 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit toolchain-funcs + +DESCRIPTION="Files which haven't been accessed are removed from specified directories" +HOMEPAGE="https://pagure.io/tmpwatch" +SRC_URI="https://releases.pagure.org/${PN}/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha amd64 ~ia64 ppc ppc64 sparc x86" +IUSE="selinux" + +# psmisc for fuser +DEPEND=" + !kernel_Darwin? ( sys-process/psmisc ) +" +RDEPEND=" + ${DEPEND} + selinux? ( sec-policy/selinux-tmpreaper ) +" + +PATCHES=( + "${FILESDIR}/${P}-boottime.patch" +) + +src_compile() { + emake AR="$(tc-getAR)" +} + +src_install() { + default + + dosbin tmpwatch + doman tmpwatch.8 + + exeinto /etc/cron.daily + newexe "${FILESDIR}/${PN}.cron" "${PN}" +} |