[arch-commits] Commit in incron/repos (6 files)
Christian Hesse
eworm at gemini.archlinux.org
Fri Apr 29 10:10:57 UTC 2022
Date: Friday, April 29, 2022 @ 10:10:56
Author: eworm
Revision: 1191780
archrelease: copy trunk to community-testing-x86_64
Added:
incron/repos/community-testing-x86_64/
incron/repos/community-testing-x86_64/0001-GetSafePath.patch
(from rev 1191779, incron/trunk/0001-GetSafePath.patch)
incron/repos/community-testing-x86_64/PKGBUILD
(from rev 1191779, incron/trunk/PKGBUILD)
incron/repos/community-testing-x86_64/incron.sysusers
(from rev 1191779, incron/trunk/incron.sysusers)
incron/repos/community-testing-x86_64/incron.tmpfiles
(from rev 1191779, incron/trunk/incron.tmpfiles)
incron/repos/community-testing-x86_64/incrond.service
(from rev 1191779, incron/trunk/incrond.service)
------------------------+
0001-GetSafePath.patch | 74 +++++++++++++++++++++++++++++++++++++++++++++++
PKGBUILD | 57 ++++++++++++++++++++++++++++++++++++
incron.sysusers | 1
incron.tmpfiles | 1
incrond.service | 10 ++++++
5 files changed, 143 insertions(+)
Copied: incron/repos/community-testing-x86_64/0001-GetSafePath.patch (from rev 1191779, incron/trunk/0001-GetSafePath.patch)
===================================================================
--- community-testing-x86_64/0001-GetSafePath.patch (rev 0)
+++ community-testing-x86_64/0001-GetSafePath.patch 2022-04-29 10:10:56 UTC (rev 1191780)
@@ -0,0 +1,74 @@
+From 47263e66497eaff3a83873080fa4b76bd5f6ad7d Mon Sep 17 00:00:00 2001
+From: Christian Hesse <mail at eworm.de>
+Date: Fri, 29 Apr 2022 00:00:09 +0200
+Subject: [PATCH 1/2] simplify code
+
+No need for a lot of if-else... Just add a backslash if required, then
+append the character.
+---
+ incrontab.cpp | 12 ++++--------
+ 1 file changed, 4 insertions(+), 8 deletions(-)
+
+diff --git a/incrontab.cpp b/incrontab.cpp
+index 5255163..613aad4 100644
+--- a/incrontab.cpp
++++ b/incrontab.cpp
+@@ -168,15 +168,11 @@ std::string IncronTabEntry::GetSafePath(const std::string& rPath)
+
+ SIZE len = rPath.length();
+ for (SIZE i = 0; i < len; i++) {
+- if (rPath[i] == ' ') {
+- stream << "\\ ";
+- }
+- else if (rPath[i] == '\\') {
+- stream << "\\\\";
+- }
+- else {
+- stream << rPath[i];
++ if (rPath[i] == ' ' ||
++ rPath[i] == '\\') {
++ stream << "\\";
+ }
++ stream << rPath[i];
+ }
+
+ return stream.str();
+--
+2.36.0
+
+
+From 35f4298d574151deadbdeb7ccc7785bf36504d3d Mon Sep 17 00:00:00 2001
+From: Christian Hesse <mail at eworm.de>
+Date: Fri, 29 Apr 2022 00:02:18 +0200
+Subject: [PATCH 2/2] also escape single & double quotes, parenthesis and angle
+ brackets
+
+This fixes...
+
+incrond[1714]: cannot exec process: Resource temporarily unavailable
+
+... with bad file name due to messing escaping.
+---
+ incrontab.cpp | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/incrontab.cpp b/incrontab.cpp
+index 613aad4..8b951da 100644
+--- a/incrontab.cpp
++++ b/incrontab.cpp
+@@ -169,6 +169,12 @@ std::string IncronTabEntry::GetSafePath(const std::string& rPath)
+ SIZE len = rPath.length();
+ for (SIZE i = 0; i < len; i++) {
+ if (rPath[i] == ' ' ||
++ rPath[i] == '\'' ||
++ rPath[i] == '"' ||
++ rPath[i] == '(' ||
++ rPath[i] == ')' ||
++ rPath[i] == '<' ||
++ rPath[i] == '>' ||
+ rPath[i] == '\\') {
+ stream << "\\";
+ }
+--
+2.36.0
+
Copied: incron/repos/community-testing-x86_64/PKGBUILD (from rev 1191779, incron/trunk/PKGBUILD)
===================================================================
--- community-testing-x86_64/PKGBUILD (rev 0)
+++ community-testing-x86_64/PKGBUILD 2022-04-29 10:10:56 UTC (rev 1191780)
@@ -0,0 +1,57 @@
+# Maintainer: Sergej Pupykin <pupykin.s+arch at gmail.com>
+# Contributor: Roberto Alsina <ralsina at kde.org>
+# Contributor: scj <scj(at)archlinux(dot)us>
+
+pkgname=incron
+pkgver=0.5.12
+pkgrel=5
+_commit=f45c2f5ac4baea99b48e99a713d1f4ec1854aa76
+pkgdesc="Like the regular cron but is driven by filesystem events instead of time periods"
+arch=('x86_64')
+url="https://github.com/ar-/incron"
+license=('GPL')
+depends=('gcc-libs' 'bash')
+makedepends=('git')
+options=('emptydirs')
+#source=("$pkgname-$pkgver.tar.gz::https://github.com/ar-/incron/archive/$pkgver.tar.gz"
+source=("git+https://github.com/ar-/incron.git#commit=${_commit}"
+ '0001-GetSafePath.patch'
+ "incron.sysusers"
+ "incron.tmpfiles"
+ "incrond.service")
+sha256sums=('SKIP'
+ '4a939f4af82c8d972478f2703aea6e524af8f7bf8bd1d8cf516ef78ff5e6713b'
+ 'e5da0a3af368c286fa2b180015c9efc5aef5018c271a16620b8c30bfe6f9ccc2'
+ '422c4a715da4037550d2f97de28f47f91d0b58983c188c6cf1d1233370e048a4'
+ '5ff72411c704dd38823892d7fd13992509c3d906bfe0b4a5cafbe382e4e01c24')
+
+prepare() {
+ cd "${srcdir}"/$pkgname
+ sed -i 's|$(DESTDIR)$(PREFIX)/sbin/|$(DESTDIR)$(PREFIX)/bin/|g' Makefile
+
+ # https://github.com/ar-/incron/pull/91
+ patch -Np1 < ../0001-GetSafePath.patch
+}
+
+build() {
+ cd "${srcdir}"/$pkgname
+ make CXXFLAGS+=" --std=c++14"
+}
+
+package() {
+ cd "${srcdir}"/$pkgname
+
+ install -d "${pkgdir}"/usr/share/man "${pkgdir}"/usr/{s,}bin
+
+ make PREFIX="${pkgdir}"/usr \
+ MANPATH="${pkgdir}"/usr/share/man \
+ USERDATADIR="${pkgdir}"/var/spool/incron \
+ INITDIR="${pkgdir}"/etc \
+ CFGDIR="${pkgdir}"/etc \
+ SYSDATADIR="${pkgdir}"/etc/incron.d install
+
+ install -Dm0644 "${srcdir}/incrond.service" "${pkgdir}/usr/lib/systemd/system/incrond.service"
+ install -Dm0644 "${srcdir}/incron.sysusers" "${pkgdir}/usr/lib/sysusers.d/incrond.conf"
+ install -Dm0644 "${srcdir}/incron.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/incrond.conf"
+ rm -r "$pkgdir"/{usr/sbin,var}
+}
Copied: incron/repos/community-testing-x86_64/incron.sysusers (from rev 1191779, incron/trunk/incron.sysusers)
===================================================================
--- community-testing-x86_64/incron.sysusers (rev 0)
+++ community-testing-x86_64/incron.sysusers 2022-04-29 10:10:56 UTC (rev 1191780)
@@ -0,0 +1 @@
+u incron - "Incron system" /var/spool/incron
Copied: incron/repos/community-testing-x86_64/incron.tmpfiles (from rev 1191779, incron/trunk/incron.tmpfiles)
===================================================================
--- community-testing-x86_64/incron.tmpfiles (rev 0)
+++ community-testing-x86_64/incron.tmpfiles 2022-04-29 10:10:56 UTC (rev 1191780)
@@ -0,0 +1 @@
+d /var/spool/incron 0755 incron incron - -
Copied: incron/repos/community-testing-x86_64/incrond.service (from rev 1191779, incron/trunk/incrond.service)
===================================================================
--- community-testing-x86_64/incrond.service (rev 0)
+++ community-testing-x86_64/incrond.service 2022-04-29 10:10:56 UTC (rev 1191780)
@@ -0,0 +1,10 @@
+[Unit]
+Description=Inotify System Scheduler
+
+[Service]
+Type=forking
+PIDFile=/run/incrond.pid
+ExecStart=/usr/bin/incrond
+
+[Install]
+WantedBy=multi-user.target
More information about the arch-commits
mailing list