diff options
-rw-r--r-- | package.inc.sh | 14 |
1 files changed, 13 insertions, 1 deletions
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() { |