summaryrefslogtreecommitdiff
path: root/rc/bin/patch/apply
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2022-05-22 17:27:31 +0000
committerOri Bernstein <ori@eigenstate.org>2022-05-22 17:27:31 +0000
commita59e61a6a4e11e0256da0d209afa38ccacd460a2 (patch)
tree549dfadf95e33c523a8d097e000e687f496e2686 /rc/bin/patch/apply
parent23f8872bc10fbe9ffd2b0067db1f91d8eaaabb40 (diff)
patch(1): remove bell labs patch scripts
bell labs is dead, and nobody is listening; 9front has our own patch submission proces.
Diffstat (limited to 'rc/bin/patch/apply')
-rwxr-xr-xrc/bin/patch/apply79
1 files changed, 0 insertions, 79 deletions
diff --git a/rc/bin/patch/apply b/rc/bin/patch/apply
deleted file mode 100755
index 16b71c84a..000000000
--- a/rc/bin/patch/apply
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/bin/rc
-
-rfork e
-
-if(! ~ $#* 1){
- echo 'usage: patch/apply patch-name' >[1=2]
- exit usage
-}
-
-if(! test -d /n/sources/patch){
- rfork n
- 9fs sources
-}
-
-if(! test -d /n/sources/patch/$1){
- echo 'no such patch' /n/sources/patch/$1 >[1=2]
- exit nopatch
-}
-
-builtin cd /n/sources/patch/$1 || exit nopatch
-if(! patch/okay .){
- echo 'bad patch: '$status >[1=2]
- exit badpatch
-}
-
-if(! echo >.tmp || ! rm .tmp){
- echo no write permission >[1=2]
- exit 'no write permission'
-}
-
-echo -n merge... >[1=2]
-fn xxx {
- if(! test -f $1)
- cp $2 $2.new
- if not
- ape/diff3 -m $1 $2.orig $2 >$2.new
- if(grep -s '^<<<<' $2.new){
- echo conflicts merging $1';' see `{pwd}^/$2.new >[1=2]
-
- touch failed
- }
-}
-rm -f failed
-cat files | sed 's/^/xxx /' | rc
-if(test -f failed){
- echo exiting without changes >[1=2]
- exit failed
-}
-
-echo -n backup... >[1=2]
-fn xxx {
- # echo cp $1 $2.backup
- cp $1 $2.backup
-}
-cat files | sed 's/^/xxx /' |rc
-
-echo -n copy... >[1=2]
-fn xxx {
- # echo cp $2.new $1
- cp $2.new $1 || touch failed
-}
-cat files | sed 's/^/xxx /' | rc
-
-fn xxx {
- # echo cp $2.backup $1
- cp $2.backup $1
-}
-
-if(test -f failed){
- echo copying failed, restoring backups >[1=2]
- cat files | sed 's/^/xxx /' | rc
- exit failed
-}
-
-echo >[1=2]
-
-echo to update sources: >[1=2]
-cat files | awk '{print " update " $1 }' >[1=2]
-