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-06-20 14:47:56 +0200
committerErich Eckner <git@eckner.net>2017-06-20 14:47:56 +0200
commitb69310cdb08356f381fe70aa113d17a558156852 (patch)
treedb5ae9e871f3bdb7cf1b4ab8b79366638c734215
parent874574da0c90c03afebe7f10fd8550d6e4f1b143 (diff)
bin/common-functions: repository_of_package new
-rwxr-xr-xbin/common-functions28
1 files changed, 19 insertions, 9 deletions
diff --git a/bin/common-functions b/bin/common-functions
index 7f82042..9b69657 100755
--- a/bin/common-functions
+++ b/bin/common-functions
@@ -273,11 +273,10 @@ delete_old_metadata() {
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-')
+# repository_of_package $package.$repo_revision.$mod_repo_revision.$repository
+# print which (stable) repository a package belongs to
-official_or_community() {
+repository_of_package() {
local package="$1"
local repository="${package##*.}"
package="${package%.*}"
@@ -285,19 +284,30 @@ official_or_community() {
package="${package%.*.*}"
case "${repository}" in
- 'community')
- echo 'community-'
- ;;
'multilib')
- if ! git -C "${repo_paths__archlinux32}" archive --format=tar "${a32_rev}" -- 'extra-from-multilib' | \
+ if git -C "${repo_paths__archlinux32}" archive --format=tar "${a32_rev}" -- 'extra-from-multilib' | \
tar -Ox | \
grep -qFx "${package%.*.*.*}"; then
- echo 'community-'
+ echo 'extra'
+ else
+ echo 'community'
fi
;;
+ *)
+ echo "${repository}"
esac
}
+# 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() {
+ if [ "$(repository_of_package "$1")" = 'community' ]; then
+ echo 'community-'
+ fi
+}
+
# remove_old_package_versions $directory $package_file
# removes all other versions of $package_file in $directory on the master mirror