From 61d246b0ea8dd89c9c31a1d9a19dac407442247b Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Thu, 28 Aug 2014 21:46:24 -0400 Subject: package: simplify arch/repo extraction --- package.inc.sh | 9 ++++----- 1 file 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() { -- cgit v1.2.3-70-g09d2