slitaz-forge view arm/tools.cgi @ rev 711

Update pangolin
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Jan 01 18:26:56 2020 +0100 (5 months ago)
parents 762b4433c38f
children
line source
1 #!/bin/sh
2 #
3 # SliTaz ARM CGI Tools.
4 #
5 # Copyright (C) 2014 SliTaz ARM - BSD License
6 # Author: Christophe Lincoln <pankso@slitaz.org>
7 #
8 . /usr/lib/slitaz/httphelper.sh
10 repos="/home/slitaz/repos"
11 pkgs="/home/slitaz/cooking/arm/packages"
12 mirror="http://cook.slitaz.org/cross/arm/packages/"
13 hgsat="$repos/slitaz-arm"
14 hgcook="$repos/cookutils"
16 #
17 # Functions
18 #
20 # Usage: html_header "title"
21 html_header() {
22 cat header.html | sed s"/_TITLE_/$1/"
23 }
25 html_footer() {
26 cat << EOT
27 <!-- Close content -->
28 </div>
30 <div id="footer">
31 &copy; $(date +%Y) - <a href="http://www.slitaz.org/">SliTaz GNU/Linux</a>
32 </div>
34 </body>
35 </html>
36 EOT
37 }
39 #
40 # Handle GET actions
41 #
43 case " $(GET) " in
44 *\ doc\ *)
45 header
46 html_header "$(GET tool)"
47 echo '<pre>'
48 case "$(GET tool)" in
49 cook) cat ${hgcook}/README ;;
50 cross) cat ${hgcook}/doc/cross.txt ;;
51 sat) cat ${hgsat}/README ;;
52 sat-rpi) cat ${hgsat}/rpi/README ;;
53 *) echo "No README file for: $(GET tool)" ;;
54 esac
55 echo '</pre>'
56 html_footer ;;
58 *\ micronews\ *)
59 header
60 html_header "microNews"
61 cat << EOT
62 <h2>SliTaz ARM &micro;News</h2>
63 <p>
64 Development activity can be seen on:
65 <a href="http://hg.slitaz.org/slitaz-arm">SliTaz ARM Hg repo</a>
66 </p>
67 <pre style="line-height: 1.6em;">
68 $(tac news.txt)
69 </pre>
70 EOT
71 html_footer ;;
73 *\ pkgs\ *)
74 # TODO: link packages and add link to raw lists
75 title="- Packages"
76 count="$(cat $pkgs/packages.list | wc -l)"
77 header
78 html_header "Packages"
79 cat << EOT
80 <h2>Packages: $count</h2>
82 <pre>
83 Packages lists : <a href="${mirror%/}/packages.list">packages.list</a> \
84 - <a href="${mirror%/}/packages.md5">packages.md5</a>
85 Mirror URL : <a href="${mirror}">${mirror}</a>
86 </pre>
88 <h2>Packages list</h2>
89 EOT
90 IFS="|"
91 cat $pkgs/packages.desc| while read pkg vers desc web deps
92 do
93 vers=${vers# }
94 cat << EOT
95 <p>
96 <a href="${mirror%/}/${pkg% }-${vers% }-arm.tazpkg">${pkg% }</a> $vers - $desc
97 </p>
98 EOT
99 done
100 unset IFS
101 html_footer ;;
102 *)
103 header "Content-Type: text/plain"
104 echo "Hello World!" ;;
105 esac
107 exit 0