diff options
author | Doug Goldstein <cardoe@gentoo.org> | 2008-10-06 16:56:50 +0000 |
---|---|---|
committer | Doug Goldstein <cardoe@gentoo.org> | 2008-10-06 16:56:50 +0000 |
commit | 76de7da8e5cf3d26068f35c65ad4a7c22536122e (patch) | |
tree | df83947aa1983699e142dec733c55adc1e04e8ec /sys-apps/openrc/files | |
parent | Version bumped. Changed LICENSE. (diff) | |
download | gentoo-2-76de7da8e5cf3d26068f35c65ad4a7c22536122e.tar.gz gentoo-2-76de7da8e5cf3d26068f35c65ad4a7c22536122e.tar.bz2 gentoo-2-76de7da8e5cf3d26068f35c65ad4a7c22536122e.zip |
version bump. forward port patches from 0.2.x and include some upstream fixes
(Portage version: 2.2_rc11/cvs/Linux 2.6.26-gentoo-r1 x86_64)
Diffstat (limited to 'sys-apps/openrc/files')
5 files changed, 331 insertions, 0 deletions
diff --git a/sys-apps/openrc/files/0.3.0/0001-Fix-a-segfault-when-profile.env-does-not-exist.patch b/sys-apps/openrc/files/0.3.0/0001-Fix-a-segfault-when-profile.env-does-not-exist.patch new file mode 100644 index 000000000000..610b13f5dc58 --- /dev/null +++ b/sys-apps/openrc/files/0.3.0/0001-Fix-a-segfault-when-profile.env-does-not-exist.patch @@ -0,0 +1,54 @@ +From 908a084d0ed193f6ec1b4017438cb4bbf3814b7f Mon Sep 17 00:00:00 2001 +From: Roy Marples <roy@uberpc.marples.name> +Date: Fri, 3 Oct 2008 18:50:10 +0100 +Subject: [PATCH] Fix a segfault when profile.env does not exist. + +--- + src/rc/rc-misc.c | 17 +++++++++-------- + 1 files changed, 9 insertions(+), 8 deletions(-) + +diff --git a/src/rc/rc-misc.c b/src/rc/rc-misc.c +index d94cd2e..d4b3ca0 100644 +--- a/src/rc/rc-misc.c ++++ b/src/rc/rc-misc.c +@@ -128,13 +128,13 @@ void env_filter(void) + size_t i = 0; + + /* Add the user defined list of vars */ +- env_allow = rc_stringlist_split(rc_conf_value ("rc_env_allow"), " "); ++ env_allow = rc_stringlist_split(rc_conf_value("rc_env_allow"), " "); + if (exists(PROFILE_ENV)) + profile = rc_config_load(PROFILE_ENV); + + /* Copy the env and work from this so we can manipulate it safely */ + env_list = rc_stringlist_new(); +- while (environ[i]) { ++ while (environ && environ[i]) { + env = rc_stringlist_add(env_list, environ[i++]); + e = strchr(env->value, '='); + if (e) +@@ -159,14 +159,15 @@ void env_filter(void) + } + + /* Now add anything missing from the profile */ +- TAILQ_FOREACH(env, profile, entries) { +- e = strchr(env->value, '='); +- *e = '\0'; +- if (!getenv(env->value)) +- setenv(env->value, e + 1, 1); ++ if (profile) { ++ TAILQ_FOREACH(env, profile, entries) { ++ e = strchr(env->value, '='); ++ *e = '\0'; ++ if (!getenv(env->value)) ++ setenv(env->value, e + 1, 1); ++ } + } + +- + rc_stringlist_free(env_list); + rc_stringlist_free(env_allow); + rc_stringlist_free(profile); +-- +1.6.0.2 + diff --git a/sys-apps/openrc/files/0.3.0/0002-kenv-is-not-always-available.patch b/sys-apps/openrc/files/0.3.0/0002-kenv-is-not-always-available.patch new file mode 100644 index 000000000000..d7bd443cab3e --- /dev/null +++ b/sys-apps/openrc/files/0.3.0/0002-kenv-is-not-always-available.patch @@ -0,0 +1,31 @@ +From 19f8761365b825ae9949559048afd90c2f662de8 Mon Sep 17 00:00:00 2001 +From: Roy Marples <roy@uberpc.marples.name> +Date: Fri, 3 Oct 2008 18:50:30 +0100 +Subject: [PATCH] kenv is not always available. + +--- + init.d/hostid.in | 8 +++++--- + 1 files changed, 5 insertions(+), 3 deletions(-) + +diff --git a/init.d/hostid.in b/init.d/hostid.in +index a058884..584fd2d 100644 +--- a/init.d/hostid.in ++++ b/init.d/hostid.in +@@ -38,9 +38,11 @@ _set() + # otherwise we generate a random UUID. + reset() + { +- local uuid=$(kenv smbios.system.uuid 2>/dev/null) +- local x="[0-9a-f]" +- local y="${x}${x}${x}${x}" ++ local uuid= x="[0-9a-f]" y="${x}${x}${x}${x}" ++ ++ if type kenv >/dev/null 2>&1; then ++ uuid=$(kenv smbios.system.uuid 2>/dev/null) ++ fi + case "${uuid}" in + ${y}${y}-${y}-${y}-${y}-${y}${y}${y});; + *) uuid=;; +-- +1.6.0.2 + diff --git a/sys-apps/openrc/files/0.3.0/0003-This-reverts-commit-0e2f160c95b15e95f3885e3f5a3670ec.patch b/sys-apps/openrc/files/0.3.0/0003-This-reverts-commit-0e2f160c95b15e95f3885e3f5a3670ec.patch new file mode 100644 index 000000000000..83250151502f --- /dev/null +++ b/sys-apps/openrc/files/0.3.0/0003-This-reverts-commit-0e2f160c95b15e95f3885e3f5a3670ec.patch @@ -0,0 +1,46 @@ +From ce2effcad208d2fdc6126811ac7127fdc928e823 Mon Sep 17 00:00:00 2001 +From: Mike Frysinger <vapier@gentoo.org> +Date: Mon, 24 Mar 2008 01:48:19 -0400 +Subject: [PATCH] This reverts commit 0e2f160c95b15e95f3885e3f5a3670ec5ae0a709. 2 spaces in 80 cols has never made any sort of realistic difference and we're not going to change this behavior in Gentoo. + +--- + src/libeinfo/libeinfo.c | 9 +++------ + 1 files changed, 3 insertions(+), 6 deletions(-) + +diff --git a/src/libeinfo/libeinfo.c b/src/libeinfo/libeinfo.c +index bef98a5..a5977b7 100644 +--- a/src/libeinfo/libeinfo.c ++++ b/src/libeinfo/libeinfo.c +@@ -764,7 +764,7 @@ _eend(FILE * __EINFO_RESTRICT fp, int col, ECOLOR color, const char *msg) + if (!msg) + return; + +- cols = get_term_columns(fp) - (strlen(msg) + 3); ++ cols = get_term_columns(fp) - (strlen(msg) + 5); + + /* cons25 is special - we need to remove one char, otherwise things + * do not align properly at all. */ +@@ -778,18 +778,15 @@ _eend(FILE * __EINFO_RESTRICT fp, int col, ECOLOR color, const char *msg) + if (term_is_cons25) + cols--; + +- /* If extra spacing is required around msg, then please change +- * via a runtime knob and leave this default as is as it saves 2 +- * valuable columns when running on 80 column screens. */ + if (cols > 0 && colour_terminal(fp)) { +- fprintf(fp, "%s%s %s[%s%s%s]%s\n", up, tgoto(goto_column, 0, cols), ++ fprintf(fp, "%s%s %s[%s %s %s]%s\n", up, tgoto(goto_column, 0, cols), + ecolor(ECOLOR_BRACKET), ecolor(color), msg, + ecolor(ECOLOR_BRACKET), ecolor(ECOLOR_NORMAL)); + } else { + if (col > 0) + for (i = 0; i < cols - col; i++) + fprintf(fp, " "); +- fprintf(fp, " [%s]\n", msg); ++ fprintf(fp, " [ %s ]\n", msg); + } + } + +-- +1.6.0.2 + diff --git a/sys-apps/openrc/files/0.3.0/0004-add-a-softlevel-function-to-the-API-so-people-dont.patch b/sys-apps/openrc/files/0.3.0/0004-add-a-softlevel-function-to-the-API-so-people-dont.patch new file mode 100644 index 000000000000..a307386f9504 --- /dev/null +++ b/sys-apps/openrc/files/0.3.0/0004-add-a-softlevel-function-to-the-API-so-people-dont.patch @@ -0,0 +1,80 @@ +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 57917ed..680f534 100644 +--- a/sh/functions.sh.in ++++ b/sh/functions.sh.in +@@ -42,6 +42,28 @@ 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 ++ 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 751d47a..c713def 100644 +--- a/sh/rc-functions.sh.in ++++ b/sh/rc-functions.sh.in +@@ -51,29 +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 +- [ "$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:*);; +-- +1.6.0.2 + diff --git a/sys-apps/openrc/files/0.3.0/0005-add-back-KV_-funcs.patch b/sys-apps/openrc/files/0.3.0/0005-add-back-KV_-funcs.patch new file mode 100644 index 000000000000..dfde845cd8ec --- /dev/null +++ b/sys-apps/openrc/files/0.3.0/0005-add-back-KV_-funcs.patch @@ -0,0 +1,120 @@ +From 77a1fb72523df6495ae526fbf4fd834ac15aae74 Mon Sep 17 00:00:00 2001 +From: Mike Frysinger <vapier@gentoo.org> +Date: Mon, 24 Mar 2008 03:14:02 -0400 +Subject: [PATCH] add back KV_* funcs + +--- + sh/functions.sh.in | 35 +++++++++++++++++++++++++++++++++++ + sh/runtests.sh | 45 +++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 80 insertions(+), 0 deletions(-) + +diff --git a/sh/functions.sh.in b/sh/functions.sh.in +index 680f534..f121564 100644 +--- a/sh/functions.sh.in ++++ b/sh/functions.sh.in +@@ -64,6 +64,41 @@ get_bootparam() + return 1 + } + ++KV_major() { ++ [ -z "$*" ] && return 1 ++ local KV="$*" ++ echo ${KV%%.*} ++} ++ ++KV_minor() { ++ [ -z "$*" ] && return 1 ++ local KV="$*" ++ KV=${KV#*.} ++ echo ${KV%%.*} ++} ++ ++KV_micro() { ++ [ -z "$*" ] && return 1 ++ local KV="$*" ++ KV=${KV#*.*.} ++ echo ${KV%%[![:digit:]]*} ++} ++ ++KV_to_int() { ++ [ -z "$*" ] && return 1 ++ local KV_MAJOR="$(KV_major "$*")" ++ local KV_MINOR="$(KV_minor "$*")" ++ local KV_MICRO="$(KV_micro "$*")" ++ local KV_int="$(( KV_MAJOR * 65536 + KV_MINOR * 256 + KV_MICRO ))" ++ echo "${KV_int}" ++} ++ ++_RC_GET_KV_CACHE="" ++get_KV() { ++ [ -z ${_RC_GET_KV_CACHE} ] && _RC_GET_KV_CACHE=$(uname -r) ++ echo $(KV_to_int "${_RC_GET_KV_CACHE}") ++} ++ + _sanitize_path() + { + local IFS=":" p= path= +diff --git a/sh/runtests.sh b/sh/runtests.sh +index 110266b..9f6726d 100755 +--- a/sh/runtests.sh ++++ b/sh/runtests.sh +@@ -3,6 +3,19 @@ + top_srcdir=${top_srcdir:-..} + . ${top_srcdir}/test/setup_env.sh + ++checkit() { ++ local output=$($1 $3) ++ local lret=$? ++ if [ ${lret} -ne 0 ] ; then ++ ((tret+=lret)) ++ echo "FAIL: exec: $*" ++ fi ++ if [ "${output}" != "$2" ] ; then ++ ((tret+=lret)) ++ echo "FAIL: output: $* : got='${output}' wanted='$2'" ++ fi ++} ++ + ret=0 + + tret=0 +@@ -22,4 +35,36 @@ done + eend ${tret} + ret=$((${ret} + ${tret})) + ++compare_int() { ++ local got=$(KV_to_int $1) ++ local exp=$(KV_to_int $3) ++ if ! [ ${got} $2 ${exp} ] ; then ++ ((tret+=1)) ++ echo "FAIL: KV_to_int '${v}'(${got}) $2 '1.2.2'(${exp})" ++ fi ++} ++ ++tret=0 ++ebegin "Testing KV_{major,minor,micro,to_int}" ++for v in \ ++ 1.2.3 1.2.3-rc0 1.2.3_rc0 "1.2.3 rc0" \ ++ 1.2.3.4 1.2.3.4-rc0 1.2.3.4_rc0 "1.2.3.4 rc0" ++do ++ checkit KV_major 1 ${v} ++ checkit KV_minor 2 ${v} ++ checkit KV_micro 3 ${v} ++ ++ compare_int 1.2.2 -lt ${v} ++ compare_int 1.2.2.10 -lt ${v} ++ compare_int 1.2.4 -gt ${v} ++ compare_int 1.2.4-rc0 -gt ${v} ++ compare_int 1.2.3 -eq ${v} ++ compare_int 1.2.3-rc0 -eq ${v} ++ compare_int 1.2.3.2 -eq ${v} ++ compare_int 1.2.3.3 -eq ${v} ++ compare_int 1.2.3.4 -eq ${v} ++done ++eend ${tret} ++((ret+=tret)) ++ + exit ${ret} +-- +1.6.0.2 + |