tazpkg rev 258

tazpkgbox: manage packages DVD
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Apr 21 15:19:51 2009 +0200 (2009-04-21)
parents ad9ce25a79dd
children c02154e1b4c5
files tazpkgbox
line diff
     1.1 --- a/tazpkgbox	Mon Apr 20 21:45:05 2009 +0200
     1.2 +++ b/tazpkgbox	Tue Apr 21 15:19:51 2009 +0200
     1.3 @@ -22,6 +22,26 @@
     1.4  	tazpkg >/dev/null
     1.5  fi
     1.6  
     1.7 +RELEASE=$(cat /etc/slitaz-release)
     1.8 +case "$1" in
     1.9 +dliso)
    1.10 +	echo "Downloading packages-$RELEASE.iso into $2..."
    1.11 +	cd $2
    1.12 +	for i in $(cat /var/lib/tazpkg/mirror) ; do
    1.13 +		wget ${i%packages*}/iso/$RELEASE/packages-$RELEASE.iso && break
    1.14 +	done
    1.15 +	exit 0;;
    1.16 +instiso)
    1.17 +	PKGSIGN="LABEL=\"packages-$RELEASE\" TYPE=\"iso9660\""
    1.18 +	PKGDEV=$(blkid $2 | grep "$PKGSIGN" | cut -d: -f1)
    1.19 +	[ -z "$PKGDEV$2" -a -L /dev/cdrom ] && PKGDEV=$(blkid /dev/cdrom | grep "$PKGSIGN" | cut -d: -f1)
    1.20 +	if [ -n "$PKGDEV" ]; then
    1.21 +		mkdir /packages 2> /dev/null
    1.22 +		mount -t iso9660 -o ro $PKGDEV /packages
    1.23 +		/packages/install.sh
    1.24 +	fi
    1.25 +	exit 0;;
    1.26 +esac
    1.27  # Tmp dir and files used to get pkgs info on the fly. Clean also
    1.28  # lists and searches for files to load less data and have a faster start.
    1.29  mkdir -p /tmp/tazpkgbox
    1.30 @@ -74,6 +94,85 @@
    1.31  
    1.32  FILES="$2"
    1.33  [ "$1" = "list_config" ] || FILES=""
    1.34 +
    1.35 +export SETUP_DVD="
    1.36 +<window title=\"Packages archive\" icon-name=\"media-cdrom\">
    1.37 +<vbox>
    1.38 +	<text use-markup=\"true\" width-chars=\"54\">
    1.39 +		<label>\"
    1.40 +<b>Tazpkgbox - Packages Archive Manager</b>\"
    1.41 +		</label>
    1.42 +	</text>
    1.43 +	<frame English>
    1.44 +		<text wrap=\"false\">
    1.45 +			<label>\"
    1.46 +An ISO image with all $(cat /etc/slitaz-release) packages is available on Slitaz mirrors.
    1.47 +You can burn it on a DVD or install it on an USB key and each
    1.48 +package becomes installable without Internet connexion.\"
    1.49 +			</label>
    1.50 +		</text>
    1.51 +	</frame>
    1.52 +
    1.53 +	<frame Français>
    1.54 +		<text wrap=\"false\">
    1.55 +			<label>\"
    1.56 +Une image ISO installable sur clé USB ou gravable sur DVD est 
    1.57 +disponible sur les mirroirs Slitaz. Elle contient tous les paquets
    1.58 +de la version $(cat /etc/slitaz-release) pour pouvoir installer des paquets sans
    1.59 +connexion Internet.\"
    1.60 +			</label>
    1.61 +		</text>
    1.62 +	</frame>
    1.63 +	<frame>
    1.64 +	<hbox>
    1.65 +		<text use-markup=\"true\">
    1.66 +			<label>\"<b>ISO image : </b>\"</label>
    1.67 +		</text>
    1.68 +		<entry>
    1.69 +			<variable>PKGISO</variable>
    1.70 +		</entry>
    1.71 +		<button>
    1.72 +			<input file stock=\"gtk-open\"></input>
    1.73 +			<action type=\"fileselect\">PKGISO</action>
    1.74 +		</button>
    1.75 +		<button>
    1.76 +			<label>Install ISO</label>
    1.77 +			<input file icon=\"go-jump\"></input>
    1.78 +			<action>xterm -T \"Install ISO\" -geometry 80x16+120+120 -e \"tazpkgbox instiso \$PKGISO; sleep 2\" 2>/dev/null</action>
    1.79 +			<action>refresh:PKG</action>
    1.80 +			<action>refresh:PKG_STATS</action>
    1.81 +			<action>refresh:CACHE_STATS</action>
    1.82 +		</button>
    1.83 +	</hbox>
    1.84 +	</frame>
    1.85 +	<hbox>
    1.86 +		<button>
    1.87 +			<label>Download ISO</label>
    1.88 +			<input file icon=\"system-software-update\"></input>
    1.89 +			<action>xterm -T \"Download ISO\" -geometry 80x16+120+120 -e \"tazpkgbox dliso /tmp; sleep 2\" 2>/dev/null</action>
    1.90 +		</button>
    1.91 +		<button>
    1.92 +			<input file icon=\"media-cdrom\"></input>
    1.93 +			<label>Burn DVD</label>
    1.94 +			<action>burnbox</action>
    1.95 +		</button>
    1.96 +		<button>
    1.97 +			<label>Install DVD/USB key</label>
    1.98 +			<input file icon=\"go-jump\"></input>
    1.99 +			<action>xterm -T \"Install DVD/USB key\" -geometry 80x16+120+120 -e \"tazpkgbox instiso; sleep 2\" 2>/dev/null</action>
   1.100 +			<action>refresh:PKG</action>
   1.101 +			<action>refresh:PKG_STATS</action>
   1.102 +			<action>refresh:CACHE_STATS</action>
   1.103 +		</button>
   1.104 +		<button>
   1.105 +			<input file icon=\"gtk-close\"></input>
   1.106 +			<action type=\"closewindow\">SETUP_DVD</action>
   1.107 +		</button>
   1.108 +	</hbox>
   1.109 +</vbox>
   1.110 +</window>
   1.111 +"
   1.112 +
   1.113  export LIST_CONFIG_FILES="
   1.114  <window title=\"configuration files\" icon-name=\"system-file-manager\">
   1.115    <vbox>
   1.116 @@ -362,6 +461,11 @@
   1.117  					<action>clear:MIRROR</action>
   1.118  					<action>refresh:MIRROR</action>
   1.119  				</button>
   1.120 +				<button>
   1.121 +					<input file icon="media-cdrom"></input>
   1.122 +					<label>DVD</label>
   1.123 +					<action type="launch">SETUP_DVD</action>
   1.124 +				</button>
   1.125  			</hbox>
   1.126  		</frame>
   1.127  		<hbox>