spk rev 54

spk-add: use grep not egrep, spk enable --add option
author Christophe Lincoln <pankso@slitaz.org>
date Thu May 17 11:08:49 2012 +0200 (2012-05-17)
parents 917a909ee92b
children 5cba598bd418
files spk spk-add
line diff
     1.1 --- a/spk	Thu May 17 10:56:36 2012 +0200
     1.2 +++ b/spk	Thu May 17 11:08:49 2012 +0200
     1.3 @@ -130,8 +130,7 @@
     1.4  		# Handle: --options
     1.5  		case " $@ " in
     1.6  			*\ --add\ *)
     1.7 -				echo "TODO: test 'spk-add $pkg'"
     1.8 -				continue ;;
     1.9 +				spk-add $pkg && continue ;;
    1.10  		esac
    1.11  		count=$(($count + 1))
    1.12  		[ "$count" == 1 ] && newline
     2.1 --- a/spk-add	Thu May 17 10:56:36 2012 +0200
     2.2 +++ b/spk-add	Thu May 17 11:08:49 2012 +0200
     2.3 @@ -122,11 +122,11 @@
     2.4  	if [ -f $package_dir/files.list ]; then
     2.5  		for file in $(cat $package_dir/files.list)
     2.6  		do
     2.7 -			egrep -q "^$(echo $file | grepesc)$" $tmpdir/files.list && continue
     2.8 +			grep -q "^$(echo $file | grepesc)$" $tmpdir/files.list && continue
     2.9  			local modifiers=$(cat $package_dir/modifiers 2> /dev/null; \
    2.10  				fgrep -sl $package_dir */modifiers | cut -d/ -f1)
    2.11  			for i in modifiers; do
    2.12 -				egrep -qs "^$(echo $file | grepesc)$" $i/files.list && continue 2
    2.13 +				grep -qs "^$(echo $file | grepesc)$" $i/files.list && continue 2
    2.14  			done
    2.15  			files_to_remove="$files_to_remove $file"
    2.16  		done
    2.17 @@ -147,7 +147,7 @@
    2.18  	debug "check modified files"
    2.19  	for file in $file_list
    2.20  	do
    2.21 -		local filegrep=$(egrep ^${file}$ $installed/*/files.list)
    2.22 +		local filegrep=$(grep ^${file}$ $installed/*/files.list)
    2.23  		if [ "$filegrep" ]; then
    2.24  			local list=$(echo $filegrep | cut -d ":" -f 1)
    2.25  			for pkg_file in $list; do