summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-apps/openrc/files/0.5.2/0002-useful-functions.patch')
-rw-r--r--sys-apps/openrc/files/0.5.2/0002-useful-functions.patch78
1 files changed, 78 insertions, 0 deletions
diff --git a/sys-apps/openrc/files/0.5.2/0002-useful-functions.patch b/sys-apps/openrc/files/0.5.2/0002-useful-functions.patch
new file mode 100644
index 000000000000..edd226c48d3a
--- /dev/null
+++ b/sys-apps/openrc/files/0.5.2/0002-useful-functions.patch
@@ -0,0 +1,78 @@
+From 79e8ce8d2ea0ede99aba18d5f9a625a110aa918f 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 | 22 ++++++++++++++++++++++
+ sh/rc-functions.sh.in | 23 -----------------------
+ 2 files changed, 22 insertions(+), 23 deletions(-)
+
+diff --git a/sh/functions.sh.in b/sh/functions.sh.in
+index 3f41f8f..be5285c 100644
+--- a/sh/functions.sh.in
++++ b/sh/functions.sh.in
+@@ -42,6 +42,29 @@ rc_runlevel() {
+ rc-status --runlevel
+ }
+
++get_bootparam()
++{
++ local match="$1"
++ [ -z "$match" -o ! -r /proc/cmdline ] && return 1
++
++ set -- $(cat /proc/cmdline)
++ while [ -n "$1" ]; do
++ [ "$1" = "$match" ] && return 0
++ 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 ebdb768..68cd6e7 100644
+--- a/sh/rc-functions.sh.in
++++ b/sh/rc-functions.sh.in
+@@ -61,29 +61,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
+- [ "$1" = "$match" ] && return 0
+- 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
+ "$RC_LIBDIR"/sbin|"$RC_LIBDIR"/sbin:*);;