rev |
line source |
pascal@627
|
1 #!/bin/sh
|
pascal@627
|
2 #
|
al@633
|
3 # TazPkg CGI interface - Manage packages via a browser
|
pascal@627
|
4 #
|
pascal@627
|
5 # This CGI interface extensively uses tazpkg to manage packages and have
|
pascal@627
|
6 # its own code for some tasks. Please KISS, it is important and keep speed
|
pascal@627
|
7 # in mind. Thanks, Pankso.
|
pascal@627
|
8 #
|
al@755
|
9 # (C) 2011-2015 SliTaz GNU/Linux - BSD License
|
pascal@627
|
10 #
|
pascal@627
|
11
|
pascal@627
|
12 . lib/libtazpanel
|
al@725
|
13
|
al@725
|
14 . /etc/slitaz/slitaz.conf
|
al@725
|
15 . /etc/slitaz/tazpkg.conf
|
al@725
|
16
|
al@776
|
17 export TEXTDOMAIN='tazpkg'
|
al@776
|
18
|
pascal@627
|
19 get_config
|
pascal@627
|
20
|
al@741
|
21 _() { local T="$1"; shift; printf "$(gettext "$T")" "$@"; echo; }
|
al@741
|
22 _n() { local T="$1"; shift; printf "$(gettext "$T")" "$@"; }
|
al@741
|
23 _p() {
|
al@763
|
24 local S="$1" P="$2" N="$3"; shift 3;
|
al@741
|
25 printf "$(ngettext "$S" "$P" "$N")" "$@"; }
|
al@741
|
26
|
al@776
|
27
|
pascal@764
|
28 #------
|
pascal@764
|
29 # menu
|
pascal@764
|
30 #------
|
al@776
|
31
|
pascal@764
|
32 case "$1" in
|
pascal@764
|
33 menu)
|
pascal@764
|
34 TEXTDOMAIN_original=$TEXTDOMAIN
|
pascal@764
|
35 export TEXTDOMAIN='tazpkg'
|
pascal@764
|
36
|
pascal@764
|
37 cat <<EOT
|
pascal@764
|
38 <li tabindex="0">
|
pascal@764
|
39 <span>$(gettext 'Packages')</span>
|
pascal@764
|
40 <menu>
|
pascal@771
|
41 <li><a data-icon="info" href="pkgs.cgi">$(gettext 'Summary')</a></li>
|
pascal@771
|
42 <li><a data-icon="list" href="pkgs.cgi?list&my=my&cat=all&repo=Any">$(gettext 'My packages')</a></li>
|
pascal@771
|
43 <li><a data-icon="refresh" href="pkgs.cgi?recharge" data-root>$(gettext 'Recharge list')</a></li>
|
pascal@771
|
44 <li><a data-icon="upgrade" href="pkgs.cgi?up" data-root>$(gettext 'Check updates')</a></li>
|
pascal@771
|
45 <li><a data-icon="admin" href="pkgs.cgi?admin" data-root>$(gettext 'Administration')</a></li>
|
pascal@764
|
46 </menu>
|
pascal@764
|
47 </li>
|
pascal@764
|
48 EOT
|
pascal@764
|
49 export TEXTDOMAIN=$TEXTDOMAIN_original
|
pascal@764
|
50 exit
|
pascal@764
|
51 esac
|
pascal@764
|
52
|
al@776
|
53
|
al@707
|
54
|
al@786
|
55 #
|
al@776
|
56 # AJAX commands
|
al@786
|
57 #
|
al@776
|
58
|
al@776
|
59 case " $(GET) " in
|
al@776
|
60
|
al@776
|
61
|
al@776
|
62 *\ filelist\ * )
|
al@776
|
63 # Show installed files list
|
al@776
|
64 pkg=$(GET pkg)
|
al@776
|
65 cd $PKGS_DB
|
al@776
|
66
|
al@786
|
67 header
|
al@776
|
68 if [ -d $INSTALLED/$pkg ]; then
|
al@776
|
69 files="$(wc -l < $INSTALLED/$pkg/files.list)"
|
al@785
|
70 cat <<EOT
|
al@776
|
71 <pre class="scroll">$(sort $INSTALLED/$pkg/files.list)</pre>
|
al@776
|
72 <footer>$(_p '%s file' '%s files' $files $files)</footer>
|
al@776
|
73 EOT
|
al@776
|
74 else
|
al@785
|
75 cat <<EOT
|
al@776
|
76 <pre class="scroll">$(lzcat files.list.lzma undigest/*/files.list.lzma \
|
al@776
|
77 2>/dev/null | awk -vp="$pkg:" '$1==p{print $2}' | sort)</pre>
|
al@776
|
78 EOT
|
al@776
|
79 fi
|
al@776
|
80 exit 0 ;;
|
al@776
|
81
|
al@776
|
82
|
al@776
|
83 *\ status\ * )
|
al@776
|
84 # Show package status
|
al@776
|
85 pkg=$(GET pkg)
|
al@776
|
86 class='pkg'
|
al@776
|
87
|
al@778
|
88 if grep -q "^$pkg"$'\t' $PKGS_DB/installed.info; then
|
al@776
|
89 class='pkgi'
|
al@778
|
90 grep -q "^$pkg$" $PKGS_DB/blocked-packages.list && class='pkgib'
|
al@776
|
91 fi
|
al@776
|
92
|
al@786
|
93 header
|
al@779
|
94 echo -n "<a data-icon=\"$class\" href=\"?info=${pkg//+/%2B}\">$pkg</a>"
|
al@776
|
95 exit 0 ;;
|
al@776
|
96
|
al@788
|
97
|
al@786
|
98 *\ app_img\ * )
|
al@786
|
99 # Show application image
|
al@786
|
100 pkg=$(GET app_img)
|
al@788
|
101 if [ -f "$PKGS_DB/packages.icons" ]; then
|
al@788
|
102 predefined_icon="$(awk -F$'\t' -vpkg="$pkg" '{if ($1 == pkg) print $2}' $PKGS_DB/packages.icons)"
|
al@788
|
103 fi
|
al@788
|
104 predefined_icon="${predefined_icon:-package-x-generic}.png"
|
al@788
|
105
|
al@786
|
106 current_user="$(who | cut -d' ' -f1)"
|
al@786
|
107 if [ -n "$current_user" ]; then
|
al@786
|
108 current_user_home="$(awk -F: -vu=$current_user '{if($1==u) print $6}' /etc/passwd)"
|
al@786
|
109 current_icon_theme="/usr/share/icons/$(grep gtk-icon-theme-name $current_user_home/.gtkrc-2.0 | cut -d'"' -f2)"
|
al@788
|
110 default_pkg_icon="$(find -L $current_icon_theme -type f -path '*48*' -name $predefined_icon | head -n1)"
|
al@786
|
111 pkg_icon="$(find -L $current_icon_theme -type f -path '*48*' -name "$pkg.png" | head -n1)"
|
al@786
|
112 if [ -z "$pkg_icon" ]; then
|
al@786
|
113 pkg_icon="$(find -L /usr/share/pixmaps -type f -name "$pkg.png" | head -n1)"
|
al@786
|
114 fi
|
al@786
|
115
|
al@786
|
116 header "Content-Type: image/png"
|
al@786
|
117 cat "${pkg_icon:-$default_pkg_icon}"
|
al@786
|
118 else
|
al@788
|
119 default_pkg_icon="$(find -L /usr/share/icons -type f -name $predefined_icon | sort | tail -n1)"
|
al@786
|
120 fi
|
al@786
|
121 exit 0 ;;
|
al@786
|
122
|
al@788
|
123
|
al@786
|
124 *\ show_receipt\ * )
|
al@786
|
125 # Show package receipt
|
al@786
|
126 pkg=$(GET show_receipt)
|
al@786
|
127 if [ -d "$INSTALLED/$pkg" ]; then
|
al@786
|
128 # Redirects to the receipt view
|
al@786
|
129 header "HTTP/1.1 301 Moved Permanently" "Location: index.cgi?file=$INSTALLED/$pkg/receipt"
|
al@786
|
130 exit 0
|
al@786
|
131 else
|
al@786
|
132 temp_receipt=$(mktemp -d)
|
al@786
|
133 wget -O $temp_receipt/receipt -T 5 http://hg.slitaz.org/wok/raw-file/tip/$pkg/receipt
|
al@786
|
134 if [ -e "$temp_receipt" ]; then
|
al@786
|
135 # Redirects to the receipt view
|
al@786
|
136 header "HTTP/1.1 301 Moved Permanently" "Location: index.cgi?file=$temp_receipt/receipt"
|
al@786
|
137 exit 0
|
al@786
|
138 else
|
al@786
|
139 header; xhtml_header
|
al@786
|
140 msg err "$(_ 'Receipt for package %s unavailable' $pkg)"
|
al@786
|
141 xhtml_footer
|
al@786
|
142 exit 0
|
al@786
|
143 fi
|
al@786
|
144 fi
|
al@786
|
145 ;;
|
al@786
|
146
|
al@776
|
147 esac
|
al@776
|
148
|
al@776
|
149
|
al@786
|
150 header
|
al@786
|
151
|
al@786
|
152
|
pascal@627
|
153 # xHTML 5 header with special side bar for categories.
|
al@707
|
154 TITLE=$(TEXTDOMAIN='tazpkg'; _ 'TazPanel - Packages')
|
pascal@627
|
155 xhtml_header | sed 's/id="content"/id="content-sidebar"/'
|
pascal@627
|
156
|
al@707
|
157
|
al@761
|
158 pkg_info_link() {
|
al@758
|
159 echo "<a data-icon=\"$2\" href=\"?info=${1//+/%2B}\">$1</a>" | sed 's| data-icon=""||'
|
pascal@627
|
160 }
|
pascal@627
|
161
|
al@707
|
162
|
al@718
|
163 # Display localized short description
|
al@718
|
164
|
pascal@627
|
165 i18n_desc() {
|
al@717
|
166 for L in $LANG ${LANG%%_*}; do
|
al@717
|
167 if [ -e "$PKGS_DB/packages-desc.$L" ]; then
|
al@718
|
168 LOCDESC=$(awk -F$'\t' -vp=$1 '{if ($1 == p) print $2}' $PKGS_DB/packages-desc.$L)
|
al@717
|
169 if [ -n "$LOCDESC" ]; then
|
al@717
|
170 SHORT_DESC="$LOCDESC"
|
al@717
|
171 break
|
al@717
|
172 fi
|
al@717
|
173 fi
|
al@717
|
174 done
|
pascal@627
|
175 }
|
pascal@627
|
176
|
al@707
|
177
|
pascal@627
|
178 # We need packages information for list and search
|
al@707
|
179
|
pascal@627
|
180 parse_packages_desc() {
|
pascal@627
|
181 IFS="|"
|
al@762
|
182 cut -f 1,2,3 -d "|" | while read PACKAGE VERSION SHORT_DESC
|
pascal@627
|
183 do
|
al@718
|
184 class=pkg; [ -d $INSTALLED/${PACKAGE% } ] && class=pkgi
|
al@718
|
185 i18n_desc $PACKAGE
|
al@785
|
186 cat <<EOT
|
pascal@627
|
187 <tr>
|
al@755
|
188 <td><input type="checkbox" name="pkg" value="$PACKAGE">$(pkg_info_link $PACKAGE $class)</td>
|
al@755
|
189 <td>$VERSION</td>
|
al@755
|
190 <td>$SHORT_DESC</td>
|
al@718
|
191 </tr>
|
al@718
|
192 EOT
|
al@718
|
193 done
|
al@718
|
194 unset IFS
|
al@718
|
195 }
|
al@718
|
196
|
al@718
|
197
|
al@718
|
198 parse_packages_info() {
|
al@718
|
199 IFS=$'\t'
|
al@718
|
200 while read PACKAGE VERSION CATEGORY SHORT_DESC WEB_SITE TAGS SIZES DEPENDS; do
|
al@763
|
201 class='pkg'
|
al@763
|
202 if grep -q "^$PACKAGE"$'\t' $PKGS_DB/installed.info; then
|
al@763
|
203 class='pkgi'
|
al@763
|
204 grep -q "^$PACKAGE$" $PKGS_DB/blocked-packages.list && class='pkgib'
|
al@763
|
205 fi
|
al@718
|
206 i18n_desc $PACKAGE
|
al@785
|
207 cat <<EOT
|
al@718
|
208 <tr>
|
al@755
|
209 <td><input type="checkbox" name="pkg" value="$PACKAGE">$(pkg_info_link $PACKAGE $class)</td>
|
al@755
|
210 <td>$VERSION</td>
|
al@755
|
211 <td>$SHORT_DESC</td>
|
pascal@627
|
212 </tr>
|
pascal@627
|
213 EOT
|
pascal@627
|
214 done
|
pascal@627
|
215 unset IFS
|
pascal@627
|
216 }
|
pascal@627
|
217
|
al@707
|
218
|
al@724
|
219 # Show button
|
al@724
|
220 show_button() {
|
al@747
|
221 for button in $@; do
|
al@768
|
222 class=''; misc=''
|
al@747
|
223 case $button in
|
al@768
|
224 recharge) class='refresh'; label="$(_ 'Recharge list')"; misc=' data-root' ;;
|
al@768
|
225 up) class='upgrade'; label="$(_ 'Check upgrades')"; misc=' data-root' ;;
|
al@755
|
226 list) class='list'; label="$(_ 'My packages')" ;;
|
al@755
|
227 tags) class='tags'; label="$(_ 'Tags')" ;;
|
al@755
|
228 linkable) class='link'; label="$(_ 'Linkable packages')" ;;
|
al@768
|
229 admin) class='admin'; label="$(_ 'Administration')"; misc=' data-root' ;;
|
al@755
|
230 *Install*nf*) class='install'; label="$(_ 'Install (Non Free)')" ;;
|
al@755
|
231 *Install*) class='install'; label="$(_ 'Install')" ;;
|
al@755
|
232 *Remove*) class='remove'; label="$(_ 'Remove')" ;;
|
al@755
|
233 *Link*) class='link'; label="$(_ 'Link')" ;;
|
al@755
|
234 *Block*) class='lock'; label="$(_ 'Block')" ;;
|
al@755
|
235 *Unblock*) class='unlock'; label="$(_ 'Unblock')" ;;
|
al@762
|
236 *Chblock*) class='chlock'; label="$(_ '(Un)block')" ;;
|
al@755
|
237 *Repack*) class='repack'; label="$(_ 'Repack')" ;;
|
al@755
|
238 *saveconf*) class='save'; label="$(_ 'Save configuration')" ;;
|
al@755
|
239 *listconf*) class='list'; label="$(_ 'List configuration files')" ;;
|
al@755
|
240 *quickcheck*) class='check'; label="$(_ 'Quick check')" ;;
|
al@755
|
241 *fullcheck*) class='check'; label="$(_ 'Full check')" ;;
|
al@755
|
242 *clean*) class='remove'; label="$(_ 'Clean')" ;;
|
al@755
|
243 *setlink*) class='link'; label="$(_ 'Set link')" ;;
|
al@755
|
244 *removelink*) class='unlink'; label="$(_ 'Remove link')" ;;
|
al@755
|
245 *add-mirror) class='add'; label="$(_n 'Add mirror')" ;;
|
al@755
|
246 *add-repo) class='add'; label="$(_n 'Add repository')" ;;
|
al@762
|
247 toggle) class='toggle'; label="$(_n 'Toggle all')" ;;
|
al@747
|
248 esac
|
al@762
|
249 if [ "$button" == 'toggle' ]; then
|
al@762
|
250 echo -n "<span class=\"float-right\"><button data-icon=\"$class\" onclick=\"checkBoxes()\">$label</button></span>"
|
al@762
|
251 else
|
al@768
|
252 echo -n "<button data-icon=\"$class\" name=\"${button%%=*}\" value=\"${button#*=}\"$misc>$label</button>"
|
al@755
|
253 fi
|
al@747
|
254 done
|
al@724
|
255 }
|
al@724
|
256
|
al@724
|
257
|
al@707
|
258
|
pascal@627
|
259 #
|
pascal@627
|
260 # xHTML functions
|
pascal@627
|
261 #
|
pascal@627
|
262
|
al@707
|
263
|
pascal@627
|
264 # ENTER will search but user may search for a button, so put one.
|
al@707
|
265
|
pascal@627
|
266 search_form() {
|
al@785
|
267 cat <<EOT
|
al@755
|
268 <form class="search"><!--
|
al@755
|
269 --><input type="search" name="search" results="5" autosave="pkgsearch" autocomplete="on"><!--
|
al@755
|
270 --><button type="submit">$(_n 'Search')</button><!--
|
al@759
|
271 --><button name="files" value="yes">$(_n 'Files')</button><!--
|
al@755
|
272 --></form>
|
pascal@627
|
273 EOT
|
pascal@627
|
274 }
|
pascal@627
|
275
|
al@707
|
276
|
pascal@627
|
277 table_head() {
|
al@785
|
278 cat <<EOT
|
al@755
|
279 <table class="wide zebra pkglist" id="head1">
|
al@755
|
280 <thead id="head2">
|
pascal@627
|
281 <tr>
|
al@707
|
282 <td>$(_ 'Name')</td>
|
al@707
|
283 <td>$(_ 'Version')</td>
|
al@707
|
284 <td>$(_ 'Description')</td>
|
pascal@627
|
285 </tr>
|
al@736
|
286 </thead>
|
al@736
|
287 <tbody>
|
pascal@627
|
288 EOT
|
pascal@627
|
289 }
|
pascal@627
|
290
|
al@707
|
291
|
pascal@627
|
292 sidebar() {
|
al@744
|
293 repo=$(COOKIE repo); repo=${repo:-Public}; [ -n "$(GET repo)" ] && repo=$(GET repo)
|
al@744
|
294 my=$(COOKIE my); my=${my:-my}; [ -n "$(GET my)" ] && my=$(GET my)
|
al@744
|
295 cat=$(COOKIE cat); cat=${cat:-all}; [ -n "$(GET cat)" ] && cat=$(GET cat)
|
al@737
|
296
|
al@785
|
297 cat <<EOT
|
al@744
|
298 <script type="text/javascript">
|
al@744
|
299 function setCookie(name) {
|
al@763
|
300 if (name=='cat') {
|
al@763
|
301 var cats = document.getElementsByName('cat');
|
al@763
|
302 for (var i = 0; i < cats.length; i++) {
|
al@763
|
303 if (cats[i].checked) {
|
al@763
|
304 document.cookie = name + "=" + cats[i].value;
|
al@763
|
305 break;
|
al@763
|
306 }
|
al@763
|
307 }
|
al@763
|
308 } else {
|
al@763
|
309 document.cookie = name+"="+document.getElementById(name).value;
|
al@763
|
310 }
|
al@763
|
311 }
|
al@744
|
312 function setValue(name, value) {
|
al@744
|
313 document.getElementById(name).value=value;
|
al@763
|
314 setCookie(name);
|
al@763
|
315 }
|
al@744
|
316 </script>
|
al@788
|
317 <form method="post" action="?list" style="position: absolute">
|
al@737
|
318
|
pascal@627
|
319 <div id="sidebar">
|
al@744
|
320 <select id="my" value="$my" onchange="setCookie('my'); this.form.submit()">
|
al@738
|
321 <option value="my">$(_ 'My packages')</option>
|
al@741
|
322 <option value="no">$(_ 'All packages')</option>
|
al@737
|
323 </select>
|
al@763
|
324 <script type="text/javascript">setValue('my', "$my")</script>
|
al@737
|
325
|
al@737
|
326 <h4>$(_ 'Categories')</h4>
|
al@737
|
327
|
al@763
|
328 <div class="wide zebra">
|
al@763
|
329 $(echo 'base-system x-window utilities network games graphics office
|
al@763
|
330 multimedia development system-tools security misc meta non-free all
|
al@763
|
331 extra' | tr ' ' '\n' | awk -vcat="$cat" -vn="1" '{
|
al@763
|
332 system("gettext " $1 | getline tr)
|
al@763
|
333 printf "<input type=\"radio\" name=\"cat\" id=\"c%s\" ", n
|
al@763
|
334 printf "value=\"%s\"%s ", $1, $1==cat?" checked":""
|
al@763
|
335 printf "onclick=\"setCookie('cat'); this.form.submit()\">"
|
al@763
|
336 printf "<label for=\"c%s\">%s</label>\n", n, tr
|
al@763
|
337 n++
|
al@763
|
338 }')
|
al@738
|
339 </div>
|
pascal@627
|
340 EOT
|
pascal@783
|
341 #reminder; gettext 'all'; gettext 'extra'
|
pascal@627
|
342
|
al@700
|
343 if [ -d $PKGS_DB/undigest ]; then
|
al@785
|
344 cat <<EOT
|
al@737
|
345 <h4>$(_ 'Repository')</h4>
|
al@707
|
346
|
al@744
|
347 <select id="repo" onchange="setCookie('repo')">
|
al@738
|
348 <option value="Public">$(_ 'Public')</option>
|
al@737
|
349 $(for i in $(ls $PKGS_DB/undigest); do
|
al@738
|
350 echo "<option value=\"$i\">$i</option>"
|
al@737
|
351 done)
|
al@738
|
352 <option value="Any">$(_ 'Any')</option>
|
al@737
|
353 </select>
|
al@744
|
354 <script type="text/javascript">setValue('repo', "$repo")</script>
|
al@741
|
355 EOT
|
al@741
|
356 fi
|
al@785
|
357 cat <<EOT
|
al@755
|
358 <a data-icon="tags" href="?tags">$(_ 'All tags...')</a><br/>
|
al@755
|
359 <a data-icon="list" href="?cats">$(_ 'All categories...')</a>
|
al@741
|
360 </div>
|
al@742
|
361 </form>
|
pascal@627
|
362 EOT
|
pascal@627
|
363 }
|
pascal@627
|
364
|
al@707
|
365
|
pascal@627
|
366 repo_list() {
|
al@700
|
367 if [ -n "$(ls $PKGS_DB/undigest/ 2> /dev/null)" ]; then
|
pascal@627
|
368 case "$repo" in
|
al@707
|
369 Public)
|
al@707
|
370 ;;
|
al@707
|
371 ""|Any)
|
al@707
|
372 for i in $PKGS_DB/undigest/* ; do
|
al@707
|
373 [ -d "$i" ] && echo "$i$1"
|
al@707
|
374 done ;;
|
al@707
|
375 *)
|
al@707
|
376 echo "$PKGS_DB/undigest/$repo$1"
|
al@707
|
377 return ;;
|
pascal@627
|
378 esac
|
pascal@627
|
379 fi
|
al@700
|
380 echo "$PKGS_DB$1"
|
pascal@627
|
381 }
|
pascal@627
|
382
|
al@707
|
383
|
pascal@627
|
384 repo_name() {
|
pascal@627
|
385 case "$1" in
|
al@707
|
386 $PKGS_DB)
|
al@707
|
387 echo "Public" ;;
|
al@707
|
388 $PKGS_DB/undigest/*)
|
al@707
|
389 echo ${1#$PKGS_DB/undigest/} ;;
|
pascal@627
|
390 esac
|
pascal@627
|
391 }
|
pascal@627
|
392
|
al@726
|
393
|
al@744
|
394 header_repo_name() {
|
al@744
|
395 [ -d $PKGS_DB/undigest ] && [ "$repo" != "Public" ] && \
|
al@755
|
396 _ 'Repository: %s' $(repo_name $1)
|
al@744
|
397 }
|
al@744
|
398
|
al@744
|
399
|
al@726
|
400 # Print links to the pages
|
al@726
|
401
|
al@726
|
402 pager() {
|
al@747
|
403 PAGE_SIZE=${PAGE_SIZE:-100}
|
al@747
|
404 [ "$PAGE_SIZE" != "0" ] && \
|
al@747
|
405 awk -F'"' -vpage="$page" -vsize="$PAGE_SIZE" -vnum_lines="$(wc -l < $1)" -vtext="$(_ 'Pages:') " -vurl="?list&page=" '
|
al@726
|
406 BEGIN{
|
al@747
|
407 num_pages = int(num_lines / size) + (num_lines % size != 0)
|
al@726
|
408 if (num_pages != 1) printf "<p>%s", text
|
al@726
|
409 }
|
al@726
|
410 {
|
al@726
|
411 if (num_pages == 1) exit
|
al@747
|
412 r = NR % size
|
al@728
|
413 if (r == 1) {
|
al@747
|
414 p = int(NR / size) + 1
|
al@761
|
415 printf "<button class=\"pages%s\" name=\"page\" value=\"%s\" title=\"%s\n···\n", p==page?" current":"", p, $6
|
al@728
|
416 } else if (r == 0)
|
al@761
|
417 printf "%s\">%s</button> ", $6, int(NR / size)
|
al@726
|
418 }
|
al@726
|
419 END{
|
al@726
|
420 if (num_pages == 1) exit
|
al@761
|
421 if (r != 0) printf "%s\">%s</button>", $6, int(NR / size) + 1
|
al@726
|
422 print "</p>"
|
al@726
|
423 }' $1
|
al@726
|
424 }
|
al@726
|
425
|
al@726
|
426
|
al@736
|
427 # Show packages list by category or tag
|
al@736
|
428
|
al@736
|
429 show_list() {
|
al@747
|
430 PAGE_SIZE=${PAGE_SIZE:-100}
|
al@747
|
431 page=$(GET page); page=${page:-1}
|
al@736
|
432 cached=$(mktemp)
|
al@744
|
433 [ -n "$tag" ] && cat=''
|
al@736
|
434 {
|
al@736
|
435 for L in $LANG ${LANG%%_*}; do
|
al@736
|
436 if [ -e "$PKGS_DB/packages-desc.$L" ]; then
|
al@736
|
437 sed '/^#/d' $PKGS_DB/packages-desc.$L; break
|
al@736
|
438 fi
|
al@736
|
439 done
|
al@736
|
440 [ -e "$i/blocked-packages.list" ] && cat $i/blocked-packages.list
|
al@736
|
441 sed 's|.*|&\ti|' $i/installed.info
|
al@744
|
442 [ "$cat" == 'extra' ] || [ $1 == 'my' ] || cat $i/packages.info
|
pascal@760
|
443 [ "$cat" == 'extra' ] &&
|
pascal@760
|
444 sed 's,\([^|]*\)|*\([^|]*\).*,\1\t-\textra\t\2\thttp://mirror.slitaz.org/packages/get/\1\t-\t-\t-,' $PKGS_DB/extra.list
|
al@744
|
445 } | sort -t$'\t' -k1,1 | sed '/^$/d' | awk -F$'\t' -vc="${cat:--}" -vt="${tag:--}" '
|
al@736
|
446 {
|
al@736
|
447 if (PKG && PKG != $1) {
|
al@736
|
448 if (SEL) {
|
al@736
|
449 if (DSCL) DSC = DSCL
|
al@761
|
450 printf "<tr><td><input type=\"checkbox\" name=\"pkg\" value=\"%s\" id=\"%s\">", PKG, PKG
|
al@761
|
451 printf "<a data-icon=\"pkg%s%s\" href=\"?info=%s\">%s</a></td>", INS, BLK, gensub(/\+/, "%2B", "g", PKG), PKG
|
al@761
|
452 printf "<td>%s</td><td>%s</td><td><a href=\"%s\"></a></td></tr>\n", VER, DSC, WEB
|
al@736
|
453 }
|
al@736
|
454 VER = DSC = WEB = DSCL = INS = BLK = SEL = ""
|
al@736
|
455 }
|
al@736
|
456
|
al@736
|
457 PKG = $1
|
al@736
|
458 if (NF == 1) { BLK = "b"; next }
|
al@736
|
459 if (NF == 2) { DSCL = $2; next }
|
al@736
|
460 if (c == "all" || $3 == c || index(" "$6" ", " "t" ")) { SEL = 1 }
|
al@736
|
461 if (SEL) {
|
al@736
|
462 if ($9 == "i") { VER = $2; DSC = $4; WEB = $5; INS = "i"; next}
|
al@736
|
463 if (! INS) { VER = $2; DSC = $4; WEB = $5 }
|
al@736
|
464 }
|
al@736
|
465 }' > $cached
|
al@736
|
466
|
al@736
|
467 pager="$(pager $cached)"
|
al@747
|
468 case $PAGE_SIZE in
|
al@747
|
469 0) list="$(cat $cached)";;
|
al@747
|
470 *) list="$(tail -n+$((($page-1)*$PAGE_SIZE+1)) $cached | head -n$PAGE_SIZE)";;
|
al@747
|
471 esac
|
al@747
|
472
|
al@747
|
473 if [ "$pager" != "<p>$(_ 'Pages:') </p>" ] && [ -n "${list:1:1}" ]; then
|
al@785
|
474 cat <<EOT
|
al@755
|
475 <h3>$(header_repo_name $i)</h3>
|
al@744
|
476 $pager
|
al@744
|
477 $(table_head)
|
al@744
|
478 $list
|
al@744
|
479 </tbody></table>
|
al@744
|
480 $pager
|
al@744
|
481 EOT
|
al@737
|
482 fi
|
al@736
|
483 rm -f $cached
|
al@761
|
484
|
al@761
|
485
|
al@761
|
486 ### Re-select packages when you return to the page
|
al@761
|
487
|
al@761
|
488 # Find the packages list
|
al@761
|
489 pkgs=$(echo "$QUERY_STRING&" | awk 'BEGIN{RS="&";FS="="}
|
al@761
|
490 {if ($1=="pkg") printf "\"%s\", ", $2}')
|
al@761
|
491 pkgs=$(httpd -d "${pkgs%, }")
|
al@761
|
492 # now pkgs='"pkg1", "pkg2", ... "pkgn"'
|
al@761
|
493
|
al@761
|
494 if [ -n "$pkgs" ]; then
|
al@785
|
495 cat <<EOT
|
al@761
|
496 <script type="text/javascript">
|
al@761
|
497 var pkgs = [$pkgs];
|
al@761
|
498 var theForm = document.getElementById('pkglist');
|
al@761
|
499 for (index = 0; index < pkgs.length; index++) {
|
al@761
|
500 if (document.getElementById(pkgs[index])) {
|
al@761
|
501 // check existing
|
al@761
|
502 document.getElementById(pkgs[index]).checked = 'true';
|
al@761
|
503 }
|
al@761
|
504 else {
|
al@761
|
505 // add other as hidden
|
al@761
|
506 var hInput = document.createElement('input');
|
al@761
|
507 hInput.type = 'hidden';
|
al@761
|
508 hInput.name = 'pkg';
|
al@761
|
509 hInput.value = pkgs[index];
|
al@761
|
510 theForm.appendChild(hInput);
|
al@761
|
511 }
|
al@761
|
512 }
|
al@762
|
513 document.getElementById('countSelected').innerText = pkgs.length;
|
al@761
|
514 </script>
|
al@761
|
515 EOT
|
al@761
|
516 fi
|
al@736
|
517 }
|
al@736
|
518
|
al@736
|
519
|
al@727
|
520 # Show links for "info" page
|
al@727
|
521
|
al@727
|
522 show_info_links() {
|
al@727
|
523 if [ -n "$1" ]; then
|
al@778
|
524 if [ "$3" == 'tag' ]; then icon='tag'; else icon='clock'; fi
|
al@727
|
525 echo -n "<tr><td><b>$2</b></td><td>"
|
al@778
|
526 echo $1 | tr ' ' $'\n' | awk -vt="$3" -vi="$icon" '{
|
al@778
|
527 printf "<span><a data-icon=\"%s\" ", i;
|
al@778
|
528 printf "href=\"?%s=%s\">%s</a></span>Â Â ", t, gensub(/\+/, "%2B", "g", $1), $1
|
al@727
|
529 }'
|
al@727
|
530 echo "</td></tr>"
|
al@727
|
531 fi
|
al@727
|
532 }
|
al@727
|
533
|
al@727
|
534
|
al@707
|
535
|
pascal@627
|
536 #
|
pascal@627
|
537 # Commands
|
pascal@627
|
538 #
|
pascal@627
|
539
|
al@707
|
540
|
pascal@627
|
541 case " $(GET) " in
|
al@741
|
542
|
al@741
|
543
|
pascal@627
|
544 *\ linkable\ *)
|
pascal@627
|
545 #
|
pascal@627
|
546 # List linkable packages.
|
pascal@627
|
547 #
|
al@744
|
548 search_form; sidebar
|
al@744
|
549 LOADING_MSG=$(_ 'Listing linkable packages...'); loading_msg
|
al@744
|
550
|
al@785
|
551 cat <<EOT
|
al@707
|
552 <h2>$(_ 'Linkable packages')</h2>
|
pascal@627
|
553
|
al@755
|
554 <form class="wide">
|
al@755
|
555 $(_ 'Selection:') $(show_button do=Link)
|
pascal@627
|
556 EOT
|
al@736
|
557 table_head
|
al@700
|
558 target=$(readlink $PKGS_DB/fslink)
|
al@707
|
559 for pkg in $(ls $target/$INSTALLED); do
|
pascal@627
|
560 [ -s $pkg/receipt ] && continue
|
pascal@627
|
561 . $target/$INSTALLED/$pkg/receipt
|
al@718
|
562 i18n_desc $pkg
|
al@785
|
563 cat <<EOT
|
pascal@627
|
564 <tr>
|
al@758
|
565 <td><input type="checkbox" name="pkg" value="$pkg" /><a data-icon="pkg" href="?info=${pkg//+/%2B}">$pkg</a></td>
|
pascal@627
|
566 <td>$VERSION</td>
|
al@719
|
567 <td>$SHORT_DESC</td>
|
al@758
|
568 <td><a data-img="web" href="$WEB_SITE"></a></td>
|
pascal@627
|
569 </tr>
|
pascal@627
|
570 EOT
|
pascal@627
|
571 done
|
al@785
|
572 cat <<EOT
|
al@736
|
573 </tbody>
|
al@736
|
574 </table>
|
pascal@627
|
575 </form>
|
pascal@627
|
576 EOT
|
pascal@627
|
577 ;;
|
pascal@627
|
578
|
pascal@627
|
579
|
al@744
|
580 *\ cats\ *)
|
pascal@627
|
581 #
|
al@744
|
582 # List of all categories.
|
pascal@627
|
583 #
|
al@744
|
584 search_form; sidebar
|
al@744
|
585
|
al@744
|
586 echo "<h2>$(_ 'Categories list')</h2>"
|
al@744
|
587
|
al@744
|
588 for pkgsinfo in $(repo_list /packages.info); do
|
al@785
|
589 cat <<EOT
|
al@755
|
590 <section>
|
al@755
|
591 <header>$(header_repo_name $(dirname $pkgsinfo))</header>
|
al@755
|
592 <table class="wide zebra center">
|
al@755
|
593 <thead>
|
al@755
|
594 <tr>
|
al@755
|
595 <td>$(_ 'Category')</td>
|
al@755
|
596 <td>$(_ 'Available packages')</td>
|
al@755
|
597 <td>$(_ 'Installed packages')</td>
|
al@755
|
598 </tr>
|
al@755
|
599 </thead>
|
al@755
|
600 <tbody>
|
al@728
|
601 EOT
|
al@728
|
602 {
|
al@744
|
603 awk -F$'\t' '{print $3}' $pkgsinfo | sort | uniq -c
|
al@728
|
604 awk -F$'\t' '{print $3}' $PKGS_DB/installed.info | sed 's|.*|& i|' | sort | uniq -c
|
al@728
|
605 } | sort -k2,2 | awk '
|
al@728
|
606 {
|
al@728
|
607 c [$2] = "."
|
al@728
|
608 if ($3) { i[$2] = $1; } else { m[$2] = $1; }
|
al@728
|
609 }
|
al@728
|
610 END {
|
al@728
|
611 for (n in c) print n, m[n], i[n]
|
al@744
|
612 }' | sort | awk '{
|
al@744
|
613 printf "<tr><td><a href=\"?list&cat=%s\">%s</a></td><td>%d</td><td>%d</td></tr>", $1, $1, $2, $3
|
al@728
|
614 }'
|
al@785
|
615 cat <<EOT
|
al@755
|
616 </tbody>
|
al@755
|
617 </table>
|
al@755
|
618 </section>
|
al@755
|
619 EOT
|
al@744
|
620 done
|
al@744
|
621 ;;
|
al@744
|
622
|
al@744
|
623
|
al@761
|
624 *\ list\ *|*\ page\ *)
|
al@744
|
625 #
|
al@744
|
626 # List all packages by category.
|
al@744
|
627 #
|
al@744
|
628 search_form; sidebar
|
al@744
|
629 LOADING_MSG="$(_ 'Listing packages...')"; loading_msg
|
al@744
|
630
|
al@744
|
631 bcat="<b>$cat</b>"; brepo="<b>$repo</b>"
|
al@744
|
632 case $repo in
|
al@744
|
633 Any)
|
al@744
|
634 case $my in
|
al@744
|
635 my) title="$(_ 'Installed packages of category "%s"' "$bcat")" ;;
|
al@744
|
636 *) title="$(_ 'All packages of category "%s"' "$bcat")" ;;
|
al@744
|
637 esac ;;
|
al@744
|
638 *)
|
al@744
|
639 case $my in
|
al@744
|
640 my) title="$(_ 'Installed packages of category "%s" in repository "%s"' "$bcat" "$brepo")" ;;
|
al@744
|
641 *) title="$(_ 'All packages of category "%s" in repository "%s"' "$bcat" "$brepo")" ;;
|
al@744
|
642 esac ;;
|
al@744
|
643 esac
|
al@744
|
644
|
al@785
|
645 cat <<EOT
|
al@744
|
646 <h2>$(_ 'Packages list')</h2>
|
al@744
|
647 <p>$title</p>
|
pascal@627
|
648
|
pascal@764
|
649 EOT
|
al@782
|
650
|
al@782
|
651 [ ! -f $PKGS_DB/packages.info ] && msg warn \
|
al@782
|
652 "$(_ 'You can not view a list of all packages until recharging lists.')"
|
al@782
|
653
|
al@785
|
654 [ "$REMOTE_USER" == "root" ] && cat <<EOT
|
al@762
|
655 <section>
|
al@762
|
656 <div>$(_ 'Selected packages:') <span id="countSelected"></span></div>
|
al@762
|
657 <footer>
|
al@762
|
658 $({
|
al@762
|
659 [ "$my" != 'my' ] && show_button do=Install
|
al@762
|
660 show_button do=Chblock do=Remove
|
al@762
|
661 } | sed 's|button |button form="pkglist" |g')
|
al@762
|
662 $(show_button toggle)
|
al@762
|
663 </footer>
|
al@762
|
664 </section>
|
pascal@764
|
665 EOT
|
al@785
|
666 cat <<EOT
|
al@758
|
667
|
al@758
|
668 <form id="pkglist" class="wide">
|
pascal@627
|
669 EOT
|
al@744
|
670 for i in $(repo_list ""); do
|
al@744
|
671 show_list ${my#no}
|
al@744
|
672 done
|
al@785
|
673 cat <<EOT
|
al@755
|
674 </form>
|
al@762
|
675 <script type="text/javascript">window.onscroll = scrollHandler; setCountSelPkgs();</script>
|
al@755
|
676 EOT
|
al@728
|
677 ;;
|
pascal@627
|
678
|
pascal@627
|
679
|
pascal@627
|
680 *\ search\ *)
|
pascal@627
|
681 #
|
pascal@627
|
682 # Search for packages. Here default is to search in packages.desc
|
pascal@627
|
683 # and so get result including packages names and descriptions
|
pascal@627
|
684 #
|
al@725
|
685 pkg=$(GET search); [ -z "$pkg" ] && xhtml_footer && exit
|
al@718
|
686 cd $PKGS_DB
|
al@744
|
687
|
al@759
|
688 search_form | sed "s|name=\"search\"|& value=\"$pkg\"|"
|
al@759
|
689 sidebar
|
al@744
|
690 LOADING_MSG="$(_ 'Searching packages...')"; loading_msg
|
al@744
|
691
|
al@785
|
692 cat <<EOT
|
al@707
|
693 <h2>$(_ 'Search packages')</h2>
|
al@736
|
694
|
al@762
|
695 <section>
|
al@762
|
696 <div>$(_ 'Selected packages:') <span id="countSelected"></span></div>
|
al@762
|
697 <footer>
|
al@762
|
698 $(show_button do=Install do=Chblock do=Remove | sed 's|button |button form="pkglist" |g')
|
al@762
|
699 $(show_button toggle)
|
al@762
|
700 </footer>
|
al@762
|
701 </section>
|
al@758
|
702
|
al@758
|
703 <form id="pkglist" class="wide">
|
pascal@627
|
704 EOT
|
al@763
|
705 if [ -n "$(GET files)" -o -n "$(echo $pkg | grep '/')" ]; then
|
pascal@627
|
706 cat <<EOT
|
al@759
|
707 <table class="wide zebra filelist">
|
pascal@627
|
708 <thead>
|
pascal@627
|
709 <tr>
|
al@707
|
710 <td>$(_ 'Package')</td>
|
al@707
|
711 <td>$(_ 'File')</td>
|
pascal@627
|
712 </tr>
|
pascal@627
|
713 <thead>
|
pascal@627
|
714 <tbody>
|
pascal@627
|
715 EOT
|
al@718
|
716 lzcat $(repo_list /files.list.lzma) | grep -Ei ": .*$(GET search)" | \
|
al@718
|
717 while read PACKAGE FILE; do
|
al@718
|
718 PACKAGE=${PACKAGE%:}
|
al@763
|
719 class='pkg'
|
al@763
|
720 if [ -d $INSTALLED/$PACKAGE ]; then
|
al@763
|
721 class='pkgi'
|
al@763
|
722 grep -q "^$PACKAGE$" $PKGS_DB/blocked-packages.list && class='pkgib'
|
al@763
|
723 fi
|
al@785
|
724 cat <<EOT
|
pascal@627
|
725 <tr>
|
al@719
|
726 <td><input type="checkbox" name="pkg" value="$PACKAGE">$(pkg_info_link $PACKAGE $class)</td>
|
al@759
|
727 <td>$(echo "$FILE" | sed "s|$pkg|<span class=\"diff-add\">&</span>|gI")</td>
|
pascal@627
|
728 </tr>
|
pascal@627
|
729 EOT
|
al@718
|
730 done
|
pascal@627
|
731 else
|
al@718
|
732 table_head
|
al@718
|
733 awk -F$'\t' 'BEGIN{IGNORECASE = 1}
|
al@755
|
734 $1 " " $4 ~ /'$pkg'/{print $0}' $(repo_list /packages.info) | parse_packages_info
|
pascal@627
|
735 fi
|
al@785
|
736 cat <<EOT
|
pascal@627
|
737 </tbody>
|
pascal@627
|
738 </table>
|
pascal@627
|
739 </form>
|
al@762
|
740 <script type="text/javascript">window.onscroll = scrollHandler; setCountSelPkgs();</script>
|
pascal@627
|
741 EOT
|
pascal@627
|
742 ;;
|
pascal@627
|
743
|
pascal@627
|
744
|
pascal@627
|
745 *\ recharge\ *)
|
pascal@627
|
746 #
|
pascal@627
|
747 # Lets recharge the packages list
|
pascal@627
|
748 #
|
al@744
|
749 search_form; sidebar
|
al@744
|
750 LOADING_MSG="$(_ 'Recharging lists...')"; loading_msg
|
al@744
|
751
|
al@785
|
752 cat <<EOT
|
al@707
|
753 <h2>$(_ 'Recharge')</h2>
|
al@781
|
754 <p>$(_ 'Recharge checks for new or updated packages')</p>
|
pascal@627
|
755
|
al@781
|
756 <section>
|
al@781
|
757 <header>
|
al@781
|
758 $(_ 'Recharging log')
|
al@781
|
759 <form>$(show_button up)</form>
|
al@781
|
760 </header>
|
al@755
|
761
|
al@781
|
762 <pre class="scroll">
|
pascal@627
|
763 EOT
|
al@707
|
764 echo $(_ 'Recharging packages list') | log
|
pascal@627
|
765 tazpkg recharge | filter_taztools_msgs
|
al@785
|
766 cat <<EOT
|
al@781
|
767 </pre>
|
al@755
|
768
|
al@781
|
769 <footer>$(_ 'Packages lists are up-to-date. You should check for upgrades now.')</footer>
|
al@781
|
770 </section>
|
pascal@627
|
771 EOT
|
pascal@627
|
772 ;;
|
pascal@627
|
773
|
pascal@627
|
774
|
pascal@627
|
775 *\ up\ *)
|
pascal@627
|
776 #
|
pascal@627
|
777 # Upgrade packages
|
pascal@627
|
778 #
|
al@744
|
779 search_form; sidebar
|
al@744
|
780 LOADING_MSG="$(_ 'Checking for upgrades...')"; loading_msg
|
al@744
|
781
|
al@785
|
782 cat <<EOT
|
al@707
|
783 <h2>$(_ 'Up packages')</h2>
|
pascal@627
|
784
|
al@762
|
785 <section>
|
al@762
|
786 <div>$(_ 'Selected packages:') <span id="countSelected"></span></div>
|
al@762
|
787 <footer>
|
al@762
|
788 $(show_button do=Install do=Chblock do=Remove | sed 's|button |button form="pkglist" |g')
|
al@762
|
789 $(show_button toggle)
|
al@762
|
790 </footer>
|
al@762
|
791 </section>
|
al@758
|
792
|
al@758
|
793 <form id="pkglist" class="wide">
|
pascal@627
|
794 EOT
|
al@747
|
795 # Ask tazpkg to make "packages.up" file
|
pascal@627
|
796 tazpkg up --check >/dev/null
|
al@736
|
797 table_head
|
al@747
|
798
|
al@747
|
799 for pkg in $(cat $PKGS_DB/packages.up); do
|
al@747
|
800 grep -hs "^$pkg " $PKGS_DB/packages.info $PKGS_DB/undigest/*/packages.info | parse_packages_info
|
pascal@627
|
801 done
|
al@747
|
802
|
al@785
|
803 cat <<EOT
|
al@762
|
804 </tbody>
|
al@762
|
805 </table>
|
al@762
|
806 </form>
|
al@762
|
807 <script type="text/javascript">window.onscroll = scrollHandler; setCountSelPkgs();</script>
|
al@762
|
808 EOT
|
pascal@627
|
809 ;;
|
pascal@627
|
810
|
pascal@627
|
811
|
pascal@627
|
812 *\ do\ *)
|
pascal@627
|
813 #
|
pascal@627
|
814 # Do an action on one or some packages
|
pascal@627
|
815 #
|
al@744
|
816 search_form; sidebar
|
al@747
|
817 loading_msg
|
al@744
|
818
|
al@747
|
819 # Find the command
|
al@744
|
820 cmd=$(echo $(GET do) | tr [:upper:] [:lower:])
|
al@747
|
821
|
al@747
|
822 # Find the packages list
|
al@744
|
823 pkgs=$(echo $QUERY_STRING | awk 'BEGIN{RS="&";FS="="}{if($1=="pkg")print $2}')
|
al@744
|
824 pkgs=$(httpd -d "$pkgs")
|
al@747
|
825
|
al@747
|
826 # Describe the command
|
al@747
|
827 bpkgs="<b>$pkgs</b>"; opt=''
|
pascal@627
|
828 case $cmd in
|
al@762
|
829 install) MSG="$(_ 'Installing: %s' "$bpkgs")"; opt=--forced; cmd=get-install ;;
|
al@762
|
830 remove) MSG="$(_ 'Removing: %s' "$bpkgs")" ;;
|
al@762
|
831 link) MSG="$(_ 'Linking: %s' "$bpkgs")"; opt=$(readlink $PKGS_DB/fslink) ;;
|
al@762
|
832 block) MSG="$(_ 'Blocking: %s' "$bpkgs")" ;;
|
al@762
|
833 unblock) MSG="$(_ 'Unblocking: %s' "$bpkgs")" ;;
|
al@762
|
834 chblock) MSG="$(_ '(Un)blocking: %s' "$bpkgs")" ;;
|
al@762
|
835 repack) MSG="$(_ 'Repacking: %s' "$bpkgs")" ;;
|
pascal@627
|
836 esac
|
al@747
|
837
|
al@785
|
838 cat <<EOT
|
al@744
|
839 <h2>TazPkg: $(GET do)</h2>
|
al@784
|
840 <section>
|
al@784
|
841 <div>$MSG</div>
|
al@784
|
842 <pre class="scroll">
|
pascal@627
|
843 EOT
|
al@747
|
844 # Do the command for all asked packages
|
pascal@774
|
845 cd /tmp
|
al@707
|
846 for pkg in $pkgs; do
|
al@747
|
847 echo $(_n 'y') | tazpkg $cmd $pkg $opt 2>/dev/null | filter_taztools_msgs
|
al@784
|
848 done
|
al@784
|
849 echo '</pre></section>' ;;
|
pascal@627
|
850
|
pascal@627
|
851
|
pascal@627
|
852 *\ info\ *)
|
pascal@627
|
853 #
|
pascal@627
|
854 # Packages info
|
pascal@627
|
855 #
|
pascal@627
|
856 pkg=$(GET info)
|
al@744
|
857 search_form; sidebar
|
al@744
|
858 LOADING_MSG=$(_ 'Getting package info...'); loading_msg
|
al@744
|
859
|
al@785
|
860 cat <<EOT
|
al@755
|
861 <section>
|
al@755
|
862 <header>
|
al@755
|
863 $(_ 'Package %s' $pkg)
|
al@755
|
864 <form>
|
al@755
|
865 <input type="hidden" name="pkg" value="${pkg#get-}"/>
|
al@747
|
866 EOT
|
al@747
|
867
|
al@747
|
868 # Get receipt variables, show Install/Remove buttons
|
pascal@627
|
869 if [ -d $INSTALLED/$pkg ]; then
|
pascal@627
|
870 . $INSTALLED/$pkg/receipt
|
al@718
|
871 files=$(wc -l < $INSTALLED/$pkg/files.list)
|
pascal@767
|
872 [ "$REMOTE_USER" == "root" ] &&
|
al@747
|
873 show_button do=Remove
|
pascal@627
|
874 else
|
al@718
|
875 cd $PKGS_DB
|
al@727
|
876 eval "$(awk -F$'\t' -vp=$pkg '
|
al@727
|
877 $1==p{
|
al@727
|
878 printf "PACKAGE=\"%s\"; VERSION=\"%s\"; CATEGORY=\"%s\"; ", $1, $2, $3
|
al@727
|
879 printf "SHORT_DESC=\"%s\"; WEB_SITE=\"%s\"; TAGS=\"%s\"; ", $4, $5, $6
|
al@727
|
880 printf "SIZES=\"%s\"; DEPENDS=\"%s\"", $7, $8
|
al@727
|
881 }' packages.info undigest/*/packages.info)"
|
al@727
|
882 PACKED_SIZE=${SIZES% *}
|
al@727
|
883 UNPACKED_SIZE=${SIZES#* }
|
pascal@767
|
884 [ "$REMOTE_USER" == "root" ] &&
|
al@747
|
885 if [ "${pkg#get-}" != "$pkg" ]; then
|
al@747
|
886 show_button "do=Install&nf"
|
al@747
|
887 else
|
al@747
|
888 show_button do=Install
|
al@747
|
889 fi
|
pascal@627
|
890 fi
|
pascal@627
|
891
|
al@747
|
892 # Show Block/Unblock, and Repack buttons
|
pascal@767
|
893 [ "$REMOTE_USER" == "root" ] &&
|
pascal@627
|
894 if [ -d $INSTALLED/$pkg ]; then
|
al@700
|
895 if grep -qs "^$pkg$" $PKGS_DB/blocked-packages.list; then
|
al@744
|
896 show_button do=Unblock
|
pascal@627
|
897 else
|
al@744
|
898 show_button do=Block
|
pascal@627
|
899 fi
|
al@744
|
900 show_button do=Repack
|
pascal@627
|
901 fi
|
al@747
|
902
|
al@747
|
903 # Translate short description
|
al@718
|
904 i18n_desc $pkg
|
al@747
|
905
|
al@747
|
906 # Show info table
|
al@785
|
907 cat <<EOT
|
al@755
|
908 </form>
|
al@755
|
909 </header>
|
al@755
|
910
|
al@786
|
911 <table class="wide summary">
|
al@786
|
912 <tr><td id="appImg"><img src="pkgs.cgi?app_img=$PACKAGE"/></td><td>
|
al@778
|
913 <table class="wide zebra summary" id="infoTable">
|
pascal@627
|
914 <tbody>
|
al@707
|
915 <tr><td><b>$(_ 'Name')</b></td><td>$PACKAGE</td></tr>
|
al@707
|
916 <tr><td><b>$(_ 'Version')</b></td><td>$VERSION</td></tr>
|
al@758
|
917 <tr><td><b>$(_ 'Category')</b></td><td><a href="?list&cat=$CATEGORY">$CATEGORY</a></td></tr>
|
al@707
|
918 <tr><td><b>$(_ 'Description')</b></td><td>$SHORT_DESC</td></tr>
|
al@727
|
919 $([ -n "$MAINTAINER" ] && echo "<tr><td><b>$(_ 'Maintainer')</b></td><td>$MAINTAINER</td></tr>")
|
al@727
|
920 $([ -n "$LICENSE" ] && echo "<tr><td><b>$(_ 'License')</b></td><td><a href=\"?license=$pkg\">$LICENSE</a></td></tr>")
|
al@747
|
921 <tr><td><b>$(_ 'Website')</b></td><td><a href="$WEB_SITE" target="_blank">$WEB_SITE</a></td></tr>
|
al@727
|
922 $(show_info_links "$TAGS" "$(_ 'Tags')" 'tag')
|
al@788
|
923 <tr><td><b>$(_ 'Sizes')</b></td><td>${PACKED_SIZE/.0/}/${UNPACKED_SIZE/.0/}</td></tr>
|
al@727
|
924 $(show_info_links "$DEPENDS" "$(_ 'Depends')" 'info')
|
al@727
|
925 $(show_info_links "$SUGGESTED" "$(_ 'Suggested')" 'info')
|
pascal@627
|
926 </tbody>
|
pascal@627
|
927 </table>
|
al@786
|
928 </td></tr></table>
|
al@786
|
929
|
al@786
|
930 <footer>
|
al@786
|
931 <a data-icon="text" href="?show_receipt=$pkg">$(_ 'View receipt')</a>
|
al@786
|
932 <a data-icon="slitaz" href="?improve=$pkg">$(_ 'Improve package')</a>
|
al@786
|
933 </footer>
|
al@755
|
934 </section>
|
al@778
|
935 <span id="ajaxStatus" style="display:none"></span>
|
al@778
|
936
|
al@778
|
937 <script type="text/javascript">
|
al@778
|
938 var links = document.getElementById('infoTable').getElementsByTagName('a');
|
al@778
|
939 for (var i = 0; i < links.length; i++) {
|
al@778
|
940 console.log('i=%s, icon=%s.', i, links[i].dataset.icon);
|
al@778
|
941 if (links[i].dataset.icon == 'clock') {
|
al@778
|
942 links[i].parentNode.id = 'link' + i;
|
al@778
|
943 pkg = links[i].innerText.replace(/\+/g, '%2B');
|
al@778
|
944 ajax('pkgs.cgi?status&pkg=' + pkg, '1', 'link' + i);
|
al@778
|
945 }
|
al@778
|
946 }
|
al@778
|
947
|
al@778
|
948 </script>
|
al@717
|
949 EOT
|
al@747
|
950
|
al@747
|
951 # Show description
|
al@727
|
952 DESC="$(tazpkg desc $pkg)"
|
al@778
|
953 [ -n "$DESC" ] && echo "<section><pre class="pre-wrap">$DESC</pre></section>"
|
pascal@627
|
954
|
al@747
|
955 # Show configuration files list
|
al@747
|
956 CONFIGS="$(tazpkg list-config $pkg | sed 's|\(.*\)|\1 \1|')"
|
al@785
|
957 [ -n "$CONFIGS" ] && cat <<EOT
|
al@755
|
958 <section>
|
al@755
|
959 <header>$(_ 'Configuration files')</header>
|
al@755
|
960 <pre>$(printf '<a href="index.cgi?file=%s">%s</a>\n' $CONFIGS)</pre>
|
al@755
|
961 </section>
|
al@755
|
962 EOT
|
al@747
|
963
|
al@747
|
964 # Show installed files list
|
al@781
|
965 pkg=${pkg//+/%2B}
|
al@776
|
966 cat <<EOT
|
al@755
|
967 <section>
|
al@776
|
968 <header>$(_ 'Installed files')</header>
|
al@776
|
969 <span id="fileList">
|
al@776
|
970 <div style="text-align: center;"><span id="ajaxStatus"></span>$(_ 'Please wait')</div>
|
al@776
|
971 </span>
|
al@755
|
972 </section>
|
al@776
|
973 <script type="text/javascript">ajax('pkgs.cgi?filelist&pkg=$pkg', '1', 'fileList');</script>
|
pascal@627
|
974 EOT
|
pascal@627
|
975 ;;
|
pascal@627
|
976
|
pascal@627
|
977
|
pascal@627
|
978 *\ admin\ * )
|
pascal@627
|
979 #
|
al@633
|
980 # TazPkg configuration page
|
pascal@627
|
981 #
|
pascal@627
|
982 cmd=$(GET admin)
|
al@747
|
983 pager="$(GET pager)"; pager=${pager:-$PAGE_SIZE}; pager=${pager:-100}
|
al@747
|
984 mirror="$(GET mirror)"; mirror="${mirror%/}/"
|
al@747
|
985 repository="$PKGS_DB/undigest/$(GET repository)"
|
al@747
|
986 link="$(GET link)"; link=${link%/}
|
al@744
|
987 search_form; sidebar
|
al@747
|
988 loading_msg
|
al@744
|
989
|
pascal@627
|
990 case "$cmd" in
|
pascal@627
|
991 clean)
|
al@725
|
992 rm -rf $CACHE_DIR/* ;;
|
pascal@627
|
993 add-mirror)
|
al@747
|
994 echo "$mirror" >> $(GET file) ;;
|
al@747
|
995 rm-mirror)
|
al@747
|
996 sed -i "/^"$(echo $mirror | sed 's|/|\\/|g')"$/d" $(GET file) ;;
|
al@747
|
997 select-mirror)
|
al@747
|
998 tazpkg setup-mirror "${mirror}packages/$(cat /etc/slitaz-release)/" | log ;;
|
pascal@627
|
999 add-repo)
|
al@747
|
1000 mkdir -p $repository
|
al@747
|
1001 echo "$mirror" > $repository/mirror
|
al@747
|
1002 echo "$mirror" > $repository/mirrors ;;
|
al@747
|
1003 rm-repo)
|
al@747
|
1004 rm -rf $repository ;;
|
al@744
|
1005 setlink)
|
al@747
|
1006 [ -d "$link/$INSTALLED" ] && ln -fs $link $PKGS_DB/fslink ;;
|
al@744
|
1007 removelink)
|
al@744
|
1008 rm -f $PKGS_DB/fslink ;;
|
al@747
|
1009 pager)
|
al@747
|
1010 TP_CONF=/etc/slitaz/tazpanel.conf
|
al@747
|
1011 if [ -z "$PAGE_SIZE" ]; then
|
al@747
|
1012 echo -e "\n# Size of packages list page\nPAGE_SIZE=\"$pager\"" >> $TP_CONF
|
al@747
|
1013 else
|
al@747
|
1014 sed -i "s|PAGE_SIZE=.*|PAGE_SIZE=\"$pager\"|" $TP_CONF
|
al@747
|
1015 fi ;;
|
pascal@627
|
1016 esac
|
al@736
|
1017
|
al@785
|
1018 cat <<EOT
|
al@707
|
1019 <h2>$(_ 'Administration')</h2>
|
al@742
|
1020
|
al@747
|
1021 <p>$(_ 'TazPkg administration and settings')</p>
|
al@747
|
1022
|
al@755
|
1023 <form id="actions">
|
al@755
|
1024 <input type="hidden" name="admin"/>
|
al@747
|
1025 $(show_button action=saveconf action=listconf action=quickcheck action=fullcheck)
|
al@742
|
1026 </form>
|
pascal@627
|
1027 EOT
|
pascal@627
|
1028 case "$(GET action)" in
|
al@747
|
1029 saveconf)
|
al@747
|
1030 LOADING_MSG=$(_ 'Creating the package...'); loading_msg
|
al@747
|
1031 echo "<pre>"
|
al@747
|
1032 cd /tmp
|
al@747
|
1033 tazpkg repack-config | filter_taztools_msgs
|
al@747
|
1034 echo -n "$(_ 'Path:') "; ls /tmp/config-*.tazpkg
|
al@747
|
1035 echo "</pre>" ;;
|
al@747
|
1036 listconf)
|
al@747
|
1037 echo "<h4>$(_ 'Configuration files')</h4>"
|
al@747
|
1038 echo "<ul>"
|
al@747
|
1039 tazpkg list-config | while read file; do
|
al@747
|
1040 if [ -e $file ]; then
|
al@747
|
1041 echo "<li><a href=\"index.cgi?file=$file\">$file</a></li>"
|
al@747
|
1042 else
|
al@747
|
1043 echo "<li>$file</li>"
|
al@747
|
1044 fi
|
al@747
|
1045 done
|
al@747
|
1046 echo "</ul>" ;;
|
al@747
|
1047 quickcheck)
|
al@747
|
1048 LOADING_MSG=$(_ 'Checking packages consistency...'); loading_msg
|
al@747
|
1049 echo "<pre>"
|
al@747
|
1050 tazpkg check
|
al@747
|
1051 echo "</pre>" ;;
|
al@747
|
1052 fullcheck)
|
al@747
|
1053 LOADING_MSG=$(_ 'Full packages check...'); loading_msg
|
al@747
|
1054 echo "<pre>"
|
al@747
|
1055 tazpkg check --full
|
al@747
|
1056 echo "</pre>" ;;
|
al@747
|
1057 dvdimage)
|
al@747
|
1058 dev=$(POST dvdimage)
|
al@747
|
1059 mkdir -p /mnt/packages 2> /dev/null
|
al@747
|
1060 echo "<pre>"
|
al@747
|
1061 mount -t iso9660 -o loop,ro $dev /mnt/packages &&
|
al@747
|
1062 /mnt/packages/install.sh &&
|
al@747
|
1063 _ '%s is installed on /mnt/packages' $dev
|
al@747
|
1064 echo "</pre>" ;;
|
al@747
|
1065 dvdusbkey)
|
al@747
|
1066 mkdir -p /mnt/packages 2> /dev/null
|
al@747
|
1067 for tag in "LABEL=\"packages-$version\" TYPE=\"iso9660\"" \
|
al@747
|
1068 "LABEL=\"sources-$version\" TYPE=\"iso9660\"" ; do
|
al@747
|
1069 dev=$(blkid | grep "$tag" | cut -d: -f1)
|
al@747
|
1070 [ -n "$dev" ] || continue
|
pascal@627
|
1071 echo "<pre>"
|
al@747
|
1072 mount -t iso9660 -o ro $dev /mnt/packages &&
|
al@747
|
1073 /mnt/packages/install.sh &&
|
al@747
|
1074 _ '%s is installed on /mnt/packages' $dev
|
al@747
|
1075 echo "</pre>"
|
al@747
|
1076 break
|
al@747
|
1077 done ;;
|
al@747
|
1078 esac
|
al@744
|
1079
|
al@747
|
1080 cache_files=$(find $CACHE_DIR -name '*.tazpkg' | wc -l)
|
al@744
|
1081 cache_size=$(du -sh $CACHE_DIR | cut -f1 | sed 's|\.0||')
|
al@744
|
1082 [ "$cache_files" == 0 ] && cache_size="0K"
|
al@747
|
1083 mirror=$(cat $PKGS_DB/mirror)
|
al@747
|
1084 default_mirror=${mirror%/packages/*}
|
al@785
|
1085 cat <<EOT
|
al@755
|
1086 <section>
|
al@755
|
1087 <header>$(_ 'Packages cache')</header>
|
al@755
|
1088 <form class="wide">
|
al@755
|
1089 <div>$(_ 'Packages in the cache: %s (%s)' $cache_files $cache_size)</div>
|
al@755
|
1090 <footer>$(show_button admin=clean)</footer>
|
al@755
|
1091 </form>
|
al@755
|
1092 </section>
|
pascal@627
|
1093
|
pascal@627
|
1094
|
al@755
|
1095 <section>
|
al@755
|
1096 <header>$(_ 'Current mirror list')</header>
|
pascal@627
|
1097 EOT
|
al@747
|
1098
|
al@747
|
1099 # List mirrors
|
al@747
|
1100 version=$(cat /etc/slitaz-release)
|
al@700
|
1101 for i in $PKGS_DB/mirrors $PKGS_DB/undigest/*/mirrors; do
|
pascal@627
|
1102 [ -s $i ] || continue
|
al@700
|
1103 if [ $i != $PKGS_DB/mirrors ]; then
|
al@747
|
1104 echo "<h4>$(_ 'Repository: %s' "$(repo_name $(dirname $i))")</h4>"
|
pascal@627
|
1105 fi
|
al@785
|
1106 cat <<EOT
|
al@755
|
1107 <form class="wide">
|
al@755
|
1108 <input type="hidden" name="admin" value="select-mirror"/>
|
al@755
|
1109 <table class="wide zebra">
|
al@747
|
1110 EOT
|
al@747
|
1111 while read line; do
|
al@785
|
1112 cat <<EOT
|
al@755
|
1113 <tr>
|
al@755
|
1114 <td>
|
al@755
|
1115 <input type="radio" name="mirror" id="$line" value="$line" onchange="this.form.submit()"
|
al@755
|
1116 $([ "$line" == "$default_mirror/" ] && echo -n 'checked="checked"')>
|
al@755
|
1117 <label for="$line"><code>$line</code></label></td>
|
al@755
|
1118 <td><a data-img="web" href="$line" target="_blank"></a></td>
|
al@755
|
1119 <td><a data-img="remove" href="?admin=rm-mirror&mirror=$line&file=$i" title="$(_ 'Delete')"></a></td>
|
al@755
|
1120 </tr>
|
al@747
|
1121 EOT
|
al@747
|
1122 done < $i
|
al@785
|
1123 cat <<EOT
|
al@755
|
1124 </table>
|
al@755
|
1125 </form>
|
al@747
|
1126
|
al@755
|
1127 <form class="wide">
|
al@755
|
1128 <footer>
|
al@755
|
1129 <input type="hidden" name="file" value="$i" />
|
al@755
|
1130 <input type="text" name="mirror" size="40" />
|
al@755
|
1131 $(show_button admin=add-mirror)
|
al@755
|
1132 </footer>
|
al@755
|
1133 </form>
|
pascal@627
|
1134 EOT
|
pascal@627
|
1135 done
|
al@785
|
1136 cat <<EOT
|
al@755
|
1137 </section>
|
al@755
|
1138
|
al@755
|
1139
|
al@755
|
1140 <section>
|
al@755
|
1141 <header>$(_ 'Private repositories')</header>
|
al@755
|
1142 EOT
|
al@747
|
1143 if [ -n "$(ls $PKGS_DB/undigest 2> /dev/null)" ]; then
|
al@785
|
1144 cat <<EOT
|
al@755
|
1145 <table class="wide zebra">
|
al@755
|
1146 EOT
|
al@747
|
1147 ls $PKGS_DB/undigest 2> /dev/null | while read repo ; do
|
al@747
|
1148 cat <<EOT
|
al@755
|
1149 <tr>
|
al@755
|
1150 <td><code>$repo</code></td>
|
al@755
|
1151 <td><a data-img="remove" href="?admin=rm-repo&repository=$repo" title="$(_ 'Delete')"></a></td>
|
al@755
|
1152 </tr>
|
pascal@627
|
1153 EOT
|
al@747
|
1154 done
|
al@785
|
1155 cat <<EOT
|
al@755
|
1156 </table>
|
al@755
|
1157 EOT
|
al@747
|
1158 fi
|
al@747
|
1159
|
al@785
|
1160 cat <<EOT
|
al@755
|
1161 <form class="wide">
|
al@755
|
1162 <table>
|
al@755
|
1163 <tr><td>$(_ 'Name')</td><td><input type="text" name="repository" size="10"/></td></tr>
|
al@755
|
1164 <tr><td>$(_ 'URL:')</td><td><input type="text" name="mirror" value="http://"></td></tr>
|
al@755
|
1165 </table>
|
al@755
|
1166 <footer>
|
al@755
|
1167 $(show_button admin=add-repo)
|
al@755
|
1168 </footer>
|
al@755
|
1169 </form>
|
al@755
|
1170 </section>
|
pascal@627
|
1171
|
al@747
|
1172
|
al@755
|
1173 <section>
|
al@755
|
1174 <header>$(_ 'Link to another SliTaz installation')</header>
|
al@755
|
1175 <form class="wide">
|
al@755
|
1176 <div>
|
al@755
|
1177 $(_ "This link points to the root of another SliTaz installation. You will be able to install packages using soft links to it.")
|
al@755
|
1178 </div>
|
al@755
|
1179 <input type="text" name="link" value="$(readlink $PKGS_DB/fslink 2> /dev/null)"/>
|
al@755
|
1180 <footer>
|
al@755
|
1181 $(show_button admin=setlink admin=removelink)
|
al@755
|
1182 </footer>
|
al@755
|
1183 </form>
|
al@755
|
1184 </section>
|
pascal@627
|
1185
|
pascal@627
|
1186
|
al@755
|
1187 <section>
|
al@755
|
1188 <header id="dvd">$(_ 'SliTaz packages DVD')</header>
|
pascal@627
|
1189
|
al@755
|
1190 <div>
|
al@755
|
1191 $(_ "A bootable DVD image of all available packages for the %s version is generated every day. It also contains a copy of the website and can be used without an internet connection. This image can be installed on a DVD or a USB key." $version)
|
al@747
|
1192
|
al@755
|
1193 <form method="post" action='?admin&action=dvdimage'>
|
al@755
|
1194 $(_ 'Install from ISO image:')
|
al@755
|
1195 <input type="text" name="dvdimage" size="40" value="/root/packages-$version.iso" />
|
al@755
|
1196 </form>
|
al@755
|
1197 </div>
|
pascal@627
|
1198
|
al@755
|
1199 <footer>
|
al@755
|
1200 <button data-icon="download" onclick='http://mirror.slitaz.org/iso/$version/packages-$version.iso'>
|
al@755
|
1201 $(_ 'Download DVD image')</button>
|
al@755
|
1202 <button data-icon="link" onclick='?admin&action=dvdusbkey'>
|
al@755
|
1203 $(_ 'Install from DVD/USB key')</button>
|
al@755
|
1204 </footer>
|
al@755
|
1205 </section>
|
pascal@627
|
1206
|
al@747
|
1207
|
al@755
|
1208 <section>
|
al@755
|
1209 <header>$(_ 'Packages list')</header>
|
al@755
|
1210 <form class="wide">
|
al@755
|
1211 <div>
|
al@755
|
1212 $(_ 'Long list of packages is paginated. Here you can set the page size (default: 100, turning off the pager: 0).')
|
al@755
|
1213 </div>
|
al@755
|
1214 <input type="hidden" name="admin" value="pager"/>
|
al@755
|
1215 <input type="number" name="pager" value="$pager" min="0" step="10" size="4"/>
|
al@755
|
1216 <footer>
|
al@755
|
1217 <button data-icon="ok" type="submit">$(_ 'Set')</button>
|
al@755
|
1218 </footer>
|
al@755
|
1219 </form>
|
al@755
|
1220 </section>
|
pascal@627
|
1221 EOT
|
al@727
|
1222 ;;
|
al@727
|
1223
|
al@727
|
1224
|
al@727
|
1225 *\ license\ *)
|
al@727
|
1226 #
|
al@727
|
1227 # Show licenses for installed packages
|
al@727
|
1228 #
|
al@744
|
1229 search_form; sidebar
|
al@744
|
1230
|
al@727
|
1231 pkg=$(GET license)
|
al@727
|
1232 case $pkg in
|
al@747
|
1233 /*) [ -e $pkg ] && {
|
al@727
|
1234 echo "<h2>${pkg#/usr/share/licenses/}</h2>"
|
al@727
|
1235 case $pkg in
|
al@747
|
1236 *.htm*) cat $pkg ;;
|
al@747
|
1237 *) echo "<pre style=\"white-space: pre-wrap\">"
|
al@727
|
1238 cat $pkg | htmlize | sed 's|\([hf]t*t*ps*://[a-zA-Z0-9./_-]*[a-zA-Z0-9/_-]\)|<a href="\1">\1</a>|'
|
al@727
|
1239 echo "</pre>"
|
al@727
|
1240 ;;
|
al@727
|
1241 esac
|
al@727
|
1242 } ;;
|
al@747
|
1243 *) echo "<h2>$(_ 'Licenses for package %s' $pkg)</h2>"
|
al@747
|
1244 OFFLINE=''
|
al@727
|
1245 if [ -e "$PKGS_DB/installed/$pkg" ]; then
|
al@727
|
1246 for lic in $(grep /usr/share/licenses/ $PKGS_DB/installed/$pkg/files.list); do
|
al@727
|
1247 OFFLINE="$OFFLINE <li><a href=\"?license=$lic\">licenses/<b>${lic#/usr/share/licenses/}</b></a></li>\n"
|
al@727
|
1248 done
|
al@747
|
1249 echo "\
|
al@747
|
1250 Apache|Apache-2.0||||http://www.apache.org/licenses/#Artistic|Artistic-2.0||||#\
|
al@747
|
1251 BSD|BSD-2-Clause||||#BSD3|BSD-3-Clause||||#CC-BY-SA||by-sa/4.0/|||#\
|
al@747
|
1252 CC-SA||by-sa/4.0/|||#CC-BY-ND||by-nd/4.0/|||#CC-BY-NC-SA||by-nc-sa/4.0/|||#\
|
al@747
|
1253 CC-BY-NC-ND||by-nc-nd/4.0/|||#CC-BY-NC||by-nc/4.0/|||#CC-BY||by/4.0/|||#\
|
al@747
|
1254 cc-pd|||||http://creativecommons.org/publicdomain/#CDDL|CDDL-1.0||||#\
|
al@747
|
1255 CECILL|CECILL-2.1||||#Eclipse|EPL-1.0||||#EPL|EPL-1.0||||#FDL|||fdl||#\
|
al@747
|
1256 GPL|gpl-license||gpl|gpl.txt|#GPL2|GPL-2.0||old-licenses/gpl-2.0||#\
|
al@747
|
1257 GPL3|GPL-3.0||gpl|gpl.txt|#ISC|ISC||||#LGPL|lgpl-license||lgpl||#\
|
al@747
|
1258 LGPL2|||old-licenses/lgpl-2.0||#\
|
al@747
|
1259 LGPL2.1|LGPL-2.1||old-licenses/lgpl-2.1|lgpl.txt|#LGPL3|LGPL-3.0||lgpl||#\
|
al@747
|
1260 LPPL|LPPL-1.3c||||#MIT|MIT|||mit.txt|#MPL|MPL-2.0|||mozilla.txt|#\
|
al@747
|
1261 MPL2|MPL-2.0||||#PublicDomain|||||http://creativecommons.org/publicdomain/#\
|
al@747
|
1262 QPL|QPL-1.0||||#SIL_OFL|OFL-1.1||||#OFL|OFL-1.1||||#zlib/libpng|Zlib||||" | \
|
al@747
|
1263 awk -vlicenses="$(. $PKGS_DB/installed/$pkg/receipt; echo "$LICENSE")" \
|
al@747
|
1264 -vtext="$(_ '%s license on %s website' %s %s)" \
|
al@747
|
1265 -vro="$(_ 'Read online:')" -vrl="$(_ 'Read local:')" \
|
al@747
|
1266 -vofflic="$OFFLINE" '
|
al@747
|
1267 BEGIN{ FS="|"; RS="#"; split(licenses, lic, " "); if (offlic) OFFLINE[0]=offlic }
|
al@747
|
1268 function link1(u, l, ll, w) {
|
al@747
|
1269 return sprintf("\t<li><a href=\"%s%s\">" text "</a></li>", u, l, "<b>" ll "</b>", w) }
|
al@747
|
1270 function link2(u, l, ll) {
|
al@747
|
1271 return sprintf("\t<li><a href=\"%s%s\">%s</b></a></li>", u, l, ll) }
|
al@747
|
1272 function link_osl(n) {
|
al@747
|
1273 return link1("http://opensource.org/licenses/", n, n, "OSL") }
|
al@747
|
1274 function link_cc(n) {
|
al@747
|
1275 split(n, ll, "/")
|
al@747
|
1276 return link1("http://creativecommons.org/licenses/", n, ll[1], "Creative Commons") }
|
al@747
|
1277 function link_gnu(n) {
|
al@747
|
1278 split(n, ll, "/")
|
al@747
|
1279 return link1("https://www.gnu.org/licenses/", n ".html", ll[2] ? ll[2] : ll[1], "GNU") }
|
al@747
|
1280 function link_loc(n) {
|
al@747
|
1281 return link2("?license=/usr/share/licenses/", n, "licenses/<b>" n "</b>") }
|
al@747
|
1282 function link_url(n) {
|
al@747
|
1283 return link2(n, "", n) }
|
al@747
|
1284 {
|
al@747
|
1285 if ($1 == lic[1] || $1 == lic[2] || $1 == lic[3] || $1 == lic[4]) {
|
al@747
|
1286 if ($2) ONLINE[$2]=link_osl($2)
|
al@747
|
1287 if ($3) ONLINE[$3]=link_cc($3)
|
al@747
|
1288 if ($4) ONLINE[$4]=link_gnu($4)
|
al@747
|
1289 if ($5) OFFLINE[$5]=link_loc($5)
|
al@747
|
1290 if ($6) OFFLINE[$6]=link_url($6)
|
al@747
|
1291 }
|
al@747
|
1292 }
|
al@747
|
1293 END{
|
al@747
|
1294 if (length(ONLINE) > 0) { print "<p>" ro "</p>\n<ul>"; for (o in ONLINE) print ONLINE[o]; print "</ul>" }
|
al@747
|
1295 if (length(OFFLINE) > 0) { print "<p>" rl "</p>\n<ul>"; for (o in OFFLINE) print OFFLINE[o]; print "</ul>" }
|
al@747
|
1296 }'
|
al@747
|
1297 fi ;;
|
al@727
|
1298 esac
|
al@727
|
1299 ;;
|
al@727
|
1300
|
al@727
|
1301
|
al@744
|
1302 *\ tags\ *)
|
al@744
|
1303 #
|
al@744
|
1304 # Show tag cloud
|
al@744
|
1305 #
|
al@744
|
1306 search_form; sidebar
|
al@744
|
1307
|
al@744
|
1308 echo "<h2>$(_ 'Tags list')</h2>"
|
al@744
|
1309 brepo="<b>$repo</b>"
|
al@744
|
1310 case $repo in
|
al@744
|
1311 Any) title="$(_ 'List of tags in all repositories')" ;;
|
al@744
|
1312 *) title="$(_ 'List of tags in repository "%s"' "$brepo")" ;;
|
al@744
|
1313 esac
|
al@747
|
1314 echo "<p>$title</p><p id=\"tags\">"
|
al@744
|
1315 to_read=""
|
al@744
|
1316 for i in $(repo_list ""); do
|
al@747
|
1317 if [ ! -e $i/packages.info ]; then
|
al@747
|
1318 list=installed
|
al@747
|
1319 else
|
al@747
|
1320 list=packages
|
al@747
|
1321 fi
|
al@744
|
1322 to_read="$to_read $i/$list.info"
|
al@744
|
1323 done
|
al@744
|
1324 TAGS="$(awk -F$'\t' '{if($6){print $6}}' $to_read | tr ' ' $'\n' | sort | uniq -c)"
|
al@744
|
1325 MAX="$(echo "$TAGS" | awk '{if ($1 > MAX) MAX = $1} END{print MAX}')"
|
al@744
|
1326 echo "$TAGS" | awk -vMAX="$MAX" '{
|
al@744
|
1327 printf "<a class=\"tag%s\" href=\"?tag=%s\" title=\"%s\">%s</a> ", int($1 * 7 / MAX + 1), $2, $1, $2
|
al@744
|
1328 }'
|
al@744
|
1329 echo "</p>"
|
al@744
|
1330 ;;
|
al@744
|
1331
|
al@744
|
1332
|
al@728
|
1333 *\ tag\ *)
|
al@728
|
1334 #
|
al@744
|
1335 # Show packages with matching tag
|
al@728
|
1336 #
|
al@744
|
1337 search_form; sidebar
|
al@744
|
1338
|
al@744
|
1339 tag=$(GET tag)
|
al@785
|
1340 cat <<EOT
|
al@755
|
1341 <h2 data-icon="tag">$(_ 'Tag "%s"' $tag)</h2>
|
pascal@770
|
1342 EOT
|
al@785
|
1343 [ "$REMOTE_USER" == "root" ] && cat <<EOT
|
al@762
|
1344 <section>
|
al@762
|
1345 <div>$(_ 'Selected packages:') <span id="countSelected"></span></div>
|
al@762
|
1346 <footer>
|
al@762
|
1347 $(show_button do=Install do=Chblock do=Remove | sed 's|button |button form="pkglist" |g')
|
al@762
|
1348 $(show_button toggle)
|
al@762
|
1349 </footer>
|
al@762
|
1350 </section>
|
pascal@770
|
1351 EOT
|
al@785
|
1352 cat <<EOT
|
al@758
|
1353 <form id="pkglist" class="wide">
|
al@732
|
1354 EOT
|
al@744
|
1355 for i in $(repo_list ""); do
|
al@744
|
1356 show_list all
|
al@744
|
1357 done
|
al@785
|
1358 cat <<EOT
|
al@762
|
1359 </form>
|
al@762
|
1360 <script type="text/javascript">window.onscroll = scrollHandler; setCountSelPkgs();</script>
|
al@762
|
1361 EOT
|
al@744
|
1362 ;;
|
al@732
|
1363
|
al@744
|
1364
|
al@744
|
1365 *\ blocked\ *)
|
al@744
|
1366 #
|
al@744
|
1367 # Show blocked packages list
|
al@744
|
1368 #
|
al@744
|
1369 search_form; sidebar
|
al@744
|
1370
|
al@785
|
1371 cat <<EOT
|
al@744
|
1372 <h2>$(_ 'Blocked packages list')</h2>
|
al@744
|
1373
|
al@762
|
1374 <section>
|
al@762
|
1375 <div>$(_ 'Selected packages:') <span id="countSelected"></span></div>
|
al@762
|
1376 <footer>
|
al@762
|
1377 $(show_button do=Unblock | sed 's|button |button form="pkglist" |g')
|
al@762
|
1378 $(show_button toggle)
|
al@762
|
1379 </footer>
|
al@762
|
1380 </section>
|
al@762
|
1381
|
al@762
|
1382 <form id="pkglist" class="wide">
|
al@744
|
1383 EOT
|
al@744
|
1384 table_head
|
al@744
|
1385 for i in $(cat $PKGS_DB/blocked-packages.list); do
|
al@744
|
1386 awk -F$'\t' -vp="$i" '{
|
al@744
|
1387 if ($1 == p)
|
al@758
|
1388 printf "<tr><td><input type=\"checkbox\" name=\"pkg\" value=\"%s\"><a data-icon=\"pkgib\" href=\"?info=%s\">%s</a></td><td>%s</td><td>%s</td><td><a href=\"%s\"></a></td></tr>\n", $1, gensub(/\+/, "%2B", "g", $1), $1, $2, $4, $5
|
al@744
|
1389 }' $PKGS_DB/installed.info
|
al@744
|
1390 done
|
al@785
|
1391 cat <<EOT
|
al@762
|
1392 </tbody>
|
al@762
|
1393 </table>
|
al@762
|
1394 </form>
|
al@762
|
1395 <script type="text/javascript">window.onscroll = scrollHandler; setCountSelPkgs();</script>
|
al@762
|
1396 EOT
|
al@728
|
1397 ;;
|
al@728
|
1398
|
al@728
|
1399
|
al@786
|
1400 *\ improve\ *)
|
al@786
|
1401 #
|
al@786
|
1402 # Improving packages by the community effort
|
al@786
|
1403 #
|
al@786
|
1404 search_form; sidebar
|
al@786
|
1405 msg warn 'Under construction!<br/>It is only imitation of working'
|
al@786
|
1406
|
al@786
|
1407 pkg=$(GET improve)
|
al@786
|
1408 user=$(POST user); type=$(POST type); text="$(POST text)"
|
al@786
|
1409 login=$(POST login); password=$(POST password)
|
al@786
|
1410
|
al@786
|
1411 login_c=$(COOKIE login); password_c=$(COOKIE password)
|
al@786
|
1412 mail_hash=$(COOKIE mail_hash); user_name=$(COOKIE user_name)
|
al@786
|
1413
|
al@786
|
1414 n=$'\n'
|
al@786
|
1415
|
al@786
|
1416 if [ -n "$login" ]; then
|
al@786
|
1417 # Get mail hash and user Name from bugs.slitaz.org
|
al@786
|
1418 page="$(busybox wget --post-data "auth=${login}&pass=${password}&id=" \
|
al@786
|
1419 -O- "http://bugs.slitaz.org/bugs.cgi?user=${login}")"
|
al@786
|
1420 # Parse page and get:
|
al@786
|
1421 mail_hash="$(echo "$page" | fgrep '<h2>' | cut -d/ -f5 | cut -c 1-32)"
|
al@786
|
1422 user_name="$(echo "$page" | fgrep '<h2>' | cut -d'>' -f3 | cut -d'<' -f1)"
|
al@786
|
1423
|
al@786
|
1424 # Put variables to the session Cookies (they clean in browser close)
|
al@786
|
1425 cat <<EOT
|
al@786
|
1426 <script type="text/javascript">
|
al@786
|
1427 document.cookie = "login=$login";
|
al@786
|
1428 document.cookie = "password=$password";
|
al@786
|
1429 document.cookie = "mail_hash=$mail_hash";
|
al@786
|
1430 document.cookie = "user_name=$user_name";
|
al@786
|
1431 </script>
|
al@786
|
1432 EOT
|
al@786
|
1433 login_c="$login"; password_c="$password"
|
al@786
|
1434 fi
|
al@786
|
1435
|
al@786
|
1436 if [ -z "$login_c" ]; then
|
al@786
|
1437 cat <<EOT
|
al@786
|
1438 <section>
|
al@786
|
1439 <div>$(_ 'Please log in using your TazBug account.')</div>
|
al@786
|
1440 <form method="post">
|
al@786
|
1441 <input type="hidden" name="improve" value="$pkg"/>
|
al@786
|
1442 <table>
|
al@786
|
1443 <tr><td>$(_ 'Login:')</td>
|
al@786
|
1444 <td><input type="text" name="login"/></td></tr>
|
al@786
|
1445 <tr><td>$(_ 'Password:')</td>
|
al@786
|
1446 <td><input type="password" name="password"/></td></tr>
|
al@786
|
1447 <tr><td colspan="2">
|
al@786
|
1448 <button type="submit" data-icon="user">$(_ 'Log in')</button></td></tr>
|
al@786
|
1449 </table>
|
al@786
|
1450 </form>
|
al@786
|
1451 <footer>
|
al@786
|
1452 <a href="http://bugs.slitaz.org/bugs.cgi?signup&online" target="_blank">$(_ 'Create new account')</a>
|
al@786
|
1453 </footer>
|
al@786
|
1454 </section>
|
al@786
|
1455 EOT
|
al@786
|
1456 xhtml_footer; exit 0
|
al@786
|
1457 fi
|
al@786
|
1458
|
al@786
|
1459
|
al@786
|
1460 # Get receipt variables, show Install/Remove buttons
|
al@786
|
1461 if [ -d $INSTALLED/$pkg ]; then
|
al@786
|
1462 . $INSTALLED/$pkg/receipt
|
al@786
|
1463 else
|
al@786
|
1464 cd $PKGS_DB
|
al@786
|
1465 eval "$(awk -F$'\t' -vp=$pkg '
|
al@786
|
1466 $1==p{
|
al@786
|
1467 printf "VERSION=\"%s\"; SHORT_DESC=\"%s\"; TAGS=\"%s\"; ", $2, $4, $6
|
al@786
|
1468 }' packages.info undigest/*/packages.info)"
|
al@786
|
1469 fi
|
al@786
|
1470
|
al@786
|
1471 RECEIPT="$(wget -O - http://hg.slitaz.org/wok/raw-file/tip/$pkg/receipt | htmlize)"
|
al@786
|
1472 DESCRIPTION="$(wget -O - http://hg.slitaz.org/wok/raw-file/tip/$pkg/description.txt | htmlize)"
|
al@786
|
1473 DESCRIPTION="$(separator)$n${DESCRIPTION:-(empty)}$n$(separator)"
|
al@786
|
1474
|
al@786
|
1475 if [ -z "$type" ]; then
|
al@786
|
1476 cat <<EOT
|
al@786
|
1477 <section>
|
al@786
|
1478 <header>
|
al@786
|
1479 $(_ 'Improve package "%s"' $pkg)
|
al@786
|
1480 <form><button name="info" value="$pkg" data-icon="back">$(_ 'Back')</button></form>
|
al@786
|
1481 </header>
|
al@786
|
1482
|
al@786
|
1483 <div style="display:none">
|
al@786
|
1484 <span id="newVersion">Current version: $VERSION${n}New version: $VERSION${n}Link to announce: http://</span>
|
al@786
|
1485 <span id="improveShortDesc">Short description (English):$n$SHORT_DESC</span>
|
al@786
|
1486 <span id="translateShortDesc">Short description (English):$n$SHORT_DESC$n${n}Language: $LANG${n}Short description:$n$SHORT_DESC</span>
|
al@786
|
1487 <span id="improveDesc">Description (English):$n$DESCRIPTION</span>
|
al@786
|
1488 <span id="translateDesc">Language: $LANG${n}Description:$n$DESCRIPTION</span>
|
al@786
|
1489 <span id="improveCategory">Old category: $CATEGORY${n}New category: $CATEGORY</span>
|
al@786
|
1490 <span id="improveTags">Tags: $TAGS</span>
|
al@786
|
1491 <span id="addIcon">Link to application icon (48x48px): http://</span>
|
al@786
|
1492 <span id="addScreenshot">Link to application screenshot: http://</span>
|
al@786
|
1493 <span id="improveReceipt">$RECEIPT</span>
|
al@786
|
1494 <span id="improveOther"></span>
|
al@786
|
1495 </div>
|
al@786
|
1496
|
al@786
|
1497 <form method="post" class="wide">
|
al@786
|
1498
|
al@786
|
1499 <table class="wide">
|
al@786
|
1500 <tr><td style="vertical-align:bottom">
|
al@786
|
1501 <input type="hidden" name="improve" value="$pkg"/>
|
al@786
|
1502 <input type="hidden" name="user" value="$login_c"/>
|
al@786
|
1503 $(_ 'How can you help:')<br/>
|
al@786
|
1504 <select name='type' id="improveType" onchange="improveAction()">
|
al@786
|
1505 <option value=''>$(_ 'Please select an action')
|
al@786
|
1506 <option value='newVersion'>$(_ 'Report new version')
|
al@786
|
1507 <option value='improveShortDesc'>$(_ 'Improve short description')
|
al@786
|
1508 <option value='translateShortDesc'>$(_ 'Translate short description')
|
al@786
|
1509 <option value='improveDesc'>$(_ 'Add or improve description')
|
al@786
|
1510 <option value='translateDesc'>$(_ 'Translate description')
|
al@786
|
1511 <option value='improveCategory'>$(_ 'Improve category')
|
al@786
|
1512 <option value='improveTags'>$(_ 'Add or improve tags')
|
al@786
|
1513 <option value='addIcon'>$(_ 'Add application icon')
|
al@786
|
1514 <option value='addScreenshot'>$(_ 'Add application screenshot')
|
al@786
|
1515 <option value='improveReceipt'>$(_ 'Improve receipt')
|
al@786
|
1516 <option value='improveOther'>$(_ 'Other')
|
al@786
|
1517 </select>
|
al@786
|
1518 </td>
|
al@786
|
1519 <td id="user_info">$user_name
|
al@786
|
1520 <img src="http://www.gravatar.com/avatar/$mail_hash?s=48&d=identicon"
|
al@786
|
1521 style="border-radius: 0.3rem"/>
|
al@786
|
1522 </td></tr>
|
al@786
|
1523 </table>
|
al@786
|
1524
|
al@786
|
1525 <textarea name="text" id="improveText" style="width:100%; resize: vertical; min-height:10rem"></textarea>
|
al@786
|
1526 <button type="submit" data-icon="slitaz">$(_ 'Send')</button>
|
al@786
|
1527 </form>
|
al@786
|
1528 </section>
|
al@786
|
1529 EOT
|
al@786
|
1530 else
|
al@786
|
1531 cat <<EOT
|
al@786
|
1532 <section>
|
al@786
|
1533 <header>
|
al@786
|
1534 $(_ 'Thank you!')
|
al@786
|
1535 <form><button name="info" value="$pkg" data-icon="back">$(_ 'Back')</button></form>
|
al@786
|
1536 </header>
|
al@786
|
1537 <div>The following information was sent to SliTaz developers:</div>
|
al@786
|
1538 <pre class="scroll"><b>User:</b> $user
|
al@786
|
1539 <b>Type:</b> $type
|
al@786
|
1540 <b>Package:</b> $pkg
|
al@786
|
1541 <b>Message:</b>
|
al@786
|
1542 $(echo "$text" | htmlize)</pre>
|
al@786
|
1543 </section>
|
al@786
|
1544 EOT
|
al@786
|
1545 fi
|
al@786
|
1546 ;;
|
al@786
|
1547
|
al@786
|
1548
|
al@786
|
1549 *)
|
pascal@627
|
1550 #
|
pascal@627
|
1551 # Default to summary
|
pascal@627
|
1552 #
|
al@744
|
1553 search_form; sidebar
|
al@744
|
1554
|
al@785
|
1555 cat <<EOT
|
al@755
|
1556 <form id="actions2">
|
pascal@627
|
1557 EOT
|
al@700
|
1558 fslink=$(readlink $PKGS_DB/fslink)
|
al@724
|
1559 [ -n "$fslink" -a -d "$fslink/$INSTALLED" ] && show_button linkable
|
al@747
|
1560 show_button recharge up admin
|
al@785
|
1561 cat <<EOT
|
al@755
|
1562 </form>
|
pascal@627
|
1563
|
al@755
|
1564 <section>
|
al@755
|
1565 <header>$(_ 'Summary')</header>
|
al@755
|
1566
|
al@755
|
1567 <table class="wide zebra">
|
al@755
|
1568 <tr>
|
al@755
|
1569 <td>$(_ 'Last recharge:')</td>
|
al@755
|
1570 <td>$(list=$PKGS_DB/ID
|
al@745
|
1571 if [ -e $list ]; then
|
al@755
|
1572 # Timezone offset as string, ex. '+0200' for EET (+2 hours)
|
al@755
|
1573 ohhmm="$(date +%z)"
|
al@755
|
1574 # Timezone offset in the seconds
|
al@755
|
1575 offset=$(( 60 * (60 * ${ohhmm:0:3} + ${ohhmm:3:2}) ))
|
al@747
|
1576 daynow=$(( ($(date +%s) + $offset) / 86400 ))
|
al@747
|
1577 dayupd=$(( ($(date -r $list +%s) + $offset) / 86400 ))
|
al@747
|
1578 days=$(( $daynow - $dayupd ))
|
al@745
|
1579 time=$(date -r $list +%R)
|
al@745
|
1580 ago="$(_p '%d day ago.' '%d days ago.' $days $days)"
|
al@745
|
1581 case $days in
|
al@745
|
1582 0) _ 'Today at %s.' $time;;
|
al@745
|
1583 1) _ 'Yesterday at %s.' $time;;
|
al@745
|
1584 [2-9]) echo $ago;;
|
al@745
|
1585 *) echo "<span style='color:red'>$ago</span>"
|
al@745
|
1586 _ 'It is recommended to [recharge] the lists.' | \
|
al@755
|
1587 sed 's|\[|<a data-icon="refresh" href="?recharge">|;s|\]|</a>|';;
|
al@745
|
1588 esac
|
al@745
|
1589 else
|
al@745
|
1590 _ 'never.'
|
al@745
|
1591 _ 'You need to [download] the lists for further work.' | \
|
al@768
|
1592 sed 's|\[|<a data-icon="download" href="?recharge" data-root>|;s|\]|</a>|'
|
al@745
|
1593 fi)</td></tr>
|
al@755
|
1594 <tr>
|
al@755
|
1595 <td>$(_ 'Installed packages:')</td>
|
al@755
|
1596 <td><a href="?list&my=my&cat=all&repo=Any">
|
al@755
|
1597 <b>$(cat $PKGS_DB/installed.info | wc -l)</b>
|
al@755
|
1598 </a></td></tr>
|
al@755
|
1599 <tr>
|
al@755
|
1600 <td>$(_ 'Mirrored packages:')</td>
|
al@755
|
1601 <td><a href="?list&my=no&cat=all&repo=Any">
|
al@755
|
1602 <b>$(cat $PKGS_DB/packages.list | wc -l)</b>
|
al@755
|
1603 </a></td></tr>
|
al@755
|
1604 <tr>
|
al@755
|
1605 <td>$(_ 'Upgradeable packages:')</td>
|
al@755
|
1606 <td><a href="?up">
|
al@755
|
1607 <b>$(cat $PKGS_DB/packages.up | wc -l)</b>
|
al@755
|
1608 </a></td></tr>
|
al@755
|
1609 <tr>
|
al@755
|
1610 <td>$(_ 'Installed files:')</td>
|
al@755
|
1611 <td><b>$(cat $INSTALLED/*/files.list | wc -l)</b></td></tr>
|
al@755
|
1612 <tr>
|
al@755
|
1613 <td>$(_ 'Blocked packages:')</td>
|
al@755
|
1614 <td><a href="?blocked">
|
al@755
|
1615 <b>$(cat $PKGS_DB/blocked-packages.list | wc -l)</b>
|
al@755
|
1616 </a></td></tr>
|
al@755
|
1617 </table>
|
al@755
|
1618 </section>
|
pascal@627
|
1619
|
pascal@627
|
1620
|
al@755
|
1621 <section>
|
al@755
|
1622 <header>
|
al@755
|
1623 $(_ 'Latest log entries')
|
al@755
|
1624 <form action="index.cgi">
|
al@755
|
1625 <button name="file" value="$LOG" data-icon="view">$(_ 'Show')</button>
|
al@755
|
1626 </form>
|
al@755
|
1627 </header>
|
al@755
|
1628 <pre>$(tail -n 5 $LOG | tac | fgrep "-" | awk '{print $1, $2, $3, $4, $5, "<a href=\"?info=" $6 "\">" $6 "</a>", $7}')</pre>
|
al@755
|
1629 </section>
|
pascal@627
|
1630 EOT
|
pascal@627
|
1631 ;;
|
pascal@627
|
1632 esac
|
pascal@627
|
1633
|
pascal@627
|
1634 # xHTML 5 footer
|
al@633
|
1635 export TEXTDOMAIN='tazpkg'
|
pascal@627
|
1636 xhtml_footer
|
pascal@627
|
1637 exit 0
|