summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/pkg7
-rw-r--r--man/5/pkg.conf.pod6
-rw-r--r--man/7/pkg.pod11
3 files changed, 21 insertions, 3 deletions
diff --git a/bin/pkg b/bin/pkg
index ac5060b..d3c9d94 100755
--- a/bin/pkg
+++ b/bin/pkg
@@ -77,6 +77,7 @@ shift
[[ -n $PKG_ROOT ]] || die "No PKG_ROOT specified. Please edit your pkg.conf\n"
: ${PKG_DIR:="$HOME/packages"}
+: ${PKGLIST_LOCAL=0}
: ${CL_OPTIONS:=--quiet}
: ${SILENT=0}
: ${DEBUG=0}
@@ -346,10 +347,10 @@ function list_update_remote {
typeset tmpfile=$(mktemp -t pkglist.XXXXXX)
typeset -i ret=0
export PKG_DIR
- if [[ $PKG_PROTO == 'ssh' ]] {
- ssh $PKG_USER@$PKG_HOST "PKG_DIR='$PKG_DIR' $PKGLIST_PATH $PKG_PATH" > $tmpfile
- } elif [[ $PKG_PROTO == 'file' ]] {
+ if [[ $PKGLIST_LOCAL == 1 || $PKG_PROTO == 'file' ]] {
$PKGLIST_PATH $PKG_PATH > $tmpfile
+ } elif [[ $PKG_PROTO == 'ssh' ]] {
+ ssh $PKG_USER@$PKG_HOST "PKG_DIR='$PKG_DIR' $PKGLIST_PATH $PKG_PATH" > $tmpfile
}
if [[ -n $(cat $tmpfile) ]] {
cp $tmpfile .list-remote
diff --git a/man/5/pkg.conf.pod b/man/5/pkg.conf.pod
index 2e3273d..c66ae2d 100644
--- a/man/5/pkg.conf.pod
+++ b/man/5/pkg.conf.pod
@@ -32,6 +32,12 @@ I<url> may either be of the form C<ssh://host/path> or C</path>.
path to pkglist on the package root, to generate the package list.
In the default, $PKG_PATH means the path component of $PKG_ROOT.
+=item B<PKGLIST_LOCAL>=I<boolean> [0]
+
+If true, B<PKLIST_PATH> will always be executed on the local machine, regardless
+of where the B<PKG_ROOT> lies. For possible uses of this setting, see
+L<pkg(7)/"THE PACKAGE LIST">
+
=item B<PKG_DIR>=I<path> (--packagedir I<path>) [$HOME/packages]
path for the local package tree
diff --git a/man/7/pkg.pod b/man/7/pkg.pod
index 5c36bff..8288b54 100644
--- a/man/7/pkg.pod
+++ b/man/7/pkg.pod
@@ -63,6 +63,17 @@ repository type (DVCS), the third the current revision. Example:
pkg git 82d716d01dee0329af7df5e67b55558fe3ff1466
+The package list is generated by the script set in the config var $PKGLIST_PATH,
+by default F<include/pkglist>. Depending on $PKGLIST_LOCAL and $PKG_ROOT, it
+is either executed on the local host or on the remote host containing the package
+root. The script is always called with $PKG_PATH as the first argument.
+Its output must only contain valid pkglist lines (see the example above).
+
+With $PKGLIST_LOCAL set to 1, there are some interesting possibilities.
+For instance, your pkglist script could contain a line like
+C<< curl -s http://example.org/cgi-bin/pkglist.cgi >> - so you can update your
+remote package list without having to use ssh.
+
=head1 WHAT IS A PACKAGE?
Anything tracked with git can be used as package. However, as the purpose of pkg