[csw-devel] SF.net SVN: gar:[6693] csw/mgar/pkg
skayser at users.sourceforge.net
skayser at users.sourceforge.net
Sun Oct 4 00:09:49 CEST 2009
Revision: 6693
http://gar.svn.sourceforge.net/gar/?rev=6693&view=rev
Author: skayser
Date: 2009-10-03 22:09:49 +0000 (Sat, 03 Oct 2009)
Log Message:
-----------
tmpreaper: initial commit
Added Paths:
-----------
csw/mgar/pkg/tmpreaper/
csw/mgar/pkg/tmpreaper/branches/
csw/mgar/pkg/tmpreaper/tags/
csw/mgar/pkg/tmpreaper/trunk/
csw/mgar/pkg/tmpreaper/trunk/Makefile
csw/mgar/pkg/tmpreaper/trunk/checksums
csw/mgar/pkg/tmpreaper/trunk/files/
csw/mgar/pkg/tmpreaper/trunk/files/0001-fix-getcwd-comparison.patch
csw/mgar/pkg/tmpreaper/trunk/files/0002-provide-statement-expression-workaround.patch
csw/mgar/pkg/tmpreaper/trunk/files/README.CSW
csw/mgar/pkg/tmpreaper/trunk/files/changelog.CSW
Property changes on: csw/mgar/pkg/tmpreaper/trunk
___________________________________________________________________
Added: svn:ignore
+ cookies
download
work
Added: svn:externals
+ gar https://gar.svn.sourceforge.net/svnroot/gar/csw/mgar/gar/v2
Added: csw/mgar/pkg/tmpreaper/trunk/Makefile
===================================================================
--- csw/mgar/pkg/tmpreaper/trunk/Makefile (rev 0)
+++ csw/mgar/pkg/tmpreaper/trunk/Makefile 2009-10-03 22:09:49 UTC (rev 6693)
@@ -0,0 +1,42 @@
+GARNAME = tmpreaper
+GARVERSION = 1.6.13
+CATEGORIES = apps
+
+DESCRIPTION = Cleans up files in directories based on their age
+define BLURB
+ This package provides a program that can be used to clean out
+ temporary-file directories. It recursively searches the directory,
+ refusing to chdir() across symlinks, and removes files that haven't been
+ accessed in a user-specified amount of time. You can specify a set of
+ files to protect from deletion with a shell pattern. It will not remove
+ files owned by the process EUID that have the `w' bit clear, unless you
+ ask it to, much like `rm -f'. `tmpreaper' will not remove symlinks,
+ sockets, fifos, or special files unless given a command line option
+ enabling it to.
+endef
+
+SPKG_SOURCEURL = http://packages.debian.org/sid/tmpreaper
+MASTER_SITES = http://ftp.de.debian.org/debian/pool/main/t/tmpreaper/
+DISTFILES = $(GARNAME)_$(GARVERSION).tar.gz
+UFILES_REGEX = $(GARNAME)_(\d+(?:\.\d+)*).tar.gz
+
+TEST_SCRIPTS =
+
+# getcwd() returns char*, fix return value comparison
+PATCHFILES = 0001-fix-getcwd-comparison.patch
+# Studio 11 does not know about statement expressions
+PATCHFILES += 0002-provide-statement-expression-workaround.patch
+
+# Force zone-friendly dirs, while they have not yet become standard in GAR
+sysconfdir=/etc/opt/csw
+localstatedir=/var/opt/csw
+
+CONFIGURE_ARGS = $(DIRPATHS)
+
+include gar/category.mk
+
+post-install-modulated: DOCDEST=$(DESTDIR)$(docdir)/$(CATALOGNAME)
+post-install-modulated:
+ ginstall -d $(DOCDEST)
+ cp $(FILEDIR)/changelog.CSW $(FILEDIR)/README.CSW $(DOCDEST)
+ @$(MAKECOOKIE)
Added: csw/mgar/pkg/tmpreaper/trunk/checksums
===================================================================
--- csw/mgar/pkg/tmpreaper/trunk/checksums (rev 0)
+++ csw/mgar/pkg/tmpreaper/trunk/checksums 2009-10-03 22:09:49 UTC (rev 6693)
@@ -0,0 +1,3 @@
+2ef1fd86b2350b7e8d95c587aa752eba download/0001-fix-getcwd-comparison.patch
+64c57bd076a6bace6fa108ff750c7d53 download/0002-provide-statement-expression-workaround.patch
+f5799a7f142f9fa49586ae3da2bba222 download/tmpreaper_1.6.13.tar.gz
Added: csw/mgar/pkg/tmpreaper/trunk/files/0001-fix-getcwd-comparison.patch
===================================================================
--- csw/mgar/pkg/tmpreaper/trunk/files/0001-fix-getcwd-comparison.patch (rev 0)
+++ csw/mgar/pkg/tmpreaper/trunk/files/0001-fix-getcwd-comparison.patch 2009-10-03 22:09:49 UTC (rev 6693)
@@ -0,0 +1,13 @@
+diff --git a/tmpreaper.c b/tmpreaper.c
+index a6d172c..111c647 100644
+--- a/tmpreaper.c
++++ b/tmpreaper.c
+@@ -356,7 +356,7 @@ cleanupDirectory (const char * dirname ,
+ int l;
+ /* the admin will want to know where the problem lies */
+ #ifdef NO_get_current_dir_name
+- if (getcwd(path, PATH_MAX) < 0)
++ if (getcwd(path, PATH_MAX) == NULL)
+ /* too long even for PATH_MAX, show something anyway */
+ #else
+ if ((path = get_current_dir_name()) < 0)
Added: csw/mgar/pkg/tmpreaper/trunk/files/0002-provide-statement-expression-workaround.patch
===================================================================
--- csw/mgar/pkg/tmpreaper/trunk/files/0002-provide-statement-expression-workaround.patch (rev 0)
+++ csw/mgar/pkg/tmpreaper/trunk/files/0002-provide-statement-expression-workaround.patch 2009-10-03 22:09:49 UTC (rev 6693)
@@ -0,0 +1,26 @@
+diff --git a/tmpreaper.c b/tmpreaper.c
+index 111c647..0a7005f 100644
+--- a/tmpreaper.c
++++ b/tmpreaper.c
+@@ -688,12 +688,21 @@ main (int argc,
+ * Utilize GNU C dynamic array allocation and statement expressions to
+ * allocate an array to hold the --protect argument strings.
+ */
++#ifdef __GNUC__
+ char *protect_argv[ ({ int i;
+ int count = 0;
+ for (i = 1; i < argc; i++)
+ if (! strncmp (argv[i], "--protect", 9))
+ count++;
+ ++count; }) ];
++#else
++ int pi;
++ int pcount = 0;
++ for (pi = 1; pi < argc; pi++)
++ if (! strncmp (argv[pi], "--protect", 9)) pcount++;
++ ++pcount;
++ char *protect_argv[pcount];
++#endif
+
+ char **p = protect_argv;
+
Added: csw/mgar/pkg/tmpreaper/trunk/files/README.CSW
===================================================================
--- csw/mgar/pkg/tmpreaper/trunk/files/README.CSW (rev 0)
+++ csw/mgar/pkg/tmpreaper/trunk/files/README.CSW 2009-10-03 22:09:49 UTC (rev 6693)
@@ -0,0 +1,12 @@
+To get started, create a crontab entry such as the following:
+
+0 4 * * * /opt/csw/bin/tmpreaper --mtime-dir --symlinks 7d --protect '/tmp/.X*-{lock,unix,unix/*}' /tmp
+
+ This will run every day at 04:00 AM, cleaning the /tmp directory of files
+ not accessed withing 7 days, including symlinks. Empty directories not
+ modified in the last 7 days will also be removed. The --protect option
+ causes tmpreaper to skip files with matching names. You can supply more
+ than one --protect option, and you can supply more than one directory
+ to be cleaned.
+ Feel free to adjust as you wish; see the manpage for options. You can use
+ the --test option to only show what would be done.
Added: csw/mgar/pkg/tmpreaper/trunk/files/changelog.CSW
===================================================================
--- csw/mgar/pkg/tmpreaper/trunk/files/changelog.CSW (rev 0)
+++ csw/mgar/pkg/tmpreaper/trunk/files/changelog.CSW 2009-10-03 22:09:49 UTC (rev 6693)
@@ -0,0 +1,6 @@
+tmpreaper (1.6.13,REV=2009.10.03)
+
+ * Adopted and updated to 1.6.13
+ * Added README.CSW with crontab example.
+
+ -- Sebastian Kayser <skayser at opencsw.org> Sat, 3 Oct 2009 23:49:33 +0200
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the devel
mailing list