From 0bd81ca4dd04b4eb9020b2e05976417f556349da Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sun, 31 May 2015 05:15:47 -0500 Subject: Redo mkstatus.py to grep pending for pending data and trust toybox defconfig output for ready command list, to reduce manual updating. --- scripts/mkstatus.py | 73 +++++++++++++++++++++++++++++++++-------------------- www/status.html | 48 ----------------------------------- 2 files changed, 46 insertions(+), 75 deletions(-) diff --git a/scripts/mkstatus.py b/scripts/mkstatus.py index 82592c71..3b1bbc8b 100755 --- a/scripts/mkstatus.py +++ b/scripts/mkstatus.py @@ -4,10 +4,10 @@ import subprocess,sys -def readit(args): +def readit(args, shell=False): ret={} arr=[] - blob=subprocess.Popen(args, stdout=subprocess.PIPE, shell=False) + blob=subprocess.Popen(args, stdout=subprocess.PIPE, shell=shell) for i in blob.stdout.read().split("\n"): if not i: continue i=i.split() @@ -15,36 +15,37 @@ def readit(args): arr.extend(i) return ret,arr -# Run sed on roadmap and status pages to get command lists, and run toybox too +# Run sed on roadmap and source to get command lists, and run toybox too # This gives us a dictionary of types, each with a list of commands +print "Collecting data..." + stuff,blah=readit(["sed","-n", 's//\\1 /;t good;d;:good;h;:loop;n;s@@@;t out;H;b loop;:out;g;s/\\n/ /g;p', "www/roadmap.html", "www/status.html"]) blah,toystuff=readit(["./toybox"]) +blah,pending=readit(["sed -n 's/[^ \\t].*TOY(\\([^,]*\\),.*/\\1/p' toys/pending/*.c"], 1) +blah,version=readit(["git","describe","--tags"]) + +print "Analyzing..." -# Create reverse mappings: command is in which +# Create reverse mappings: reverse["command"] gives list of categories it's in reverse={} for i in stuff: for j in stuff[i]: try: reverse[j].append(i) except: reverse[j]=[i] +print "all commands=%s" % len(reverse) + +# Run a couple sanity checks on input for i in toystuff: - try: - if ("ready" in reverse[i]) and ("pending" in reverse[i]): print "barf", i - except: pass - try: - if ("ready" in reverse[i]) or ("pending" in reverse[i]): continue - except: pass - print "Not ready or pending:", i - -pending=[] -done=[] + if (i in pending): print "barf %s" % i -print "all commands=%s" % len(reverse) +unknowns=[] +for i in toystuff + pending: + if not i in reverse: unknowns.append(i) -outfile=open("www/status.gen", "w") -outfile.write("

All commands

\n") +if unknowns: print "uncategorized: %s" % " ".join(unknowns) conv = [("posix", '%%s', "[%s]"), ("lsb", '%%s', '<%s>'), @@ -72,22 +73,38 @@ def categorize(reverse, i, skippy=""): return linky % out +# Sort/annotate done, pending, and todo item lists + +allcmd=[] +done=[] +pend=[] +todo=[] blah=list(reverse) blah.sort() for i in blah: out=categorize(reverse, i) - if "ready" in reverse[i] or "pending" in reverse[i]: - done.append(out) + allcmd.append(out) + if i in toystuff or i in pending: + if i in toystuff: done.append(out) + else: pend.append(out) out='%s' % out - else: pending.append(out) + else: todo.append(out) + +print "implemented=%s" % len(toystuff) - outfile.write(out+"\n") +# Write data to output file -print "done=%s" % len(done) -outfile.write("

\n") +outfile=open("www/status.gen", "w") +outfile.write("

Status of toybox %s

\n" % version[0]); +outfile.write("

Legend: [posix] <lsb> (development) {android}\n") +outfile.write("=klibc= #sash# @sbase@ *beastiebox* $tizen$ +request+ other\n") +outfile.write("pending

\n"); + +outfile.write("

Completed

%s

\n" % "\n".join(done)) +outfile.write("

Partially implemented

%s

\n" % "\n".join(pend)) +outfile.write("

Not started yet

%s

\n" % "\n".join(todo)) -outfile.write("

TODO

%s

\n" % "\n".join(pending)) -outfile.write("

Done

%s

\n" % "\n".join(done)) +# Output unfinished commands by category outfile.write("

Categories of remaining todo items

") @@ -95,8 +112,8 @@ for i in stuff: todo = [] for j in stuff[i]: - if "ready" in reverse[j]: continue - elif "pending" in reverse[j]: todo.append('%s' % j) + if j in toystuff: continue + if j in pending: todo.append('%s' % j) else: todo.append(categorize(reverse,j,i)) if todo: @@ -108,3 +125,5 @@ for i in stuff: outfile.write("

%s

" % (i,i,k)) outfile.write(" ".join(todo)) outfile.write("

\n") + +outfile.write("

All commands together in one big list

%s

\n" % "\n".join(allcmd)) diff --git a/www/status.html b/www/status.html index bb0c7ad4..8d500800 100755 --- a/www/status.html +++ b/www/status.html @@ -2,56 +2,8 @@ Toybox Status -

How are we doing on implementing stuff so far?

- -

Legend: [posix] <lsb> (development) {android} =klibc= #sash# @sbase@ -*beastiebox* $tizen$ +request+ other implemented

- -

The current status of toybox (as of 0.5.2 release):

- -

These commands are reasonably finished (in defconfig):

-
- -acpi basename blkid blockdev bzcat cal cat catv chattr chgrp chmod -chown chvt cksum clear cmp comm count cp cpio date df dirname -dmesg dos2unix echo egrep eject env factor fallocate false -fgrep find free freeramdisk fsfreeze fstype grep groups halt head -help hostname id ifconfig inotifyd insmod install kill killall killall5 -link ln logname losetup ls lsattr lsmod lspci lsusb makedevs -md5sum mkdir mkfifo mknod mkpasswd mkswap mktemp mount -mv nbd-client nc netcat nice nl nohup od oneit partprobe passwd paste -patch pidof pivot_root pmap poweroff printenv pwd pwdx readahead readlink -realpath reboot renice rev rfkill rm rmdir rmmod seq setsid sha1sum -sleep sort split stat strings su swapoff swapon switch_root sync sysctl -tac tail taskset tee time timeout true truncate tty umount uname -uniq unix2dos unlink unshare uptime usleep uudecode uuencode -w wc which who whoami yes sed mix base64 - -
- -

These commands are at least partially implemented (in toys/pending) -but have todo items remaining:

-
- -ar arp arping bc bootchartd brctl compress crond dhcp dhcpd diff dumpleases -expr fdisk fold fsck ftpget getty groupadd groupdel host iconv init ip ipcs -kexec klogd last logger mdev mix mke2fs modprobe more netstat openvt p9d pgrep -ping printf ps reset route sh sulogin syslogd tar tcpsvd telnet telnetd test -tftpd top traceroute tr useradd userdel watch xzcat - -
- -

These commands predate the pending directory but also have unfinished -todo items:

- -
- -vmstat login du vconfig mountpoint chroot cut touch modinfo expand xargs - -
-

There is also a todo list, but development's moved on a bit since it was written.

-- cgit v1.2.3