spk rev 80

Small fixes and improvments to add, mirror and libspk.sh
author Christophe Lincoln <pankso@slitaz.org>
date Thu May 24 17:00:55 2012 +0200 (2012-05-24)
parents a75380e9a681
children 6963573f7242
files Makefile lib/libspk.sh spk-add spk-mirror
line diff
     1.1 --- a/Makefile	Wed May 23 21:31:14 2012 +0000
     1.2 +++ b/Makefile	Thu May 24 17:00:55 2012 +0200
     1.3 @@ -45,6 +45,7 @@
     1.4  	install -m 0755 spk-rm $(DESTDIR)$(PREFIX)/sbin
     1.5  	install -m 0755 spk-add $(DESTDIR)$(PREFIX)/sbin
     1.6  	install -m 0755 spk-mirror $(DESTDIR)$(PREFIX)/sbin
     1.7 +	install -m 0755 spk-up $(DESTDIR)$(PREFIX)/sbin
     1.8  
     1.9  # Clean source
    1.10  
     2.1 --- a/lib/libspk.sh	Wed May 23 21:31:14 2012 +0000
     2.2 +++ b/lib/libspk.sh	Thu May 24 17:00:55 2012 +0200
     2.3 @@ -17,6 +17,7 @@
     2.4  pkgsdesc="${root}${PKGS_DB}/packages.desc"
     2.5  pkgsmd5="${root}${PKGS_DB}/packages.$SUM"
     2.6  pkgsequiv="${root}${PKGS_DB}/packages.equiv"
     2.7 +pkgsup="${root}${PKGS_DB}/packages.up"
     2.8  blocked="${root}${PKGS_DB}/blocked.list"
     2.9  activity="${root}${PKGS_DB}/activity"
    2.10  logdir="${root}/var/log/spk"
    2.11 @@ -32,6 +33,10 @@
    2.12  	exit 1
    2.13  fi
    2.14  
    2.15 +if [ ! -d "${root}${extradb}" ]; then
    2.16 +	mkdir -p ${root}${extradb}
    2.17 +fi
    2.18 +
    2.19  #
    2.20  # Functions
    2.21  #
     3.1 --- a/spk-add	Wed May 23 21:31:14 2012 +0000
     3.2 +++ b/spk-add	Thu May 24 17:00:55 2012 +0200
     3.3 @@ -103,7 +103,7 @@
     3.4  	if [ "$verbose" ]; then
     3.5  		gettext "Incrementing:"; echo -n " $(basename $installed.$SUM)"
     3.6  	fi
     3.7 -	sed -i "/$(basename $package_file)/"d $installed.$SUM 2>/dev/null
     3.8 +	sed -i "/  $PACKAGE-$VERSION*/"d $installed.$SUM 2>/dev/null
     3.9  	$CHECKSUM $(basename $package_file) >> $installed.$SUM
    3.10  	[ "$verbose" ] && status
    3.11  
    3.12 @@ -111,7 +111,7 @@
    3.13  	rm $tmpdir/receipt
    3.14  
    3.15  	# Extract Package
    3.16 -	debug "extract_package $package_file $tmpdir"
    3.17 +	#debug "extract_package $package_file $tmpdir"
    3.18  	extract_package $package_file $tmpdir
    3.19  	tmpdir="$tmpdir/$PACKAGE-$VERSION"
    3.20  
    3.21 @@ -339,8 +339,7 @@
    3.22  		# Check if package is not installed
    3.23  		if [ ! -d "$installed/$pkg" ]; then
    3.24  			if [ ! -f "$pkgsdesc" ]; then
    3.25 -				#spk-up --list
    3.26 -				tazpkg recharge
    3.27 +				spk-up --list
    3.28  			fi
    3.29  			spk-add $pkg
    3.30  		fi
     4.1 --- a/spk-mirror	Wed May 23 21:31:14 2012 +0000
     4.2 +++ b/spk-mirror	Thu May 24 17:00:55 2012 +0200
     4.3 @@ -269,7 +269,7 @@
     4.4  				echo "$pkgsdir/" > $db/mirror
     4.5  				for list in packages.*
     4.6  				do
     4.7 -					echo $(gettext "Linking:") $list
     4.8 +					echo -n $(gettext "Linking:") $list
     4.9  					ln -s $pkgsdir/$list $db/$list
    4.10  					status
    4.11  				done