# HG changeset patch # User Pascal Bellard # Date 1238178189 0 # Node ID 63f4f0e413e1a7ca6f4c084246648447a0e5dbd1 # Parent 90af2423ad9f1dc290432a8a519ed2cd287caf94 tazpkg reconfigure on target dir diff -r 90af2423ad9f -r 63f4f0e413e1 tazpkg --- a/tazpkg Fri Mar 27 17:58:11 2009 +0000 +++ b/tazpkg Fri Mar 27 18:23:09 2009 +0000 @@ -174,8 +174,8 @@ # Check for the receipt of an installed package. check_for_receipt() { - if [ ! -f "$INSTALLED/$PACKAGE/receipt" ]; then - echo -e "\nUnable to find the receipt : $INSTALLED/$PACKAGE/receipt\n" + if [ ! -f "$1$INSTALLED/$PACKAGE/receipt" ]; then + echo -e "\nUnable to find the receipt : $1$INSTALLED/$PACKAGE/receipt\n" exit 0 fi } @@ -2064,14 +2064,27 @@ # check_for_package_on_cmdline check_root - if [ -d "$INSTALLED/$PACKAGE" ]; then - check_for_receipt + ROOT="" + while [ -n "$3" ]; do + case "$3" in + --root=*) + ROOT="${3#--root=}/" + ;; + *) shift 2 + echo -e "\nUnknown option $*.\n" + exit 1 + ;; + esac + shift + done + if [ -d "$ROOT$INSTALLED/$PACKAGE" ]; then + check_for_receipt $ROOT # Check for post_install - if grep -q ^post_install $INSTALLED/$PACKAGE/receipt; then - . $INSTALLED/$PACKAGE/receipt - post_install + if grep -q ^post_install $ROOT$INSTALLED/$PACKAGE/receipt; then + . $ROOT$INSTALLED/$PACKAGE/receipt + post_install $ROOT # Log this activity - log Reconfigured + [ -n "$ROOT" ] || log Reconfigured else echo -e "\nNothing to do for $PACKAGE." fi