summaryrefslogtreecommitdiff
path: root/package.inc.sh
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2014-08-28 23:09:43 -0400
committerDave Reisner <dreisner@archlinux.org>2014-08-29 22:30:30 -0400
commit5997ed5aae975f3b1fc74af0797db9c01345114a (patch)
tree7a9b0b09fdf0305d498d6d35e988f708365b81ba /package.inc.sh
parent61d246b0ea8dd89c9c31a1d9a19dac407442247b (diff)
downloadasp32-5997ed5aae975f3b1fc74af0797db9c01345114a.tar.xz
add 'show' verb, to display a PKGBUILD for a package
Diffstat (limited to 'package.inc.sh')
-rw-r--r--package.inc.sh19
1 files changed, 18 insertions, 1 deletions
diff --git a/package.inc.sh b/package.inc.sh
index 3f301c0..d382b41 100644
--- a/package.inc.sh
+++ b/package.inc.sh
@@ -70,6 +70,24 @@ package_log() {
git log "${logargs[@]}" "$remote/packages/$pkgname" -- trunk/
}
+package_show_pkgbuild() {
+ local pkgname=$1 remote repo subtree blob_id
+
+ if [[ $pkgname = */* ]]; then
+ IFS=/ read -r repo pkgname <<<"$pkgname"
+ fi
+
+ package_init "$pkgname" remote || return
+
+ if [[ $repo ]]; then
+ subtree=repos/$repo-$OPT_ARCH
+ else
+ subtree=trunk
+ fi
+
+ git show "remotes/$remote/packages/$pkgname":"$subtree"/PKGBUILD
+}
+
package_export() {
local pkgname=$1 remote repo arch
local mode objtype objid path
@@ -80,7 +98,6 @@ package_export() {
package_init "$pkgname" remote || return 1
- # support $repo/$pkgname syntax
if [[ $repo ]]; then
subtree=repos/$repo-$OPT_ARCH
else