spk rev 78

Fix spk-add and small clean
author Christophe Lincoln <pankso@slitaz.org>
date Wed May 23 17:48:23 2012 +0200 (2012-05-23)
parents e5b0051e5021
children a75380e9a681
files lib/libspk.sh spk spk-add spk-ls spk-rm
line diff
     1.1 --- a/lib/libspk.sh	Wed May 23 16:17:38 2012 +0200
     1.2 +++ b/lib/libspk.sh	Wed May 23 17:48:23 2012 +0200
     1.3 @@ -191,25 +191,18 @@
     1.4  	local target_dir=$2
     1.5  
     1.6  	# Validate the file
     1.7 -	check_valid_tazpkg $package_file
     1.8 +	#check_valid_tazpkg $package_file
     1.9  
    1.10  	# Find the package name
    1.11  	local package_name=$(package_name $package_file)
    1.12  
    1.13 -	# Create destination directory
    1.14 +	# Create destination directory and copy package
    1.15  	local dest_dir=$(pwd)/$package_name
    1.16  	[ -n "$target_dir" ] && dest_dir=$target_dir/$package_name
    1.17  	mkdir -p $dest_dir
    1.18 +	cp $package_file $dest_dir
    1.19  
    1.20 -	newline
    1.21 -	echo $(boldify $(gettext "Extracting:")) $package_name
    1.22 -	separator
    1.23 -
    1.24 -	gettext "Copying original package..."
    1.25 -	cp $package_file $dest_dir
    1.26 -	status
    1.27 -	
    1.28 -	cd $dest_dir	
    1.29 +	cd $dest_dir
    1.30  	size=$(du -sh $package_file | awk '{print $1}')
    1.31  	echo -n $(gettext "Extracting archive"): $size
    1.32  	cpio -idm --quiet < ${package_file##*/}
    1.33 @@ -218,11 +211,6 @@
    1.34  	rm fs.cpio.lzma
    1.35  	status
    1.36  	cd - > /dev/null
    1.37 -	
    1.38 -	separator
    1.39 -	echo -n "$package_name"
    1.40 -	gettext "is extracted to:"; echo " $dest_dir"
    1.41 -	newline
    1.42  }
    1.43  
    1.44  # Unser var set by mirrored_pkg
     2.1 --- a/spk	Wed May 23 16:17:38 2012 +0200
     2.2 +++ b/spk	Wed May 23 17:48:23 2012 +0200
     2.3 @@ -163,6 +163,10 @@
     2.4  					newline
     2.5  				fi
     2.6  				continue ;;
     2.7 +			*\ --extract\ *)
     2.8 +					newline
     2.9 +					echo $(boldify $(gettext "Extracting:")) $pkg
    2.10 +					separator ;;
    2.11  		esac
    2.12  		count=$(($count + 1))
    2.13  		[ "$count" == 1 ] && newline
     3.1 --- a/spk-add	Wed May 23 16:17:38 2012 +0200
     3.2 +++ b/spk-add	Wed May 23 17:48:23 2012 +0200
     3.3 @@ -109,9 +109,11 @@
     3.4  
     3.5  	# Remove receipt that will be overwritten by extraction
     3.6  	rm $tmpdir/receipt
     3.7 -	
     3.8 +
     3.9  	# Extract Package
    3.10 +	debug "extract_package $package_file $tmpdir"
    3.11  	extract_package $package_file $tmpdir
    3.12 +	tmpdir="$tmpdir/$PACKAGE-$VERSION"
    3.13  
    3.14  	# Get files to remove if upgrading
    3.15  	local files_to_remove
     4.1 --- a/spk-ls	Wed May 23 16:17:38 2012 +0200
     4.2 +++ b/spk-ls	Wed May 23 17:48:23 2012 +0200
     4.3 @@ -92,7 +92,7 @@
     4.4  			for pkg in $(ls -1 $installed)
     4.5  			do
     4.6  				. $installed/$pkg/receipt
     4.7 -				echo -n $(colorize 32 $pkg); indent 28 " $VERSION"
     4.8 +				echo -n "$(colorize 32 $pkg)"; indent 28 " $VERSION"
     4.9  			done
    4.10  			separator
    4.11  			boldify $(count_installed)
     5.1 --- a/spk-rm	Wed May 23 16:17:38 2012 +0200
     5.2 +++ b/spk-rm	Wed May 23 17:48:23 2012 +0200
     5.3 @@ -89,7 +89,7 @@
     5.4  
     5.5  	# Remove all files
     5.6  	fileslist=$installed/$PACKAGE/files.list
     5.7 -	gettext "Removing installed files:"
     5.8 +	gettext "Installed files:"
     5.9  	echo -n " $(wc -l $fileslist | cut -d " " -f 1)"
    5.10  	[ "$verbose" ] && newline
    5.11  	for file in $(cat $fileslist)