# HG changeset patch # User Pascal Bellard # Date 1308584549 -7200 # Node ID 6d86f1a46a688baa783028ed40a0c5643286dffa # Parent 3e2fe6e201d26fc79da57ff1f490138b84ee7ffc tazpkg convert: may specify LOCALSTATE dir diff -r 3e2fe6e201d2 -r 6d86f1a46a68 tazpkg --- a/tazpkg Fri Jun 03 13:24:52 2011 +0000 +++ b/tazpkg Mon Jun 20 17:42:29 2011 +0200 @@ -64,6 +64,9 @@ UP_LIST=$LOCALSTATE/packages.up DEFAULT_MIRROR="http://mirror.slitaz.org/packages/`cat /etc/slitaz-release`/" +# Need by check_depends +TMPLOCALSTATE= + # Check if the directories and files used by Tazpkg # exist. If not and user is root we create them. check_base_dir() @@ -1061,9 +1064,10 @@ { DEFAULT_DEPENDS="glibc-base gcc-lib-base" - [ -f $LOCALSTATE/files.list.lzma ] || tazpkg recharge > /dev/null - for i in $LOCALSTATE/files.list.lzma \ - $LOCALSTATE/undigest/*/files.list.lzma ; do + [ -n "$TMPLOCALSTATE" ] || TMPLOCALSTATE=$LOCALSTATE + [ -f $TMPLOCALSTATE/files.list.lzma ] || tazpkg recharge > /dev/null + for i in $TMPLOCALSTATE/files.list.lzma \ + $TMPLOCALSTATE/undigest/*/files.list.lzma ; do [ -f $i ] && lzma d $i -so >> $TMP_DIR/files.list done find $TMP_DIR/$file/fs -type f | while read chkfile ; do @@ -2836,6 +2840,8 @@ convert|-c) # convert misc package format to .tazpkg check_for_package_file + [ -n "$TARGET_DIR" -a -s "$TARGET_DIR/files.list.lzma" ] && + TMPLOCALSTATE="$TARGET_DIR" if [ "$(dd if=$PACKAGE_FILE bs=8 count=1 skip=1 2> /dev/null)" \ == "debian-b" ]; then convert_deb