Mercurial > hg > kdocs
comparison make/functions.sh @ 105:c27b8c8a1b14
Break down and use git instead of hg for upstream kernel source.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sun, 12 Dec 2010 16:47:22 -0600 |
parents | 7bcba6e2acc3 |
children | 01b77829d010 |
comparison
equal
deleted
inserted
replaced
104:7bcba6e2acc3 | 105:c27b8c8a1b14 |
---|---|
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"/temp/Documentation "$WEBDIR"/Documentation | 18 cp -a "$LNXDIR"/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 make/docdiridx.py | 22 make/docdiridx.py |
23 ) | 23 ) |
24 } | 24 } |
25 | 25 |
26 # Clone or update mercurial Linux kernel repository from kernel.org | 26 # Clone or update mercurial Linux kernel repository from kernel.org |
27 | 27 |
28 function get_hg() | 28 function get_git() |
29 { | 29 { |
30 # Make the chdir local to this function | 30 # Make the chdir local to this function |
31 ( | 31 ( |
32 if [ ! -d "$LNXDIR" ] | 32 if [ ! -d "$LNXDIR" ] |
33 then | 33 then |
34 echo "Clone Linux kernel repository from kernel.org" | 34 echo "Clone Linux kernel repository from kernel.org" |
35 | 35 |
36 mkdir -p "$LNXDIR"/hg && | 36 mkdir -p "$LNXDIR" && |
37 cd "$LNXDIR"/hg && | 37 cd "$LNXDIR" && |
38 hg clone http://kernel.org/hg/linux-2.6 hg | 38 # hg clone http://kernel.org/hg/linux-2.6 |
39 git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 .git --bare && | |
40 git checkout -f master | |
39 else | 41 else |
40 # Update kernel mercurial repository. | 42 # Update kernel git repository. |
41 cd "$LNXDIR"/hg && | 43 cd "$LNXDIR" && |
42 echo "Update Linux kernel from kernel.org" && | 44 echo "Update Linux kernel from kernel.org" && |
43 hg pull -u | 45 git clean -fdx && git checkout -f master && git pull |
44 fi | 46 fi |
45 [ $? -ne 0 ] && exit 1 | 47 [ $? -ne 0 ] && exit 1 |
46 | 48 |
47 echo "Linux version: $(hg tags | head -n 2 | tail -n 1 | awk '{print $1}')" | 49 echo "Linux version: $(git describe --abbrev=0)" |
48 ) | 50 ) |
49 } | 51 } |
50 | 52 |
51 function make_htmldocs() | 53 function make_htmldocs() |
52 { | 54 { |
53 # Make the chdir local | 55 # Make the chdir local |
54 ( | 56 ( |
55 cd "$LNXDIR"/temp && | 57 cd "$LNXDIR" && |
56 make -j 2 htmldocs | 58 make -j 2 htmldocs |
57 ) | 59 ) |
58 } | 60 } |
59 | 61 |
60 function make_htmlnochunks() | 62 function make_htmlnochunks() |
61 { | 63 { |
62 # Make the chdir local | 64 # Make the chdir local |
63 ( | 65 ( |
64 cd "$LNXDIR"/temp && | 66 cd "$LNXDIR" && |
65 # Probably redundant, but just in case... | 67 # Probably redundant, but just in case... |
66 make -j 2 xmldocs && | 68 make -j 2 xmldocs && |
67 cd Documentation/DocBook && | 69 cd Documentation/DocBook && |
68 for i in *.xml | 70 for i in *.xml |
69 do | 71 do |
75 | 77 |
76 function install_htmldocs() | 78 function install_htmldocs() |
77 { | 79 { |
78 ( | 80 ( |
79 rm -rf $WEBDIR/htmldocs | 81 rm -rf $WEBDIR/htmldocs |
80 cd "$LNXDIR"/temp/Documentation/DocBook && | 82 cd "$LNXDIR"/Documentation/DocBook && |
81 # Install nochunks versions | 83 # Install nochunks versions |
82 mv xhtml-nochunks "$WEBDIR"/htmldocs && | 84 mv xhtml-nochunks "$WEBDIR"/htmldocs && |
83 | 85 |
84 head -n 2 index.html > "$WEBDIR"/htmldocs/index.html && | 86 head -n 2 index.html > "$WEBDIR"/htmldocs/index.html && |
85 echo "<ul>" >> "$WEBDIR"/htmldocs/index.html | 87 echo "<ul>" >> "$WEBDIR"/htmldocs/index.html |
113 } | 115 } |
114 | 116 |
115 function htmlize_menuconfig() | 117 function htmlize_menuconfig() |
116 { | 118 { |
117 ( | 119 ( |
118 cd "$LNXDIR"/hg && | 120 cd "$LNXDIR" && |
119 LNXTAG="$(hg tags | head -n 2 | tail -n 1 | awk '{print $1}')" | 121 LNXTAG="$(git describe --abbrev=0)" |
120 | 122 |
121 rm -rf "$WEBDIR"/menuconfig/ | 123 rm -rf "$WEBDIR"/menuconfig/ |
122 mkdir -p "$WEBDIR"/menuconfig && | 124 mkdir -p "$WEBDIR"/menuconfig && |
123 echo "<html><title>Menuconfig docs for Linux $LNXTAG</title><body><ul>" > \ | 125 echo "<html><title>Menuconfig docs for Linux $LNXTAG</title><body><ul>" > \ |
124 "$WEBDIR"/menuconfig/index.html && | 126 "$WEBDIR"/menuconfig/index.html && |
153 cd ../.. | 155 cd ../.. |
154 | 156 |
155 [ $? -ne 0 ] && exit 1 | 157 [ $? -ne 0 ] && exit 1 |
156 fi | 158 fi |
157 | 159 |
158 if [ -z "$(find ols/2009 -name "*.pdf")" ] | 160 if [ -z "$(find ols/2010 -name "*.pdf")" ] |
159 then | 161 then |
160 echo "Split ols files" | 162 echo "Split ols files" |
161 mkdir -p ols/{1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009} && | 163 mkdir -p ols/{1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010} && |
162 cp mirror/ols2001/*.pdf ols/2001 && | 164 cp mirror/ols2001/*.pdf ols/2001 && |
163 make/splitols.py mirror ols | 165 make/splitols.py mirror ols |
164 | 166 |
165 [ $? -ne 0 ] && exit 1 | 167 [ $? -ne 0 ] && exit 1 |
166 fi | 168 fi |
170 function find_readmes() | 172 function find_readmes() |
171 { | 173 { |
172 ( | 174 ( |
173 rm -rf "$WEBDIR"/readme | 175 rm -rf "$WEBDIR"/readme |
174 mkdir "$WEBDIR"/readme && | 176 mkdir "$WEBDIR"/readme && |
175 cd "$LNXDIR"/hg && | 177 cd "$LNXDIR" && |
176 make help > "$WEBDIR"/makehelp.txt && | 178 make help > "$WEBDIR"/makehelp.txt && |
177 for i in $(find . -name "*[Rr][Ee][Aa][Dd][Mm][Ee]*" | grep -v "Documentation/") | 179 for i in $(find . -name "*[Rr][Ee][Aa][Dd][Mm][Ee]*" | grep -v "Documentation/") |
178 do | 180 do |
179 OUT=$(echo $i | sed -e 's@\./@@' -e 's@/@-@g') | 181 OUT=$(echo $i | sed -e 's@\./@@' -e 's@/@-@g') |
180 cp $i "$WEBDIR"/readme/"$(echo $i | sed -e 's@\./@@' -e 's@/@-@g')" | 182 cp $i "$WEBDIR"/readme/"$(echo $i | sed -e 's@\./@@' -e 's@/@-@g')" |
188 > "$WEBDIR"/temp-linuxrfc.txt && | 190 > "$WEBDIR"/temp-linuxrfc.txt && |
189 cd "$LNXDIR" || exit 1 | 191 cd "$LNXDIR" || exit 1 |
190 echo -n "Search for RFC references" | 192 echo -n "Search for RFC references" |
191 x=0 | 193 x=0 |
192 # Iterate through *.c and *.h in the Linux source code. | 194 # Iterate through *.c and *.h in the Linux source code. |
193 for i in `find "$LNXDIR"/hg -name "*.[hc]"` | 195 for i in `find "$LNXDIR" -name "*.[hc]"` |
194 do | 196 do |
195 # Progress indicator | 197 # Progress indicator |
196 x=$[$x+1] | 198 x=$[$x+1] |
197 if [ $x -gt 100 ] | 199 if [ $x -gt 100 ] |
198 then | 200 then |
216 echo "<html><head><title>RFCs used by the Linux kernel</title></head>" | 218 echo "<html><head><title>RFCs used by the Linux kernel</title></head>" |
217 echo "<ul>" | 219 echo "<ul>" |
218 for i in $(sed 's/.*://' temp-linuxrfc.txt | sort -u | sort -t c -k 2,2 -n) | 220 for i in $(sed 's/.*://' temp-linuxrfc.txt | sort -u | sort -t c -k 2,2 -n) |
219 do | 221 do |
220 echo '<li><h2><a href="http://tools.ietf.org/html/'$i'">'$i'</a></h2><p>' | 222 echo '<li><h2><a href="http://tools.ietf.org/html/'$i'">'$i'</a></h2><p>' |
221 for j in $(sed -rn 's@\'"$LNXDIR"/hg'(.*):'$i'$@\1@p' temp-linuxrfc.txt) | 223 for j in $(sed -rn 's@\'"$LNXDIR"'(.*):'$i'$@\1@p' temp-linuxrfc.txt) |
222 do | 224 do |
223 echo '<a href="http://kernel.org/hg/linux-2.6/file/tip/'$j'">'$j'</a>' | 225 echo '<a href="http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=tree;f='"$j"';h=master">'$j'</a>' |
224 done | 226 done |
225 echo "</p></li>" | 227 echo "</p></li>" |
226 done | 228 done |
227 echo "</ul></html>" | 229 echo "</ul></html>" |
228 ) > "$WEBDIR"/rfc-linux.html && | 230 ) > "$WEBDIR"/rfc-linux.html && |
233 | 235 |
234 # Set up for out of tree build of Linux. | 236 # Set up for out of tree build of Linux. |
235 | 237 |
236 function setuplinuxtemp() | 238 function setuplinuxtemp() |
237 { | 239 { |
240 # Stub this out for now | |
241 return 0 | |
242 | |
238 rm -rf "$LNXDIR"/temp && | 243 rm -rf "$LNXDIR"/temp && |
239 mkdir "$LNXDIR"/temp && | 244 mkdir "$LNXDIR"/temp && |
240 # Building out of tree conflicts with patching the files, so copy. | 245 # Building out of tree conflicts with patching the files, so copy. |
241 cp -lr "$LNXDIR"/hg/* "$LNXDIR"/temp && | 246 cp -lr "$LNXDIR"/hg/* "$LNXDIR"/temp && |
242 ( | 247 ( |