From aceefc28ca701feb87135a9643fd8d57223a550f Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sun, 12 Mar 2017 15:25:45 -0400 Subject: support showing files from repos dir --- package.inc.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/package.inc.sh b/package.inc.sh index 9ff4e7c..7c34f23 100644 --- a/package.inc.sh +++ b/package.inc.sh @@ -85,9 +85,21 @@ package_show_file() { package_list_files() { local pkgname=$1 remote + if [[ $pkgname = */* ]]; then + IFS=/ read -r repo pkgname <<<"$pkgname" + fi + package_init "$pkgname" remote || return - git ls-tree -r --name-only "remotes/$remote/packages/$pkgname" "trunk" | sed 's,^trunk/,,' + if [[ $repo ]]; then + subtree=repos/$repo-$OPT_ARCH + else + subtree=trunk + fi + + + git ls-tree -r --name-only "remotes/$remote/packages/$pkgname" "$subtree" | + awk -v prefix=$subtree/ 'sub(prefix, "")' } package_export() { -- cgit v1.2.3-70-g09d2