aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO14
-rw-r--r--PKGBUILD22
-rw-r--r--README.md5
-rw-r--r--list-installed-packages.hook11
4 files changed, 52 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..735bc76250e5
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,14 @@
+pkgbase = pacman-hook-list-installed-packages
+ pkgdesc = Pacman hook to list installed packages in /etc/packages-list-native.txt and /etc/packages-list-foreign.txt
+ pkgver = latest
+ pkgrel = 1
+ url = https://gitlab.com/jdorel-archlinux/pacman-hook-list-installed-packages
+ arch = any
+ license = GPL
+ makedepends = git
+ source = list-installed-packages.hook
+ md5sums = SKIP
+ sha256sums = 010b00d9804e65643609f7605661e9a16535729668bd9533db1d83daa7dce197
+
+pkgname = pacman-hook-list-installed-packages
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..44fb6da96ff4
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,22 @@
+# Maintainer: Jonas DOREL <jonas at dorel dot me>
+pkgname=pacman-hook-list-installed-packages
+pkgver=latest
+pkgrel=1
+pkgdesc="Pacman hook to list installed packages in /etc/packages-list-native.txt and /etc/packages-list-foreign.txt"
+arch=('any')
+url="https://gitlab.com/jdorel-archlinux/pacman-hook-list-installed-packages"
+license=('GPL')
+makedepends=('git')
+source=('list-installed-packages.hook')
+md5sums=('SKIP')
+sha256sums=(
+ '010b00d9804e65643609f7605661e9a16535729668bd9533db1d83daa7dce197'
+)
+
+pkgver() {
+ printf "latest"
+}
+
+package() {
+ install -Dm 644 $srcdir/list-installed-packages.hook "$pkgdir/usr/share/libalpm/hooks/list-installed-packages.hook"
+}
diff --git a/README.md b/README.md
new file mode 100644
index 000000000000..e812956edc7f
--- /dev/null
+++ b/README.md
@@ -0,0 +1,5 @@
+[![Actively Maintained](https://img.shields.io/badge/Maintenance%20Level-Actively%20Maintained-green.svg)](https://gist.github.com/cheerfulstoic/d107229326a01ff0f333a1d3476e068d)
+
+Pacman hook to list :
+ - native installed packages in /etc/packages-list-native.txt
+ - foreign installed packages in /etc/packages-list-foreign.txt
diff --git a/list-installed-packages.hook b/list-installed-packages.hook
new file mode 100644
index 000000000000..a227f7aec8a3
--- /dev/null
+++ b/list-installed-packages.hook
@@ -0,0 +1,11 @@
+[Trigger]
+Operation = Install
+Operation = Remove
+Type = Package
+Target = *
+
+[Action]
+Description = Update packages lists in /etc
+When = PostTransaction
+# pacman -Qqe : List explicitly installed packages name. --native for pacman packages, --foreign for others (like from the AUR)
+Exec = /bin/sh -c '/usr/bin/pacman -Qqe --native > /etc/packages-list-native.txt && /usr/bin/pacman -Qqe --foreign > /etc/packages-list-foreign.txt'