Add tmpwatch 2.8.1, a utility for removing files based on when they

were last accessed.
This commit is contained in:
Mark Pulford 2002-02-20 13:03:34 +00:00
parent deea74b317
commit c3258f6d3e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=54975
7 changed files with 75 additions and 0 deletions

View file

@ -173,6 +173,7 @@
SUBDIR += tdir
SUBDIR += ticker.app
SUBDIR += timelimit
SUBDIR += tmpwatch
SUBDIR += tree
SUBDIR += truncate
SUBDIR += ttyload

View file

@ -0,0 +1,39 @@
# New ports collection makefile for: tmpwatch
# Date created: Feb 20, 2002
# Whom: Mark Pulford <mark@kyne.com.au>
#
# $FreeBSD$
#
PORTNAME= tmpwatch
PORTVERSION= 2.8.1
CATEGORIES= sysutils
MASTER_SITES= ftp://updates.redhat.com/7.2/en/os/SRPMS/
EXTRACT_SUFX= -1.src.rpm
MAINTAINER= markp@FreeBSD.org
BUILD_DEPENDS= rpm2cpio:${PORTSDIR}/archivers/rpm2cpio
LIB_DEPENDS= gnugetopt.1:${PORTSDIR}/devel/libgnugetopt
CPIO?= /usr/bin/cpio
CFLAGS+= -I${LOCALBASE}/include -DVERSION=\"${PORTVERSION}\"
LDFLAGS+= -L${LOCALBASE}/lib -lgnugetopt
MAN8= tmpwatch.8
do-extract:
${MKDIR} ${WRKDIR}
cd ${WRKDIR} && \
${LOCALBASE}/bin/rpm2cpio ${DISTDIR}/${DISTFILES} | \
${CPIO} -iud
cd ${WRKDIR} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} \
${WRKDIR}/${DISTNAME}.tar.gz ${EXTRACT_AFTER_ARGS}
do-build:
cd ${WRKSRC} && ${CC} ${CFLAGS} ${LDFLAGS} -o tmpwatch tmpwatch.c
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/tmpwatch ${PREFIX}/sbin
${INSTALL_MAN} ${WRKSRC}/tmpwatch.8 ${MAN8PREFIX}/man/man8
.include <bsd.port.mk>

View file

@ -0,0 +1 @@
MD5 (tmpwatch-2.8.1-1.src.rpm) = 27cb65abf996a15030045aff656f82a5

View file

@ -0,0 +1,26 @@
--- tmpwatch.c.orig Wed Feb 20 22:42:57 2002
+++ tmpwatch.c Wed Feb 20 23:14:48 2002
@@ -28,7 +28,6 @@
#include <utime.h>
#include <unistd.h>
#include <paths.h>
-#include <mntent.h>
#define LOG_REALDEBUG 1
#define LOG_DEBUG 2
@@ -324,6 +323,7 @@
if (*significant_time >= killTime)
continue;
+#if 0
/* check if it is an ext3 journal file */
if ((strcmp(ent->d_name, ".journal") == 0) &&
(sb.st_uid == 0)) {
@@ -352,6 +352,7 @@
continue;
}
}
+#endif
if ((flags & FLAG_ALLFILES) ||
S_ISREG(sb.st_mode) ||

View file

@ -0,0 +1 @@
A utility for removing files based on when they were last accessed

View file

@ -0,0 +1,6 @@
The tmpwatch utility recursively searches through specified
directories and removes files which have not been accessed in a
specified period of time. Tmpwatch is normally used to clean up
directories which are used for temporarily holding files (for example,
/tmp). Tmpwatch ignores symlinks, won't switch filesystems and only
removes empty directories and regular files.

View file

@ -0,0 +1 @@
sbin/tmpwatch