summaryrefslogtreecommitdiff
path: root/patch/patch-orig
diff options
context:
space:
mode:
Diffstat (limited to 'patch/patch-orig')
-rw-r--r--patch/patch-orig/email1
-rw-r--r--patch/patch-orig/files1
-rw-r--r--patch/patch-orig/notes0
-rwxr-xr-xpatch/patch-orig/orig16
-rw-r--r--patch/patch-orig/readme9
5 files changed, 27 insertions, 0 deletions
diff --git a/patch/patch-orig/email b/patch/patch-orig/email
new file mode 100644
index 0000000..191feb6
--- /dev/null
+++ b/patch/patch-orig/email
@@ -0,0 +1 @@
+john@ankarstrom.se
diff --git a/patch/patch-orig/files b/patch/patch-orig/files
new file mode 100644
index 0000000..6446d4d
--- /dev/null
+++ b/patch/patch-orig/files
@@ -0,0 +1 @@
+/rc/bin/patch/orig orig
diff --git a/patch/patch-orig/notes b/patch/patch-orig/notes
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/patch/patch-orig/notes
diff --git a/patch/patch-orig/orig b/patch/patch-orig/orig
new file mode 100755
index 0000000..16db50d
--- /dev/null
+++ b/patch/patch-orig/orig
@@ -0,0 +1,16 @@
+#!/bin/rc -e
+
+p=`{cleanname -d `{pwd} $1}
+n=`{echo $p | sed 's,\.orig,,'}
+dir=`{basename -d $p}
+
+if(! test -d /n/sources/plan9){
+ rfork n
+ 9fs sources
+}
+
+if(test -e /n/sources/plan9$n)
+ echo /n/sources/plan9$n: replacing existing file >[1=2]
+mkdir -p /n/sources/plan9$dir
+echo cp $p /n/sources/plan9$n
+cp $p /n/sources/plan9$n
diff --git a/patch/patch-orig/readme b/patch/patch-orig/readme
new file mode 100644
index 0000000..01e70ea
--- /dev/null
+++ b/patch/patch-orig/readme
@@ -0,0 +1,9 @@
+patch/orig copies a file to /n/sources/plan9
+
+It may not always be desirable to have an entire
+source tree in /n/sources/plan9.
+For simple patch work, it is sufficient to copy
+the original file to /n/sources/plan9.
+This is what patch/orig does.
+
+(It also ignores .orig in the given path.)