tazpkg view oldstuff/tazpkgbox @ rev 947

modules/get: get_pkg_cookmode(): file may be absent.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Mon Jun 05 22:36:04 2017 +0300 (2017-06-05)
parents 447bc4d63297
children
line source
1 #!/bin/sh
2 #
3 # GTKdialog interface to SliTaz Packages Manager aka Tazpkg. Note:
4 # Notebook tabs are <vbox>. Tabs are used to indent and functions are
5 # split and found in libtazpkgbox.
6 #
7 # (C) GNU gpl v3 - SliTaz GNU/Linux 2010-2011.
8 #
10 # Functions path.
11 export LIB=/usr/lib/slitaz/libtazpkgbox
13 # Tazpkgbox is only for root.
14 if test $(id -u) != 0 ; then
15 exec subox tazpkgbox
16 exit 0
17 fi
19 # Include gettext helper script.
20 . /usr/bin/gettext.sh
22 # Export package name for gettext.
23 TEXTDOMAIN='tazpkgbox'
24 export TEXTDOMAIN
26 # We need at least a mirror URL.
27 if [ ! -f /var/lib/tazpkg/mirror ]; then
28 tazpkg >/dev/null
29 fi
31 RELEASE=$(cat /etc/slitaz-release)
32 case "$1" in
33 dliso)
34 echo "Downloading packages-$RELEASE.iso into $2..."
35 cd $2
36 for i in $(cat /var/lib/tazpkg/mirror) ; do
37 wget ${i%packages*}/iso/$RELEASE/packages-$RELEASE.iso && break
38 done
39 exit 0;;
40 instiso)
41 PKGSIGN="LABEL=\"packages-$RELEASE\" TYPE=\"iso9660\""
42 PKGDEV=$(blkid $2 | grep "$PKGSIGN" | cut -d: -f1)
43 [ -z "$PKGDEV$2" -a -L /dev/cdrom ] && PKGDEV=$(blkid /dev/cdrom | grep "$PKGSIGN" | cut -d: -f1)
44 if [ -n "$PKGDEV" ]; then
45 mkdir /packages 2> /dev/null
46 mount -t iso9660 -o ro $PKGDEV /packages
47 /packages/install.sh
48 fi
49 exit 0;;
50 esac
51 # Tmp dir and files used to get pkgs info on the fly. Clean also
52 # lists and searches for files to load less data and have a faster start.
53 mkdir -p /tmp/tazpkgbox
54 echo "all" > /tmp/tazpkgbox/status
55 echo "all" > /tmp/tazpkgbox/category
56 echo "all" > /tmp/tazpkgbox/undigest-category
57 echo "" > /tmp/tazpkgbox/search
59 # English/French help dialog.
60 export HELP='
61 <window title="Tazpkgbox Help" icon-name="help">
62 <vbox>
63 <text use-markup="true" width-chars="54">
64 <label>"
65 <b>Tazpkgbox - Packages Manager Help</b>"
66 </label>
67 </text>
69 <frame English>
70 <text wrap="false">
71 <label>"
72 Tazpkgbox is a simple and easy to use interface to the SliTaz
73 package manager - aka Tazpkg. You can install, remove, repack or
74 get packages by double-clicking on the package item. A Search
75 engine allows you to find and install new applications in a few
76 mouse clicks."
77 </label>
78 </text>
79 </frame>
81 <frame Français>
82 <text wrap="false">
83 <label>"
84 Tazpkgbox est une interface graphique au gestionnaire de paquet
85 de SliTaz aka Tazpkg. Simple et facile à utiliser, vous pouvez
86 installer, télécharger ou supprimer des paquets en double-cliquant
87 sur sa ligne. La fonction de recherche permet de facilement trouver
88 et installer des logiciels ou fichiers."
89 </label>
90 </text>
91 </frame>
93 <hbox>
94 <button ok>
95 <action type="closewindow">HELP</action>
96 </button>
97 </hbox>
98 </vbox>
99 </window>
100 '
102 FILES="$2"
103 [ "$1" = "list_config" ] || FILES=""
105 export SETUP_DVD="
106 <window title=\"Packages archive\" icon-name=\"media-cdrom\">
107 <vbox>
108 <text use-markup=\"true\" width-chars=\"54\">
109 <label>\"
110 <b>Tazpkgbox - Packages Archive Manager</b>\"
111 </label>
112 </text>
113 <frame English>
114 <text wrap=\"false\">
115 <label>\"
116 An ISO image with all $(cat /etc/slitaz-release) packages is available on SliTaz mirrors.
117 You can burn it onto a DVD or install it on an USB key and each
118 package becomes installable without an Internet connection.\"
119 </label>
120 </text>
121 </frame>
123 <frame Français>
124 <text wrap=\"false\">
125 <label>\"
126 Une image ISO installable sur clé USB ou gravable sur DVD est
127 disponible sur les mirroirs SliTaz. Elle contient tous les paquets
128 de la version $(cat /etc/slitaz-release) pour pouvoir installer des paquets sans
129 connexion Internet.\"
130 </label>
131 </text>
132 </frame>
133 <frame>
134 <hbox>
135 <text use-markup=\"true\">
136 <label>\"<b>ISO image : </b>\"</label>
137 </text>
138 <entry>
139 <variable>PKGISO</variable>
140 </entry>
141 <button>
142 <input file stock=\"gtk-open\"></input>
143 <action type=\"fileselect\">PKGISO</action>
144 </button>
145 <button>
146 <label>Install ISO</label>
147 <input file icon=\"go-jump\"></input>
148 <action>xterm -T \"Install ISO\" -geometry 80x16+120+120 -e \"tazpkgbox instiso \$PKGISO; sleep 2\" 2>/dev/null</action>
149 <action>refresh:PKG</action>
150 <action>refresh:PKG_STATS</action>
151 <action>refresh:CACHE_STATS</action>
152 </button>
153 </hbox>
154 </frame>
155 <hbox>
156 <button>
157 <label>Download ISO</label>
158 <input file icon=\"system-software-update\"></input>
159 <action>xterm -T \"Download ISO\" -geometry 80x16+120+120 -e \"tazpkgbox dliso /tmp; sleep 2\" 2>/dev/null</action>
160 </button>
161 <button>
162 <input file icon=\"media-cdrom\"></input>
163 <label>Burn DVD</label>
164 <action>burnbox</action>
165 </button>
166 <button>
167 <label>Install DVD/USB key</label>
168 <input file icon=\"go-jump\"></input>
169 <action>xterm -T \"Install DVD/USB key\" -geometry 80x16+120+120 -e \"tazpkgbox instiso; sleep 2\" 2>/dev/null</action>
170 <action>refresh:PKG</action>
171 <action>refresh:PKG_STATS</action>
172 <action>refresh:CACHE_STATS</action>
173 </button>
174 <button>
175 <input file icon=\"gtk-close\"></input>
176 <action type=\"closewindow\">SETUP_DVD</action>
177 </button>
178 </hbox>
179 </vbox>
180 </window>
181 "
183 export LIST_CONFIG_FILES="
184 <window title=\"configuration files\" icon-name=\"system-file-manager\">
185 <vbox>
186 <tree exported_column=\"5\">
187 <width>560</width><height>160</height>
188 <variable>CONF_FILE</variable>
189 <label>Access | User | Group | Size | Update Date | Name</label>
190 <input>tazpkg list-config --box $FILES</input>
191 <action>leafpad \$CONF_FILE</action>
192 </tree>
193 <hbox>
194 <text wrap=\"false\">
195 <label>
196 \"Only files with Update Date have been modified after package installation\"
197 </label>
198 </text>
199 <button>
200 <input file icon=\"gtk-close\"></input>
201 <action type=\"closewindow\">INSTALLED_PACKAGE_ACTIONS</action>
202 </button>
203 </hbox>
204 </vbox>
205 </window>
206 "
207 if [ "$1" = "list_config" ]; then
208 gtkdialog --center --program=LIST_CONFIG_FILES >/dev/null
209 exit 0
210 fi
212 export SETUP_UNDIGEST='
213 <window title="undigest mirrors" icon-name="tazpkg">
214 <vbox>
215 <tree>
216 <width>560</width><height>160</height>
217 <variable>UNDIGEST_LIST</variable>
218 <label>Name | URL</label>
219 <input>tazpkg list-undigest --box</input>
220 <action>xterm -T "Remove undigest" -geometry 80x16+120+120 -e "tazpkg remove-undigest $UNDIGEST_LIST; sleep 2"</action>
221 </tree>
222 <hbox>
223 <text>
224 <label>URL:</label>
225 </text>
226 <entry>
227 <variable>UNDIGEST_URL</variable>
228 </entry>
229 </hbox>
230 <hbox>
231 <text>
232 <label>Name:</label>
233 </text>
234 <entry>
235 <variable>UNDIGEST_NAME</variable>
236 </entry>
237 <button>
238 <label>Add</label>
239 <input file icon="gtk-add"></input>
240 <action>tazpkg add-undigest "$UNDIGEST_NAME" $UNDIGEST_URL</action>
241 <action>refresh:UNDIGEST_LIST</action>
242 </button>
243 <button>
244 <label>Remove</label>
245 <input file icon="gtk-remove"></input>
246 <action>xterm -T "Remove undigest" -geometry 80x16+120+120 -e "tazpkg remove-undigest $UNDIGEST_NAME; sleep 2"</action>
247 <action>refresh:UNDIGEST_LIST</action>
248 </button>
249 <button>
250 <label>Update</label>
251 <input file icon="reload"></input>
252 <action>tazpkg setup-undigest "$UNDIGEST_NAME" $UNDIGEST_URL</action>
253 <action>refresh:UNDIGEST_LIST</action>
254 </button>
255 <button>
256 <input file icon="gtk-close"></input>
257 <action type="closewindow">SETUP_UNDIGEST</action>
258 </button>
259 </hbox>
260 </vbox>
261 </window>
262 '
264 # Scan notification
265 desktopbox notify "Scanning packages database" 6 &
267 # Main dialog
268 export TAZPKG_DIALOG='
269 <window title="SliTaz Packages Manager" icon-name="package-x-generic">
270 <vbox>