summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2016-05-18 23:30:04 -0700
committerMichael Forney <mforney@mforney.org>2016-05-18 23:30:04 -0700
commitcc43c4d329a9e291e6599164fbec4a3cea41b0b7 (patch)
tree9bc4cf4bccbd73f134ec7ace0f1f1a2957b5f342
parent722e58fa6ff0e89383479258e1cb62bbab987d1a (diff)
plan9port: Add some rc patches
-rw-r--r--core/plan9port/patch/0001-Fix-build-with-musl.patch4
-rw-r--r--core/plan9port/patch/0002-rc-Look-for-lib-rcmain.patch58
-rw-r--r--core/plan9port/patch/0003-rcmain-Don-t-use-PLAN9-bin-9.patch30
3 files changed, 90 insertions, 2 deletions
diff --git a/core/plan9port/patch/0001-Fix-build-with-musl.patch b/core/plan9port/patch/0001-Fix-build-with-musl.patch
index 2aff4071..65507008 100644
--- a/core/plan9port/patch/0001-Fix-build-with-musl.patch
+++ b/core/plan9port/patch/0001-Fix-build-with-musl.patch
@@ -1,4 +1,4 @@
-From 51ab047274d90b1c6b7a26b2b41992b176543d05 Mon Sep 17 00:00:00 2001
+From bc48772672bdb1436455e078b17df47a63813394 Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Sun, 10 Apr 2016 02:50:03 -0700
Subject: [PATCH] Fix build with musl
@@ -58,5 +58,5 @@ index 40fbe3c..345f49c 100644
#if defined(__DragonFly__)
static inline int d_reclen(struct dirent *de) { return _DIRENT_DIRSIZ(de); }
--
-2.8.0
+2.8.1
diff --git a/core/plan9port/patch/0002-rc-Look-for-lib-rcmain.patch b/core/plan9port/patch/0002-rc-Look-for-lib-rcmain.patch
new file mode 100644
index 00000000..dbe342ee
--- /dev/null
+++ b/core/plan9port/patch/0002-rc-Look-for-lib-rcmain.patch
@@ -0,0 +1,58 @@
+From 73124caea18f5d36417ec24b8e69b540daf97bc2 Mon Sep 17 00:00:00 2001
+From: Michael Forney <mforney@mforney.org>
+Date: Wed, 18 May 2016 22:58:17 -0700
+Subject: [PATCH] rc: Look for /lib/rcmain
+
+---
+ src/cmd/rc/exec.c | 2 +-
+ src/cmd/rc/plan9ish.c | 6 +-----
+ src/cmd/rc/rc.h | 2 +-
+ 3 files changed, 3 insertions(+), 7 deletions(-)
+
+diff --git a/src/cmd/rc/exec.c b/src/cmd/rc/exec.c
+index 03c96d4..1fb9be5 100644
+--- a/src/cmd/rc/exec.c
++++ b/src/cmd/rc/exec.c
+@@ -147,7 +147,7 @@ main(int argc, char *argv[])
+ if(flag['I'])
+ flag['i'] = 0;
+ else if(flag['i']==0 && argc==1 && Isatty(0)) flag['i'] = flagset;
+- rcmain = flag['m'] ? flag['m'][0] : Rcmain();
++ rcmain = flag['m'] ? flag['m'][0] : Rcmain;
+ err = openfd(2);
+ kinit();
+ Trapinit();
+diff --git a/src/cmd/rc/plan9ish.c b/src/cmd/rc/plan9ish.c
+index da9d867..60c0ee4 100644
+--- a/src/cmd/rc/plan9ish.c
++++ b/src/cmd/rc/plan9ish.c
+@@ -24,12 +24,8 @@ char *syssigname[]={
+ "term",
+ 0
+ };
+-char*
+-Rcmain(void)
+-{
+- return unsharp("#9/rcmain");
+-}
+
++char Rcmain[]="/lib/rcmain";
+ char Fdprefix[]="/dev/fd/";
+ long readnb(int, char *, long);
+ void execfinit(void);
+diff --git a/src/cmd/rc/rc.h b/src/cmd/rc/rc.h
+index 7778ff4..986b8be 100644
+--- a/src/cmd/rc/rc.h
++++ b/src/cmd/rc/rc.h
+@@ -135,7 +135,7 @@ int doprompt; /* is it time for a prompt? */
+ */
+ #define PRD 0
+ #define PWR 1
+-extern char *Rcmain(), Fdprefix[];
++extern char Rcmain[], Fdprefix[];
+ #define register
+ /*
+ * How many dot commands have we executed?
+--
+2.8.1
+
diff --git a/core/plan9port/patch/0003-rcmain-Don-t-use-PLAN9-bin-9.patch b/core/plan9port/patch/0003-rcmain-Don-t-use-PLAN9-bin-9.patch
new file mode 100644
index 00000000..04c884b0
--- /dev/null
+++ b/core/plan9port/patch/0003-rcmain-Don-t-use-PLAN9-bin-9.patch
@@ -0,0 +1,30 @@
+From 4e822f477a9d1c71c5489e59bd30ee4b3e2f5058 Mon Sep 17 00:00:00 2001
+From: Michael Forney <mforney@mforney.org>
+Date: Wed, 18 May 2016 23:02:03 -0700
+Subject: [PATCH] rcmain: Don't use $PLAN9/bin/9
+
+---
+ rcmain | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/rcmain b/rcmain
+index 461cb3e..a73014d 100644
+--- a/rcmain
++++ b/rcmain
+@@ -29,11 +29,11 @@ if(flag i){
+ # is not sufficient when running in a subshell
+ # that is rc -e (like mk uses!)
+ if(builtin cd $1){
+- if(flag i) $PLAN9/bin/9 awd || status=''
++ if(flag i) awd || status=''
+ status=''
+ }
+ }
+- $PLAN9/bin/9 awd
++ awd
+ }
+ if(flag l && test -r $home/lib/profile) . $home/lib/profile
+ status=''
+--
+2.8.1
+