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-functions28
1 files changed, 26 insertions, 2 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
+}