aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-apps/openrc/files/0.2.5/0002-useful-functions.patch')
-rw-r--r--sys-apps/openrc/files/0.2.5/0002-useful-functions.patch79
1 files changed, 79 insertions, 0 deletions
diff --git a/sys-apps/openrc/files/0.2.5/0002-useful-functions.patch b/sys-apps/openrc/files/0.2.5/0002-useful-functions.patch
new file mode 100644
index 0000000..91969a1
--- /dev/null
+++ b/sys-apps/openrc/files/0.2.5/0002-useful-functions.patch
@@ -0,0 +1,79 @@
+From c5552432d21e964ea1dbda7415040259b87ea77e Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Mon, 24 Mar 2008 02:03:39 -0400
+Subject: [PATCH] add a softlevel() function to the API so people dont have to worry about inner details and move get_bootparam back to the exported function.sh api
+
+---
+ sh/functions.sh.in | 27 +++++++++++++++++++++++++++
+ sh/rc-functions.sh.in | 22 ----------------------
+ 2 files changed, 27 insertions(+), 22 deletions(-)
+
+diff --git a/sh/functions.sh.in b/sh/functions.sh.in
+index 1a1fbba..140f6dc 100644
+--- a/sh/functions.sh.in
++++ b/sh/functions.sh.in
+@@ -38,6 +38,28 @@ yesno()
+ esac
+ }
+
++get_bootparam()
++{
++ local match="$1"
++ [ -z "${match}" -o ! -r /proc/cmdline ] && return 1
++
++ set -- $(cat /proc/cmdline)
++ while [ -n "$1" ]; do
++ case "$1" in
++ gentoo=*)
++ local params="${1##*=}"
++ local IFS=, x=
++ for x in ${params}; do
++ [ "${x}" = "${match}" ] && return 0
++ done
++ ;;
++ esac
++ shift
++ done
++
++ return 1
++}
++
+ _sanitize_path()
+ {
+ local IFS=":" p= path=
+diff --git a/sh/rc-functions.sh.in b/sh/rc-functions.sh.in
+index 74db71e..eb45e49 100644
+--- a/sh/rc-functions.sh.in
++++ b/sh/rc-functions.sh.in
+@@ -51,28 +51,6 @@ is_union_fs()
+ unionctl "$1" --list >/dev/null 2>&1
+ }
+
+-get_bootparam()
+-{
+- local match="$1"
+- [ -z "${match}" -o ! -r /proc/cmdline ] && return 1
+-
+- set -- $(cat /proc/cmdline)
+- while [ -n "$1" ]; do
+- case "$1" in
+- gentoo=*)
+- local params="${1##*=}"
+- local IFS=, x=
+- for x in ${params}; do
+- [ "${x}" = "${match}" ] && return 0
+- done
+- ;;
+- esac
+- shift
+- done
+-
+- return 1
+-}
+-
+ # Add our sbin to $PATH
+ case "${PATH}" in
+ @PREFIX@/lib/rc/sbin|@PREFIX@/lib/rc/sbin:*);;
+--
+1.5.4.4
+