tazpkg rev 141

Show date of modified configuration files only
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Jul 28 19:26:09 2008 +0000 (2008-07-28)
parents a954c610e384
children 76d09109221b
files tazpkg tazpkgbox
line diff
     1.1 --- a/tazpkg	Mon Jul 28 09:39:57 2008 +0000
     1.2 +++ b/tazpkg	Mon Jul 28 19:26:09 2008 +0000
     1.3 @@ -1116,14 +1116,30 @@
     1.4  	list-config)
     1.5  		# List configuration files installed.
     1.6  		#
     1.7 -		echo ""
     1.8 -		echo -e "\033[1mConfiguration files"
     1.9 -		echo "================================================================================"
    1.10 -		for i in $INSTALLED/*/volatile.cpio.gz; do 
    1.11 -			zcat $i | cpio -t | grep -v "[0-9]* blocks"
    1.12 -		done | sed 's|^|/|' | sort
    1.13 -		echo "================================================================================"
    1.14 -		echo ""
    1.15 +		if [ "$2" = "--box" ]; then
    1.16 +			mkdir -p $TMP_DIR && cd $TMP_DIR
    1.17 +			for i in $INSTALLED/*/volatile.cpio.gz; do 
    1.18 +				zcat $i | cpio -id > /dev/null
    1.19 +				find * -type f | while read file; do
    1.20 +					echo -n "$(stat -c "%A|%U|%G|%s|" /$file)"
    1.21 +					cmp $file /$file > /dev/null 2>&1 || \
    1.22 +						echo -n "$(stat -c "%.16y" /$file)"
    1.23 +					echo "|/$file"
    1.24 +				done
    1.25 +				rm -rf *
    1.26 +			done | sed 's|  |  /|'
    1.27 +			cd $TOP_DIR
    1.28 +			rm -rf $TMP_DIR
    1.29 +		else
    1.30 +			echo ""
    1.31 +			echo -e "\033[1mConfiguration files"
    1.32 +			echo "================================================================================"
    1.33 +			for i in $INSTALLED/*/volatile.cpio.gz; do 
    1.34 +				zcat $i | cpio -t | grep -v "[0-9]* blocks"
    1.35 +			done | sed 's|^|/|' | sort
    1.36 +			echo "================================================================================"
    1.37 +			echo ""
    1.38 +		fi
    1.39  		;;
    1.40  	repack-config)
    1.41  		# Create SliTaz package archive from configuration files.
     2.1 --- a/tazpkgbox	Mon Jul 28 09:39:57 2008 +0000
     2.2 +++ b/tazpkgbox	Mon Jul 28 19:26:09 2008 +0000
     2.3 @@ -19,20 +19,6 @@
     2.4  	tazpkg >/dev/null
     2.5  fi
     2.6  
     2.7 -if [ "$1" == "call" ]; then
     2.8 -	case "$2" in
     2.9 -	list_config_files)
    2.10 -		tazpkg list-config | awk '
    2.11 -BEGIN { ls=0 } {
    2.12 -  if (/^===/) ls=1-ls;
    2.13 -  else if (ls) system("stat -c \"%A|%U|%G|%s|%.16y|%n\" " $0);
    2.14 -}'
    2.15 -		exit 0;;
    2.16 -	*) echo "Invalid argument";;
    2.17 -	esac
    2.18 -	exit 1
    2.19 -fi
    2.20 -
    2.21  # Tmp dir and files used to get pkgs infos on the fly. Clean also
    2.22  # list and search files to load less data and have a faster start.
    2.23  mkdir -p /tmp/tazpkgbox
    2.24 @@ -91,10 +77,13 @@
    2.25    <vbox>
    2.26  	<tree>
    2.27  		<width>630</width><height>160</height>
    2.28 -		<label>Access | User | Group | Size | Date | Name</label>
    2.29 -		<input> $0 call list_config_files </input>
    2.30 +		<label>Access | User | Group | Size | Update Date | Name</label>
    2.31 +		<input>tazpkg list-config --box</input>
    2.32  	</tree>
    2.33  	<hbox>
    2.34 +		<text wrap=\"false\">
    2.35 +			<label>\"Only files with Update Date have been modified after package installation\"</label>
    2.36 +		</text>
    2.37  		<button>
    2.38  			<input file icon=\"gtk-close\"></input>
    2.39  			<action type=\"closewindow\">INSTALLED_PACKAGE_ACTIONS</action>