]> code.delx.au - monosys/commitdiff
AUR helpers
authorJames Bunton <jamesbunton@delx.net.au>
Wed, 16 Jan 2019 06:39:06 +0000 (17:39 +1100)
committerJames Bunton <jamesbunton@delx.net.au>
Wed, 16 Jan 2019 06:39:06 +0000 (17:39 +1100)
aur-check-updates [moved from check-aur-updates with 100% similarity]
aur-installx [new file with mode: 0755]
check-pacman-updates [deleted file]
makechrootpkgx [new file with mode: 0755]
repo-ls [new file with mode: 0755]
repo-sign [new file with mode: 0755]

similarity index 100%
rename from check-aur-updates
rename to aur-check-updates
diff --git a/aur-installx b/aur-installx
new file mode 100755 (executable)
index 0000000..d6af65d
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+PKGNAME="$1"
+shift
+
+exec aur-install "$PKGNAME" makechrootpkgx "$@"
diff --git a/check-pacman-updates b/check-pacman-updates
deleted file mode 100755 (executable)
index d6dd957..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-
-set -eu
-
-FAKEDB="/tmp/checkupdates-db"
-rm -rf "$FAKEDB"
-mkdir -p "$FAKEDB"
-
-ln -s "/var/lib/pacman/local" "${FAKEDB}/"
-fakeroot -- pacman -Sy --dbpath "$FAKEDB" --logfile /dev/null > /dev/null
-pacman -Qu --dbpath "$FAKEDB" || true
-
-rm -rf "$FAKEDB"
diff --git a/makechrootpkgx b/makechrootpkgx
new file mode 100755 (executable)
index 0000000..e2ad45e
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+set -xeu
+sudo arch-nspawn /var/abs/chroot/root pacman -Syu
+makechrootpkg -c -l "$(basename "$PWD")" -T -r /var/abs/chroot
diff --git a/repo-ls b/repo-ls
new file mode 100755 (executable)
index 0000000..44f3b2b
--- /dev/null
+++ b/repo-ls
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+set -eu
+
+tar -Oxf "$1" | \
+    awk 'BEGIN {RS=""} $1 == "%NAME%" {printf "%s ", $2} $1 == "%VERSION%" {print $2}'
diff --git a/repo-sign b/repo-sign
new file mode 100755 (executable)
index 0000000..97303cd
--- /dev/null
+++ b/repo-sign
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+set -eu
+
+cd /var/cache/pacman/abs
+
+tosign=()
+for pkg in *.pkg.tar.xz; do
+    if ! [ -f "${pkg}.sig" ]; then
+        tosign+=("$pkg")
+    fi
+done
+
+if [ "${#tosign[@]}" -gt 0 ]; then
+    echo "Signing:"
+    echo "${tosign[@]}" | xargs -n1 echo "  "
+    echo
+    for i in $(seq 5 -1 1); do
+        echo -n "$i "
+        sleep 1
+    done
+    echo
+    set -x
+    # Preload the agent
+    gpg --output /dev/null --detach-sign /dev/null
+    echo "${tosign[@]}" | xargs -n1 gpg --detach-sign
+    echo "${tosign[@]}" | xargs -n1 repo-add delx.db.tar.xz -R
+else
+    echo "Nothing to do"
+fi