summaryrefslogtreecommitdiff
path: root/package.inc.sh
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2017-03-12 15:25:45 -0400
committerDave Reisner <dreisner@archlinux.org>2017-03-12 15:28:36 -0400
commitaceefc28ca701feb87135a9643fd8d57223a550f (patch)
tree3f131a2fdcd491c8494e6b043cb97e02c1365d20 /package.inc.sh
parent382337e9970c3e522461deadb99a88e9ac307215 (diff)
downloadasp32-aceefc28ca701feb87135a9643fd8d57223a550f.tar.xz
support showing files from repos dir
Diffstat (limited to 'package.inc.sh')
-rw-r--r--package.inc.sh14
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() {