# HG changeset patch # User Christophe Lincoln # Date 1337788103 -7200 # Node ID 17e896f1d41d51a898bb32644eeaff4ed763dfd7 # Parent e5b0051e50211945b36ce34c076610353dc6aa97 Fix spk-add and small clean diff -r e5b0051e5021 -r 17e896f1d41d lib/libspk.sh --- a/lib/libspk.sh Wed May 23 16:17:38 2012 +0200 +++ b/lib/libspk.sh Wed May 23 17:48:23 2012 +0200 @@ -191,25 +191,18 @@ local target_dir=$2 # Validate the file - check_valid_tazpkg $package_file + #check_valid_tazpkg $package_file # Find the package name local package_name=$(package_name $package_file) - # Create destination directory + # Create destination directory and copy package local dest_dir=$(pwd)/$package_name [ -n "$target_dir" ] && dest_dir=$target_dir/$package_name mkdir -p $dest_dir + cp $package_file $dest_dir - newline - echo $(boldify $(gettext "Extracting:")) $package_name - separator - - gettext "Copying original package..." - cp $package_file $dest_dir - status - - cd $dest_dir + cd $dest_dir size=$(du -sh $package_file | awk '{print $1}') echo -n $(gettext "Extracting archive"): $size cpio -idm --quiet < ${package_file##*/} @@ -218,11 +211,6 @@ rm fs.cpio.lzma status cd - > /dev/null - - separator - echo -n "$package_name" - gettext "is extracted to:"; echo " $dest_dir" - newline } # Unser var set by mirrored_pkg diff -r e5b0051e5021 -r 17e896f1d41d spk --- a/spk Wed May 23 16:17:38 2012 +0200 +++ b/spk Wed May 23 17:48:23 2012 +0200 @@ -163,6 +163,10 @@ newline fi continue ;; + *\ --extract\ *) + newline + echo $(boldify $(gettext "Extracting:")) $pkg + separator ;; esac count=$(($count + 1)) [ "$count" == 1 ] && newline diff -r e5b0051e5021 -r 17e896f1d41d spk-add --- a/spk-add Wed May 23 16:17:38 2012 +0200 +++ b/spk-add Wed May 23 17:48:23 2012 +0200 @@ -109,9 +109,11 @@ # Remove receipt that will be overwritten by extraction rm $tmpdir/receipt - + # Extract Package + debug "extract_package $package_file $tmpdir" extract_package $package_file $tmpdir + tmpdir="$tmpdir/$PACKAGE-$VERSION" # Get files to remove if upgrading local files_to_remove diff -r e5b0051e5021 -r 17e896f1d41d spk-ls --- a/spk-ls Wed May 23 16:17:38 2012 +0200 +++ b/spk-ls Wed May 23 17:48:23 2012 +0200 @@ -92,7 +92,7 @@ for pkg in $(ls -1 $installed) do . $installed/$pkg/receipt - echo -n $(colorize 32 $pkg); indent 28 " $VERSION" + echo -n "$(colorize 32 $pkg)"; indent 28 " $VERSION" done separator boldify $(count_installed) diff -r e5b0051e5021 -r 17e896f1d41d spk-rm --- a/spk-rm Wed May 23 16:17:38 2012 +0200 +++ b/spk-rm Wed May 23 17:48:23 2012 +0200 @@ -89,7 +89,7 @@ # Remove all files fileslist=$installed/$PACKAGE/files.list - gettext "Removing installed files:" + gettext "Installed files:" echo -n " $(wc -l $fileslist | cut -d " " -f 1)" [ "$verbose" ] && newline for file in $(cat $fileslist)