summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Severance2017-07-25 15:42:17 -0400
committerChris Severance2017-07-25 15:42:17 -0400
commit7b69aaba89cc1c59ea21134b44f7e4630c2f236e (patch)
treecf87c3a094f48b26dfc74ad9e27c601fd73c275e
downloadaur-pacman-sync.tar.gz
Initial Import
-rw-r--r--.SRCINFO13
-rw-r--r--PKGBUILD38
2 files changed, 51 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..7460e1df1ea7
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,13 @@
+# Generated by mksrcinfo v8
+# Tue Jul 25 19:41:58 UTC 2017
+pkgbase = pacman-sync
+ pkgdesc = alpm hook to sync after pacman installs to prevent corruption from using a flash disk or reboot to kernel crash
+ pkgver = 1.0.0
+ pkgrel = 1
+ url = https://www.archlinux.org/pacman/alpm-hooks.5.html
+ arch = any
+ license = GPL
+ depends = pacman
+
+pkgname = pacman-sync
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..b6c8deaacf57
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,38 @@
+# Maintainer: Chris Severance aur.severach aATt spamgourmet dott com
+# Contributor: Allan McRae <allan@archlinux.org>
+
+# This should be built in.
+
+set -u
+pkgname='pacman-sync'
+pkgver='1.0.0'
+pkgrel='1'
+pkgdesc='alpm hook to sync after pacman installs to prevent corruption from using a flash disk or reboot to kernel crash'
+arch=('any')
+url='https://www.archlinux.org/pacman/alpm-hooks.5.html'
+license=('GPL')
+depends=('pacman')
+
+package() {
+ set -u
+ install -Dm644 <(cat << EOF
+# Force disks to sync to reduce the risk of data corruption
+
+[Trigger]
+Operation = Install
+Operation = Upgrade
+Operation = Remove
+Type = Package
+Target = *
+
+[Action]
+Description = sync all file systems
+Depends = coreutils
+When = PostTransaction
+Exec = /usr/bin/sync
+EOF
+ ) "${pkgdir}/usr/share/libalpm/hooks/zzz_sync.hook"
+ ln -s 'zzz_sync.hook' "${pkgdir}/usr/share/libalpm/hooks/00_sync.hook"
+ set +u
+}
+set +u