From 7a32ec04168c143ecd4531607392558dff5ddc56 Mon Sep 17 00:00:00 2001 From: Eric Lay Date: Fri, 12 Jun 2020 15:46:47 -0500 Subject: [PATCH] replaced hook with timer --- PKGBUILD | 13 +++++++++++-- fpf.service | 7 +++++++ fpf.timer | 8 ++++++++ fuzzy-pkg-finder.hook | 11 ----------- 4 files changed, 26 insertions(+), 13 deletions(-) create mode 100644 fpf.service create mode 100644 fpf.timer delete mode 100644 fuzzy-pkg-finder.hook diff --git a/PKGBUILD b/PKGBUILD index 0bf3403..ddf2b75 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -18,6 +18,15 @@ package() { install -dm755 $pkgdir/usr/bin cp -r $srcdir/$pkgname/bin $pkgdir/usr chmod a+x $pkgdir/usr/bin/* - install -dm755 "$pkgdir"/usr/share/libalpm/hooks/ - install -m644 $srcdir/$pkgname/fuzzy-pkg-finder.hook "$pkgdir"/usr/share/libalpm/hooks/ + install -dm755 "$pkgdir"/usr/lib/systemd/system/ + install -m644 $srcdir/$pkgname/fpf.{service,timer} "$pkgdir"/usr/lib/systemd/system/ + + echo + echo + echo ------------------------------------- + echo 'Please start/enable fpf service' + echo 'See git installation instructions' + echo ------------------------------------- + echo + echo } diff --git a/fpf.service b/fpf.service new file mode 100644 index 0000000..8e92e16 --- /dev/null +++ b/fpf.service @@ -0,0 +1,7 @@ +[Unit] +Description=Sync files database + +[Service] +Type=oneshot +User=root +ExeccStart=/usr/bin/sh -c 'pacman -Fy && yay -Fy' diff --git a/fpf.timer b/fpf.timer new file mode 100644 index 0000000..d70ff84 --- /dev/null +++ b/fpf.timer @@ -0,0 +1,8 @@ +[Unit] +Description=Periodically sync files database + +[Timer] +OnUnitInactiveSec=24hours + +[Install] +WantedBy=multi-user.target diff --git a/fuzzy-pkg-finder.hook b/fuzzy-pkg-finder.hook deleted file mode 100644 index 76de577..0000000 --- a/fuzzy-pkg-finder.hook +++ /dev/null @@ -1,11 +0,0 @@ -[Trigger] -Type = Package -Operation = Install -Operation = Upgrade -Target = fuzzy-pkg-finder - -[Action] -Description = Syncing file database... -When = PostTransaction -Exec = /bin/sh -c 'pacman -Fy && yay -Fy' -NeedsTargets