From 5997ed5aae975f3b1fc74af0797db9c01345114a Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Thu, 28 Aug 2014 23:09:43 -0400 Subject: add 'show' verb, to display a PKGBUILD for a package --- package.inc.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'package.inc.sh') 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 -- cgit v1.2.3-70-g09d2