commit - f6bc91491578a01364d319f792713a1679676e2e
commit + 4de03b544c82f36e172d7fc395276c12ecda5b7c
blob - a3c10e119fcd590bc10a23624b95a7c3befa44f6
blob + 82c771b812b25c0c3326bb76d073aea2142c70b4
--- man/man7/plumb.7
+++ man/man7/plumb.7
The contents of the
.B wdir
field of the message.
+.TP
+.B $plan9
+The root directory of the Plan 9 tree
+(see
+.IR get9root (3)).
.RE
.SH EXAMPLE
The following is a modest, representative file of plumbing rules.
blob - 464b954c86836e684b8d2b50935d70723e778f7f
blob + 4edd4327c731bbf8476ca0956dc16492d0dfe54c
--- plumb/basic
+++ plumb/basic
data matches '([a-zA-Z¡-0-9_\-./]+)\.(jpe?g|JPE?G|gif|GIF|tiff?|TIFF?|ppm|bit|png|PNG)'
arg isfile $0
plumb to image
-plumb start qiv -t $file
+plumb start page $file
# postscript/pdf/dvi go to page but not over the a plumb port
# the port is here for reference but is unused
data matches '([a-zA-Z¡-0-9_\-./]+)\.(ps|PS|eps|EPS|pdf|PDF|dvi|DVI)'
arg isfile $0
plumb to postscript
-plumb start psv $file
-# plumb start page -w $file
+plumb start page $file
# open office - s[xt][cdigmw], doc, xls, ppt
data matches '[a-zA-Z¡-0-9_\-./]+'
plumb to edit
plumb client $editor
-# .h files are looked up in /usr/local/plan9/include and passed to edit
+# .h files are looked up in $plan9/include and passed to edit
type is text
data matches '([a-zA-Z¡-0-9]+\.h)('$addr')?'
-arg isfile /usr/local/plan9/include/$1
+arg isfile $plan9/include/$1
data set $file
attr add addr=$3
plumb to edit
dst is image
arg isfile $data
plumb to image
-plumb start qiv -t $data
+plumb start page $data
# start rule for postscript without known suffixes
dst is postscript
arg isfile $data
-plumb start gv $data
+plumb start page $data
blob - ab27787d670cd4dfcfcc7b4e69f89cb8101c38ee
blob + be6753295b3000d739eb3a99d1ae538b43665a9e
--- src/cmd/plumb/rules.c
+++ src/cmd/plumb/rules.c
Ruleset *rs;
Rule *r;
int eof, inrule, i, ncmd;
+ char *plan9root;
+ plan9root = get9root();
+ if(plan9root)
+ setvariable("plan9", 5, plan9root, plan9root);
+
Again:
eof = 0;
rs = emalloc(sizeof(Ruleset));