Package Details: gitwatch-git r111.93a956e-1

Git Clone URL: (read-only, click to copy)
Package Base: gitwatch-git
Description: A bash script to watch a file or folder and commit changes to a git repo
Upstream URL:
Licenses: GPL3
Submitter: tjaart
Maintainer: tjaart
Last Packager: tjaart
Votes: 5
Popularity: 0.117857
First Submitted: 2015-05-30 02:53
Last Updated: 2019-02-07 19:30

Required by (0)

Sources (1)

Latest Comments

omn commented on 2020-06-19 23:33

Thanks for providing this pkgbuild. The systemd service file that is distributed in the git repository is currently not installed on the system by the build definition. Did you consider adding it?

The following should do it if added to the end of the package() definition.

mkdir -p $pkgdir/usr/lib/systemd/system/
cp gitwatch/gitwatch@.service $pkgdir/usr/lib/systemd/system/

Edit: actually the service file also needs to be patched because it points to /usr/local/bin/ while the package is installed to /usr/bin.

The following patch fixes the pkgbuild and adds the patch for the service file:

diff --git a/PKGBUILD b/PKGBUILD
index 7ae84a1..969fad8 100644
@@ -6,16 +6,24 @@ pkgdesc="A bash script to watch a file or folder and commit changes to a git rep
+        'fix-bin-path.patch')
 depends=('git' 'inotify-tools')
+         '4a859d8ef9587f1e67bed9c5f7259eda')

 # I tried to use the pkgver() function, but it returned -1
 pkgver=`cd gitwatch; printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"`

+prepare() {
+  cd ${srcdir}/gitwatch
+  patch --forward --input="${srcdir}/fix-bin-path.patch"
 package() {
   mkdir -p $pkgdir/usr/bin
+  mkdir -p $pkgdir/usr/lib/systemd/system/
   cp gitwatch/ $pkgdir/usr/bin/gitwatch
+  cp gitwatch/gitwatch@.service $pkgdir/usr/lib/systemd/system/
diff --git a/fix-bin-path.patch b/fix-bin-path.patch
new file mode 100644
index 0000000..855e00a
--- /dev/null
+++ b/fix-bin-path.patch
@@ -0,0 +1,13 @@
+diff --git gitwatch@.service gitwatch@.service
+index 339ae7c..6d22765 100644
+--- gitwatch@.service
++++ gitwatch@.service
+@@ -3,7 +3,7 @@ Description=Watch file or directory and git commit all changes. run with: system
+ [Service]
+ Environment="SCRIPT_ARGS=%I"
+-ExecStart=/usr/local/bin/gitwatch $SCRIPT_ARGS
++ExecStart=/usr/bin/gitwatch $SCRIPT_ARGS
+ ExecStop=/bin/true
+ [Install]