Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-04-23 16:20:29 +0200
committerErich Eckner <git@eckner.net>2017-04-23 16:20:29 +0200
commit61512d1f05d0c6e98e0f9114bd099ba29495b26c (patch)
tree5b565028b0b5c5c6503ee3924eeb8c684d71ce34
parentc44b75c2115197c5e5458862a7ecc7c2d6ebfbe8 (diff)
move find_pkgbuild into a separate file
-rwxr-xr-xbin/common-functions20
-rwxr-xr-xbin/get-package-updates17
-rwxr-xr-xconf/default.conf2
3 files changed, 22 insertions, 17 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
+}
diff --git a/bin/get-package-updates b/bin/get-package-updates
index df5cf7e..fa4f1d7 100755
--- a/bin/get-package-updates
+++ b/bin/get-package-updates
@@ -9,23 +9,6 @@
. "${0%/*}/../conf/default.conf"
-# 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
-}
-
# Create a lock file for build list.
exec 9> "${lock_file}"
diff --git a/conf/default.conf b/conf/default.conf
index 0343ba4..9da159c 100755
--- a/conf/default.conf
+++ b/conf/default.conf
@@ -6,6 +6,8 @@ set -e
base_dir="$(dirname "$(readlink -f "$0")")/.."
+. "${base_dir}/bin/common-functions"
+
work_dir="${base_dir}/work"
declare -A repo_paths