Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/common-functions
diff options
context:
space:
mode:
Diffstat (limited to 'bin/common-functions')
-rwxr-xr-xbin/common-functions20
1 files changed, 20 insertions, 0 deletions
diff --git a/bin/common-functions b/bin/common-functions
new file mode 100755
index 0000000..2191d01
--- /dev/null
+++ b/bin/common-functions
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+# contains functions used by more than one script
+
+# find the PKGBUILD of a given package in a given repository
+# TODO:
+# _properly_ include repository of package customizations
+
+find_pkgbuild() {
+
+ for prefix in "${repo_paths["packages"]}" "${repo_paths["community"]}"; do
+ [ -d "${prefix}/$1" ] || continue
+ ls "${prefix}/$1/repos/$2-"*"/PKGBUILD" 2> /dev/null && break
+ done | \
+ tr ' ' '\n' | \
+ grep -v -- '-i686/PKGBUILD$' | \
+ grep -v -- '-\(staging\|testing\)-[^/]\+/PKGBUILD$' | \
+ sort | \
+ tail -n1
+}