This repository has been archived by the owner on Oct 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
slkbuildlist.sh
246 lines (234 loc) · 6.08 KB
/
slkbuildlist.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
#!/bin/sh
#
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as published by Sam Hocevar. See
# http://sam.zoy.org/wtfpl/COPYING for more details.
#
#
# Frédéric Galusik <fredg (AT) salixos (dot) org>
#
# pkglist is a simple source salix repository UI
# list pkgname-slkbuild-source on a single webpage
#
##
# var
##
# if not null must end with /
# if not null, have to fix sort -k
LOCALDIR=""
##
# fixe
##
REPO="http://download.salixos.org/slkbuild/13.37/"
TITLE="Salix SLKBUILDs list"
HTML="slkbuildlist.html"
##
# total PKG
##
NBPKG="$(\ls -d1 $LOCALDIR*/* | wc -l)"
##
# small check & backup
##
if [ ! -f $HTML ]
then
echo "Error, this script have to be run in the source root! Play again!"
exit 1
else
mv $HTML .$HTML.old
fi
##
# html/css
##
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">
<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">
<head>
<title>$TITLE</title>
<meta http-equiv=\"content-type\" content=\"text/html;charset=utf-8\" />
<link href=\"http://salix.enialis.net/.icons/favicon.ico\"
rel=\"SHORTCUT ICON\" />
</head>
<style type=\"text/css\">
body
{
color: #444444;
margin: 0;
padding: 0;
font-size: 12px;
font-family: Verdana, Helvetica, Arial, sans-serif;
background-color: #656565;
background-image: url (../../.icons/body.png);
background-repeat: repeat-x;
height:100%; /* needed for container min-height */
}
table {
border-width:10px;
border-style:solid;
border-color:white;
width:100%;
background-color: #FFFFFF;
}
td {
background-color: #FFFFFF;
border-width:0px;
border-bottom:1px;
border-style:dashed;
border-color:green;
width:33%;
text-align: center;
}
#container {
position:relative; /* needed for footer positioning*/
margin:0 auto; /* center, not in IE5 */
width: 100%;
height:auto !important; /* real browsers */
height:100%; /* IE6: treaded as min-height*/
min-height:100%; /* real browsers */
}
a, a:visited {
color: #125298;
text-decoration: none;
font-weight: bold;
}
a:hover {
color: #0682E6;
text-decoration: none;
}
img {
border: none;
}
em {
color: #FD9C19;
font-weight: bold;
font-style: normal;
padding-left: 2px;
padding-right: 2px;
}
em:before {
content: \"“\";
}
em:after {
content: \"”\";
}
#title {
background-image: url(../../.icons/logo.gif);
background-repeat: no-repeat;
width: 978px;
height: 100px;
margin-left: auto;
margin-right: auto;
}
h2 {
display: none;
}
#head {
display: block;
margin-top: 20px;
margin-left: 20px;
margin-right: 20px;
}
#body {
margin-left: 20px;
margin-right: 20px;
padding-bottom: 40px;
}
#foot {
position:absolute;
width: 100%;
bottom: 0px; /* stick to bottom */
background-color: #222222;
color: #F8F5EC;
background-repeat: repeat-x;
height: 40px;
}
#foot div {
text-align: right;
padding-right: 10px;
padding-top: 10px;
}
.block {
background-color: #FFFFFF;
color: black;
border-width: 1px;
border-style: solid;
border-color: #A9A9A9;
}
.block .title {
padding: 8px 3px 8px 32px;
margin-bottom: 2px;
background-color: transparent;
background-image: url(../../.icons/menu.gif);
background-repeat: repeat-x;
background-position: left top;
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: #ded0a5;
font-variant: small-caps;
font-weight: bold;
color: black;
}
.block .content {
padding: 10px 20px 0px 20px;
margin-bottom: 20px;
}
.block .content > p {
margin-bottom: 10px;
}
.block .content > p {
background: url(../../.icons/tick.gif) -5px -5px no-repeat;
padding-left: 30px;
}
pre {
background-image: url(../../.icons/header.gif);
background-repeat: repeat-x;
background-position: left top;
background-color: #F8F5EC;
border-width: 1px;
border-style: solid;
border-color: #A9A9A9;
}
pre img[src~=\"/icons/blank.gif\"] {
height: 24px;
width: 25px;
}
pre a[href^=\"?\"] {
color: white;
}
pre hr {
visibility: hidden;
}
</style>
<body onload=\"loaded();\">
<div id=\"container\">
<div id=\"title\">
<h2><span>Salix<br/>The Bonsai OS</span></h2>
</div>
<div id=\"head\">
<div class=\"block\">
<div class=\"title\">$TITLE</div>
<div class=\"content\">
<p><a href=\"http://salixos.org/\" target=\"_blank\">Salix</a> is a linux distribution based on Slackware that is simple and easy to use. Salix aims to be completely backwards compatible with Slackware, so Slackware users can benefit from Salix repositories.</p>
<p>Total SLKBUILDs: $NBPKG</p>
<p>Please report any missing files, weird or not optimized SLKBUILDs in the dedicated <a href=\"http://www.salixos.org/forum/viewforum.php?f=22\">packages section</a> in our forum.</p>
</div>
</div>
</div>
<div id=\"body\">
<table>
<tr><td><b>Name</b></td><td><b>Build Script</b></td><td><b>Source Directory</b></td></tr>
" > $HTML
##
# list, sort, print
##
\ls -d1 $LOCALDIR*/* | \
sort -f -t / -k 2 | \
sed -e 's@^\(.*/\)\?\([^/]\+\)/\([^/]\+\)$@<tr><td>\3</td><td><a href="\2/\3/SLKBUILD">SLKBUILD</a></td><td><a href="\2/\3/">source</a></td></tr>@g' >> $HTML
##
# html
##
echo "
</table>
</body>
</html>" >> $HTML