annotate scripts/mkstatus.py @ 672:9d5959d6885d

Test tweaks. Set +x on two scripts (so they can be run standalone), fix chgrp so it doesn't abort test all.
author Rob Landley <rob@landley.net>
date Sun, 07 Oct 2012 22:57:27 -0500
parents 3c591e7a367d
children ae3455c2989b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
635
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
1 #!/usr/bin/python
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
2
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
3 import subprocess,sys
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
4
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
5 stuff={}
639
3c591e7a367d More web page roadmap/status update stuff.
Rob Landley <rob@landley.net>
parents: 635
diff changeset
6 blob=subprocess.Popen(["sed","-n", 's/<span id=\\([a-z_]*\\)>/\\1 /;t good;d;:good;h;:loop;n;s@</span>@@;t out;H;b loop;:out;g;s/\\n/ /g;p', "www/roadmap.html", "www/status.html"], stdout=subprocess.PIPE, shell=False)
635
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
7 for i in blob.stdout.read().split("\n"):
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
8 if not i: continue
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
9 i=i.split()
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
10 stuff[i[0]]=i[1:]
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
11
639
3c591e7a367d More web page roadmap/status update stuff.
Rob Landley <rob@landley.net>
parents: 635
diff changeset
12 stuff['toolbox'].extend(stuff['toolbox_std'])
3c591e7a367d More web page roadmap/status update stuff.
Rob Landley <rob@landley.net>
parents: 635
diff changeset
13 del stuff['toolbox_std']
3c591e7a367d More web page roadmap/status update stuff.
Rob Landley <rob@landley.net>
parents: 635
diff changeset
14
635
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
15 reverse={}
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
16 for i in stuff:
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
17 for j in stuff[i]:
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
18 try:
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
19 reverse[j].append(i)
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
20 except:
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
21 reverse[j]=[i]
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
22
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
23 pending=[]
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
24 done=[]
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
25
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
26 outfile=open("www/status.gen", "w")
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
27 outfile.write("<h2>All commands</h2><blockquote><p>\n")
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
28
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
29 blah=list(reverse)
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
30 blah.sort()
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
31 for i in blah:
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
32 out=i
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
33 if "posix" in reverse[i]: out='[<a href="http://opengroup.org/onlinepubs/9699919799/utilities/%s.html">%s</a>]' % (i,out)
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
34 elif "lsb" in reverse[i]: out='&lt;<a href="http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/%s.html">%s</a>&gt;' % (i,out)
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
35 elif "development" in reverse[i]: out='(<a href="http://linux.die.net/man/1/%s">%s</a>)' % (i,out)
639
3c591e7a367d More web page roadmap/status update stuff.
Rob Landley <rob@landley.net>
parents: 635
diff changeset
36 elif "request" in reverse[i]: out='<a href="http://linux.die.net/man/1/%s">%s</a>' % (i,out)
635
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
37 elif "toolbox" in reverse[i]: out='{%s}' % out
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
38 elif "ready" in reverse[i]: pass
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
39 else: sys.stderr.write("unknown %s %s\n" % (i, reverse[i]))
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
40
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
41 if "ready" in reverse[i] or "pending" in reverse[i]:
639
3c591e7a367d More web page roadmap/status update stuff.
Rob Landley <rob@landley.net>
parents: 635
diff changeset
42 done.append(out)
635
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
43 out='<strike>%s</strike>' % out
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
44 else: pending.append(out)
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
45
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
46 outfile.write(out+"\n")
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
47
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
48 outfile.write("</p></blockquote>\n")
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
49
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
50 outfile.write("<h2>TODO</h2><blockquote><p>%s</p></blockquote>\n" % "\n".join(pending))
cffb9b7f1c60 Add status.html and script to calculate it from roadmap info.
Rob Landley <rob@landley.net>
parents:
diff changeset
51 outfile.write("<h2>Done</h2><blockquote><p>%s</p></blockquote>\n" % "\n".join(done))