# HG changeset patch # User Christophe Lincoln # Date 1334276709 -7200 # Node ID 255cddc8eb36d38f3ff678882e1cf52cd053fbfd # Parent 59ac27af090dc076e2c41e40f61e61c234d5728b Use /lib/libtaz.sh diff -r 59ac27af090d -r 255cddc8eb36 tazpkg --- a/tazpkg Fri Apr 13 02:10:29 2012 +0200 +++ b/tazpkg Fri Apr 13 02:25:09 2012 +0200 @@ -25,6 +25,8 @@ . /etc/slitaz/slitaz.conf . /etc/slitaz/tazpkg.conf +. /lib/libtaz.sh + # Include gettext helper script. . /usr/bin/gettext.sh @@ -61,21 +63,6 @@ # 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() -{ - if test $(id -u) = 0 ; then - check_dir $1$CACHE_DIR - check_dir $1$INSTALLED - if [ ! -f "$1$LOCALSTATE/mirror" ]; then - echo "$DEFAULT_MIRROR" > $1$LOCALSTATE/mirror - [ -n "$1" ] && cp $LOCALSTATE/packages.* $1$LOCALSTATE/ - fi - fi -} -check_base_dir - #################### # Script functions # #################### @@ -146,10 +133,6 @@ " } -separator() { - echo "================================================================================" -} - # Check if dir exist check_dir() { @@ -161,6 +144,25 @@ fi } +# Check if the directories and files used by Tazpkg +# exist. If not and user is root we create them. +check_base_dir() +{ + if test $(id -u) = 0 ; then + check_dir $1$CACHE_DIR + check_dir $1$INSTALLED + if [ ! -f "$1$LOCALSTATE/mirror" ]; then + echo "$DEFAULT_MIRROR" > $1$LOCALSTATE/mirror + [ -n "$1" ] && cp $LOCALSTATE/packages.* $1$LOCALSTATE/ + fi + fi +} +check_base_dir + +separator() { + echo "================================================================================" +} + # Store -- options in a variable. get_options() {