summaryrefslogtreecommitdiff
path: root/acme/wiki/wiki.diff
diff options
context:
space:
mode:
Diffstat (limited to 'acme/wiki/wiki.diff')
-rwxr-xr-xacme/wiki/wiki.diff27
1 files changed, 27 insertions, 0 deletions
diff --git a/acme/wiki/wiki.diff b/acme/wiki/wiki.diff
new file mode 100755
index 000000000..6214571b9
--- /dev/null
+++ b/acme/wiki/wiki.diff
@@ -0,0 +1,27 @@
+#!/bin/rc
+
+rfork n
+cd $1
+*=(`{ls -drp [0-9]*})
+
+while(! ~ $#* 0 1){
+ diff -n $2/index.txt $1/index.txt | awk -F'[\/ :]' '
+ $1 ~/^[0-9]+$/ {
+ getA = "cat "$5"/current | sed -n -e ''1d; /^A/s/^A//p; /^#/q''"
+ getA | getline A; close getA
+ $1 = t2d($1)
+ $5 = t2d($5)
+ print "\n" A ":\n" $1":"$3" "$4" "$5":"$7
+ next
+ }
+ { print }
+
+ function t2d(t) {
+ c = "date "t; c|getline l; close c
+ split(l, a, "[ :]+")
+ return a[1]" "a[2]" "a[3]" "a[4]":"a[5]" "a[8]"("t")"
+ }'
+ shift
+}
+
+echo clean >/dev/ctl >[2]/dev/null