From d4993229956a3510acd19045931fea05107a1209 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 4 Apr 2009 19:23:22 +0200 Subject: pkg: Do not rely on the core repo being not bare list_update_remote: Use $PKGLIST_PATH as location for the pkglist script. Attention: this change is not backwards-compatible --- bin/pkg | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'bin/pkg') diff --git a/bin/pkg b/bin/pkg index 843bcb4..9d11bef 100755 --- a/bin/pkg +++ b/bin/pkg @@ -159,10 +159,13 @@ if [[ $PKG_PROTO == 'ssh' ]] { PKG_PATH=$PKG_ROOT } +: ${PKGLIST_PATH:=$PKG_PATH/pkglist} + debug "PKG_ROOT: '$PKG_ROOT'" debug "PKG_PROTO: '$PKG_PROTO'" debug "PKG_USER: '$PKG_USER'" debug "PKG_HOST: '$PKG_HOST'" +debug "PKGLIST_PATH: '$PKGLIST_PATH'" ## ## Ask the user for confirmation @@ -311,14 +314,19 @@ function list_update_remote { typeset -i ret=0 export PDIR if [[ $PKG_PROTO == 'ssh' ]] { - ssh $PKG_USER@$PKG_HOST "PDIR='$PDIR' $PKG_PATH/core/include/pkglist $PKG_PATH" > $tmpfile || ret=$? + ssh $PKG_USER@$PKG_HOST "PDIR='$PDIR' $PKGLIST_PATH $PKG_PATH" > $tmpfile || ret=$? } elif [[ $PKG_PROTO == 'file' ]] { - $PKG_PATH/core/include/pkglist $PKG_PATH > $tmpfile || ret=$? + $PKGLIST_PATH $PKG_PATH > $tmpfile || ret=$? } if (( ret == 0 )) { cp $tmpfile .list-remote } else { - die "remote list update failed\n" + die "remote list update failed\n" \ + " -- note --\n" \ + "There were recent changes in pkg involving the package root\n\n" \ + "You might have to copy the pkglist script ($PDIR/core/include/pkglist)\n" \ + "into the package root, so that it's available as\n" \ + "$PKG_HOST:$PKG_PATH/pkglist\n" } rm $tmpfile } -- cgit v1.2.3