summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2014-08-28 21:46:24 -0400
committerDave Reisner <dreisner@archlinux.org>2014-08-28 21:46:24 -0400
commit61d246b0ea8dd89c9c31a1d9a19dac407442247b (patch)
tree5b7f0adbd1ae694b931d3bbe18051aee910c6070
parentaaaffa215bfaba48c2e85c2813a82b3bc82afb00 (diff)
downloadasp32-61d246b0ea8dd89c9c31a1d9a19dac407442247b.tar.xz
package: simplify arch/repo extraction
-rw-r--r--package.inc.sh9
1 files changed, 4 insertions, 5 deletions
diff --git a/package.inc.sh b/package.inc.sh
index e7dce7f..3f301c0 100644
--- a/package.inc.sh
+++ b/package.inc.sh
@@ -121,13 +121,12 @@ package_checkout() {
package_get_repos_with_arch() {
local pkgname=$1 remote=$2
- local objtype path arch repo
+ local path arch repo
- while read _ objtype _ path; do
- [[ $objtype = tree ]] || continue
- IFS=- read repo arch <<<"${path#repos/}"
+ while read path; do
+ IFS=/- read _ repo arch <<<"$path"
printf '%s %s\n' "$repo" "$arch"
- done < <(git ls-tree "$remote/packages/$pkgname" repos/)
+ done < <(git ls-tree --name-only "$remote/packages/$pkgname" repos/)
}
package_get_arches() {