summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-06-14 09:25:46 +0200
committerErich Eckner <git@eckner.net>2017-06-14 09:25:46 +0200
commitfa4dcda68416cbdde4c5aeaa533db2a117c13e6d (patch)
treeee8d09ec4405ad725857462fce33b0ef6d86d5ba /bin
parent41727847a37f2eb11d835015327b29fd2e689bc5 (diff)
downloadbuilder-fa4dcda68416cbdde4c5aeaa533db2a117c13e6d.tar.xz
bin/db-update: decision wether package is from community extracted to new function "official_or_community"
Diffstat (limited to 'bin')
-rwxr-xr-xbin/common-functions28
-rwxr-xr-xbin/db-update19
2 files changed, 27 insertions, 20 deletions
diff --git a/bin/common-functions b/bin/common-functions
index f5e1d39..92da590 100755
--- a/bin/common-functions
+++ b/bin/common-functions
@@ -238,8 +238,7 @@ generate_package_metadata() {
# delete_old_metadata
# delete old (=unneeded) meta data of packages
-delete_old_metadata()
-{
+delete_old_metadata() {
true
# ls -1 "${file_prefix%.*.*}."* 2> /dev/null | \
# sed 's|^.*/||' | \
@@ -248,3 +247,28 @@ delete_old_metadata()
# rm "${work_dir}/package-infos/${file}"
# done
}
+
+# official_or_community $package.$repo_revision.$mod_repo_revision.$repository
+# print wether the specified package is an official package (print
+# nothing) or a community package (print 'community-')
+
+official_or_community() {
+ local package="$1"
+ local repository="${package##*.}"
+ package="${package%.*}"
+ local a32_rev="${package##*.}"
+ package="${package%.*.*}"
+
+ case "${repository}" in
+ 'community')
+ echo 'community-'
+ ;;
+ 'multilib')
+ if ! git -C "${repo_paths['archlinux32']}" archive --format=tar "${a32_rev}" -- 'extra-from-multilib' | \
+ tar -Ox | \
+ grep -qFx "${package%.*.*.*}"; then
+ echo 'community-'
+ fi
+ ;;
+ esac
+}
diff --git a/bin/db-update b/bin/db-update
index 6831c22..81bb2d6 100755
--- a/bin/db-update
+++ b/bin/db-update
@@ -204,24 +204,7 @@ for package in ${done_packages}; do
sed 's|\(-[^-]\+\)\{3\}\.pkg\.tar\.xz$||'
)
)
- case "${package##*.}" in
- 'community')
- destination='community-testing'
- ;;
- 'multilib')
- a32_rev="${package%.*}"
- a32_rev="${a32_rev##*.}"
- if git -C "${repo_paths['archlinux32']}" archive --format=tar "${a32_rev}" | \
- tar -Ox 'extra-from-multilib' | \
- grep -q "^${package%.*.*.*}\$"; then
- destination='testing'
- else
- destination='community-testing'
- fi
- ;;
- *)
- destination='testing'
- esac
+ destination="$(official_or_community "${package}")testing"
pushd "${master_mirror_directory}/i686/staging" > /dev/null
mkdir -p "../${destination}"