tazpkg rev 139

rename save-config to repack-config, add list-config, update tazpkgbox
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Jul 28 09:20:59 2008 +0000 (2008-07-28)
parents d63ee20f2953
children a954c610e384
files tazpkg tazpkgbox
line diff
     1.1 --- a/tazpkg	Sun Jul 27 11:17:50 2008 +0000
     1.2 +++ b/tazpkg	Mon Jul 28 09:20:59 2008 +0000
     1.3 @@ -95,6 +95,7 @@
     1.4    info             Print information about a package.
     1.5    desc             Print description of a package (if it exists).
     1.6    list-files       List the files installed with a package.
     1.7 +  list-config      List the configuration files.
     1.8    search           Search for a package by pattern or name (options: -i|-l|-m).
     1.9    search-file	   Search for file(s) in all installed packages files.
    1.10    install          Install a local (*.tazpkg) package (--forced to force).
    1.11 @@ -104,7 +105,7 @@
    1.12    pack             Pack an unpacked or prepared package tree.
    1.13    recharge         Recharge your packages.list from the mirror.
    1.14    repack           Creates a package archive from an installed package.
    1.15 -  save-config      Creates a package archive with configuration files.
    1.16 +  repack-config    Creates a package archive with configuration files.
    1.17    upgrade          Upgrade all installed and listed packages on the mirror.
    1.18    block|unblock    Block an installed package version or unblock it for upgrade.
    1.19    get              Download a package into the current directory.
    1.20 @@ -1112,7 +1113,19 @@
    1.21  		echo "$PACKAGE is extracted to : $DESTDIR"
    1.22  		echo ""
    1.23  		;;
    1.24 -	save-config)
    1.25 +	list-config)
    1.26 +		# List configuration files installed.
    1.27 +		#
    1.28 +		echo ""
    1.29 +		echo -e "\033[1mConfiguration files"
    1.30 +		echo "================================================================================"
    1.31 +		for i in $INSTALLED/*/volatile.cpio.gz; do 
    1.32 +			zcat $i | cpio -t | grep -v "[0-9]* blocks"
    1.33 +		done | sed 's|^|/|' | sort
    1.34 +		echo "================================================================================"
    1.35 +		echo ""
    1.36 +		;;
    1.37 +	repack-config)
    1.38  		# Create SliTaz package archive from configuration files.
    1.39  		#
    1.40  		mkdir -p $TMP_DIR && cd $TMP_DIR
     2.1 --- a/tazpkgbox	Sun Jul 27 11:17:50 2008 +0000
     2.2 +++ b/tazpkgbox	Mon Jul 28 09:20:59 2008 +0000
     2.3 @@ -19,6 +19,20 @@
     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|%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 @@ -72,6 +86,24 @@
    2.25  </window>
    2.26  '
    2.27  
    2.28 +export LIST_CONFIG_FILES="
    2.29 +<window title=\"configuration files\" icon-name=\"system-file-manager\">
    2.30 +  <vbox>
    2.31 +	<tree>
    2.32 +		<width>600</width><height>160</height>
    2.33 +		<label>Access | User | Group | Size | Name</label>
    2.34 +		<input> $0 call list_config_files </input>
    2.35 +	</tree>
    2.36 +	<hbox>
    2.37 +		<button>
    2.38 +			<input file icon=\"gtk-close\"></input>
    2.39 +			<action type=\"closewindow\">INSTALLED_PACKAGE_ACTIONS</action>
    2.40 +		</button>
    2.41 +	</hbox>
    2.42 +  </vbox>
    2.43 +</window>
    2.44 +"
    2.45 +
    2.46  # Main dialog
    2.47  export TAZPKG_DIALOG='
    2.48  <window title="SliTaz Packages Manager" icon-name="package-x-generic">
    2.49 @@ -324,7 +356,7 @@
    2.50  				</button>
    2.51  			</hbox>
    2.52  		</frame>
    2.53 -		<frame Files path and packages check>
    2.54 +		<frame Files path, configuration files and packages check>
    2.55  			<hbox>
    2.56  				<text use-markup="true" width-chars="60">
    2.57  					<label>
    2.58 @@ -334,6 +366,16 @@
    2.59  			</hbox>
    2.60  			<hbox>
    2.61  				<button>
    2.62 +					<label>Repack config</label>
    2.63 +					<input file icon="edit-redo"></input>
    2.64 +					<action>xterm -fa MiscFixed -fs 11 -bg gray93 -fg black -T "Repack configs" -geometry 80x25+120+120 -e "tazpkg repack-config ; sleep 2" 2> /dev/null</action>
    2.65 +				</button>
    2.66 +				<button>
    2.67 +					<label>Config Files</label>
    2.68 +					<input file icon="tazpkg"></input>
    2.69 +					<action type="launch">LIST_CONFIG_FILES</action>
    2.70 +				</button>
    2.71 +				<button>
    2.72  					<label>Quick check</label>
    2.73  					<input file icon="go-next"></input>
    2.74  					<action>xterm -fa MiscFixed -fs 11 -bg gray93 -fg black -T "Check packages (q to quit)" -geometry 80x25+120+120 -e "tazpkg check | less " 2> /dev/null</action>