]> git.pld-linux.org Git - packages/incron.git/commitdiff
patch to exclude backups from system dir
authorElan Ruusamäe <glen@delfi.ee>
Sun, 21 Oct 2012 16:11:14 +0000 (19:11 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Sun, 21 Oct 2012 16:11:14 +0000 (19:11 +0300)
ignore in system incron.d some files: *~, *.rpmnew, *.rpmsave, ...

however, seems systemdir processing itself is broken (before this patch
as well)

excludefiles.patch [new file with mode: 0644]
incron.spec

diff --git a/excludefiles.patch b/excludefiles.patch
new file mode 100644 (file)
index 0000000..c191daf
--- /dev/null
@@ -0,0 +1,31 @@
+--- incron-0.5.10/usertable.cpp        2012-04-07 01:19:27.000000000 +0300
++++ incron-0.5.10.glen/usertable.cpp   2012-10-21 19:06:15.091453806 +0300
+@@ -177,6 +177,28 @@
+         g_fFinish = true;
+       }
+       else if (!e.GetName().empty()) {
++        const char *fn = e.GetName().c_str();
++        size_t len = strlen(fn);
++
++        /*
++         * skip file names beginning with "." or "#" to skip hidden files
++         */
++        if (fn[0] == '.' || fn[0] == '#') {
++          continue;
++        }
++
++        /* ignore files ending with '~' */
++        if (fn[len - 1] == '~') {
++          continue;
++        }
++
++        /* ignore *.rpmnew, *.rpmsave and *.rpmorig files */
++        if ((len > 7 && strstr(&fn[len - 7], ".rpmnew")) ||
++          (len > 8 && strstr(&fn[len - 8], ".rpmsave")) ||
++          (len > 8 && strstr(&fn[len - 8], ".rpmorig"))) {
++          continue;
++        }
++
+         SUT_MAP::iterator it = g_ut.find(IncronCfg::BuildPath(m_pSys->GetPath(), e.GetName()));
+         if (it != g_ut.end()) {
+           UserTable* pUt = (*it).second;
index 75f7bae3a834a2d9352fb2d7a68ff2c909ce8e29..a534e94fadfa892dcdff218c412e0b5d91831f96 100644 (file)
@@ -1,10 +1,11 @@
 # TODO:
-# - ignore in system incron.d some files: *~, *.rpmnew, *.rpmsave, ...
-# - directories for incrontab, and many other things
+# - troubles procssing files from /etc/incron.d:
+#   touch /etc/incron.d/ble
+#   haarber incrond[4025]: cannot create watch for system table ble: (2) No such file or directory
 Summary:       incron :: inotify cron system
 Name:          incron
 Version:       0.5.10
-Release:       3
+Release:       4
 License:       GPL v2
 Group:         Daemons
 Source0:       http://inotify.aiken.cz/download/incron/%{name}-%{version}.tar.bz2
@@ -17,6 +18,7 @@ Patch0:               %{name}-DESTDIR.patch
 Patch1:                %{name}-gcc47.patch
 Patch2:                %{name}-man_bugs.patch
 Patch3:                configdir.patch
+Patch4:                excludefiles.patch
 URL:           http://incron.aiken.cz/
 BuildRequires: rpmbuild(macros) >= 1.644
 Requires:      systemd-units >= 38
@@ -45,6 +47,7 @@ rather than time periods.
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
 
 %build
 %{__make} \
This page took 0.05912 seconds and 4 git commands to generate.