Mercurial > hg > kdocs
comparison make/functions.sh @ 86:ca7e38053195
Updates and bug fixes, should work now. Options to make.sh are --nonet and
--long. (Must occur in that order if you supply both.)
author | Rob Landley <rob@landley.net> |
---|---|
date | Wed, 07 Nov 2007 02:54:10 -0600 |
parents | 13a980b307f8 |
children | 41f999d7f077 |
comparison
equal
deleted
inserted
replaced
85:9ca9c2104cf9 | 86:ca7e38053195 |
---|---|
12 | 12 |
13 # Update Documentation directory | 13 # Update Documentation directory |
14 | 14 |
15 function update_documentation_dir() | 15 function update_documentation_dir() |
16 { | 16 { |
17 rm -rf $WEBDIR/Documentation/ | 17 rm -rf "$WEBDIR"/Documentation/ |
18 cp -a $LNXDIR/hg/Documentation $WEBDIR/Documentation | 18 cp -a "$LNXDIR"/hg/Documentation "$WEBDIR"/Documentation |
19 # Make the change directory local to this function | 19 # Make the change directory local to this function |
20 ( | 20 ( |
21 cd $WEBDIR | 21 cd $WEBDIR |
22 for i in make/patches/*.patch | 22 for i in make/patches/*.patch |
23 do | 23 do |
79 } | 79 } |
80 | 80 |
81 function install_htmldocs() | 81 function install_htmldocs() |
82 { | 82 { |
83 ( | 83 ( |
84 rm -f $WEBDIR/htmldocs | 84 rm -rf $WEBDIR/htmldocs |
85 cd "$LNXDIR"/Documentation/DocBook && | 85 cd "$LNXDIR"/temp/Documentation/DocBook && |
86 # Install nochunks versions | 86 # Install nochunks versions |
87 mv xhtml-nochunks "$WEBDIR"/htmldocs && | 87 mv xhtml-nochunks "$WEBDIR"/htmldocs && |
88 | 88 |
89 head -n 2 index.html > "$WEBDIR"/htmldocs/index.html && | 89 head -n 2 index.html > "$WEBDIR"/htmldocs/index.html && |
90 echo "<ul>" >> "$WEBDIR"/htmldocs/index.html | 90 echo "<ul>" >> "$WEBDIR"/htmldocs/index.html |
133 ARCH=$(echo $i | sed -r 's@.*/(.*)/.*@\1@') && | 133 ARCH=$(echo $i | sed -r 's@.*/(.*)/.*@\1@') && |
134 echo "<li><a href=${ARCH}.html>${ARCH}</a></li>" >> \ | 134 echo "<li><a href=${ARCH}.html>${ARCH}</a></li>" >> \ |
135 "$WEBDIR"/menuconfig/index.html && | 135 "$WEBDIR"/menuconfig/index.html && |
136 "$WEBDIR"/make/menuconfig2html.py $i "$WEBDIR"/menuconfig "$LNXTAG" > \ | 136 "$WEBDIR"/make/menuconfig2html.py $i "$WEBDIR"/menuconfig "$LNXTAG" > \ |
137 "$WEBDIR"/menuconfig/$ARCH.html | 137 "$WEBDIR"/menuconfig/$ARCH.html |
138 | |
139 [ $? -eq 0 ] || exit 1 | |
138 done | 140 done |
139 ) && | 141 ) && |
140 echo "</ul></body></html>" >> "$WEBDIR"/menuconfig/index.html | 142 echo "</ul></body></html>" >> "$WEBDIR"/menuconfig/index.html |
141 } | 143 } |
142 | 144 |
186 } | 188 } |
187 | 189 |
188 function findrfc() | 190 function findrfc() |
189 { | 191 { |
190 ( | 192 ( |
193 > "$WEBDIR"/temp-linuxrfc.txt && | |
191 cd "$LNXDIR" || exit 1 | 194 cd "$LNXDIR" || exit 1 |
192 echo -n "Search for RFC references" | 195 echo -n "Search for RFC references" |
193 x=0 | 196 x=0 |
194 # Iterate through *.c and *.h in the Linux source code. | 197 # Iterate through *.c and *.h in the Linux source code. |
195 for i in `find "$LNXDIR"/hg -name "*.[hc]"` | 198 for i in `find "$LNXDIR"/hg -name "*.[hc]"` |
196 do | 199 do |
197 # Progress indicator | 200 # Progress indicator |
198 x=$[$x+1] | 201 x=$[$x+1] |
199 if [ $x -gt 250 ] | 202 if [ $x -gt 100 ] |
200 then | 203 then |
201 echo -n . >&2 | 204 echo -n . |
202 x=0 | 205 x=0 |
203 fi | 206 fi |
204 # Grep each source file for mention of an RFC, filtering out the more | 207 # Grep each source file for mention of an RFC, filtering out the more |
205 # obvious false positives. | 208 # obvious false positives. |
206 for j in $(grep -io "rfc *[1-9][0-9]*" $i | grep -v " " | grep -v "@rfc822\.org" | sed -r 's/[Rr][Ff][Cc] *([0-9]*)/rfc\1/g') | 209 for j in $(grep -io "rfc *[1-9][0-9]*" $i | grep -v " " | grep -v "@rfc822\.org" | sed -r 's/[Rr][Ff][Cc] *([0-9]*)/rfc\1/g') |
207 do | 210 do |
208 echo $i:$j | 211 echo $i:$j >> "$WEBDIR"/temp-linuxrfc.txt |
209 done | 212 done |
210 done | 213 done |
211 ) > "$WEBDIR">temp-linuxrfc.txt | 214 ) && |
212 | 215 |
213 # Process the temporary directory into an html file. | 216 # Process the temporary directory into an html file. |
214 | 217 |
215 echo Converting to html... | 218 echo Converting to html... |
216 ( | 219 ( |
225 echo '<a href="http://kernel.org/hg/linux-2.6/file/tip/'$j'">'$j'</a>' | 228 echo '<a href="http://kernel.org/hg/linux-2.6/file/tip/'$j'">'$j'</a>' |
226 done | 229 done |
227 echo "</p></li>" | 230 echo "</p></li>" |
228 done | 231 done |
229 echo "</ul></html>" | 232 echo "</ul></html>" |
230 ) > "$WEBDIR"/rfc-linux.html | 233 ) > "$WEBDIR"/rfc-linux.html && |
231 | 234 |
232 # Remove the temporary file | 235 # Remove the temporary file |
233 rm temp-linuxrfc.txt | 236 rm temp-linuxrfc.txt |
234 } | 237 } |
235 | 238 |
237 | 240 |
238 function setuplinuxtemp() | 241 function setuplinuxtemp() |
239 { | 242 { |
240 if [ ! -d "$WEBDIR"/Documentation ] | 243 if [ ! -d "$WEBDIR"/Documentation ] |
241 then | 244 then |
242 "$WEBDIR"/make/do-Documentation.sh || exit 1 | 245 echo "Need Documentation dir first" |
246 exit 1 | |
243 fi | 247 fi |
244 | 248 |
245 rm -rf "$LNXDIR"/temp && | 249 rm -rf "$LNXDIR"/temp && |
246 mkdir "$LNXDIR"/temp && | 250 mkdir "$LNXDIR"/temp && |
247 ( cd "$LNXDIR"/hg && | 251 ( cd "$LNXDIR"/hg && |
248 make allnoconfig O=$LNXDIR/temp && | 252 make allnoconfig O=$LNXDIR/temp > /dev/null && |
249 # Adjust to use the patched Documentation directory | 253 # Adjust to use the patched Documentation directory |
250 ln -s "$WEBDIR"/Documentation "$LNXDIR"/temp && | 254 ln -s "$WEBDIR"/Documentation "$LNXDIR"/temp && |
251 # We'll need this later. | 255 # We'll need this later. |
252 make -j 2 xmldocs | 256 make -j 2 xmldocs |
253 ) | 257 ) |
254 } | 258 } |
259 | |
260 function wait4background() | |
261 { | |
262 # Wait for background task to finish | |
263 while [ $(jobs | wc -l) -ne 0 ] | |
264 do | |
265 sleep 1 | |
266 # Without this next line, bash never notices a change in the number of jobs. | |
267 # Bug noticed in Ubuntu 7.04 | |
268 jobs > /dev/null | |
269 done | |
270 } | |
271 |