Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 23736

Summary: runscript leaves script functions in environment?
Product: Gentoo Linux Reporter: Carl A. Dunham <gentoo-bugs2>
Component: [OLD] Core systemAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED CANTFIX    
Severity: normal CC: james
Priority: High    
Version: 1.4_rc4   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 30161    

Description Carl A. Dunham 2003-06-29 23:11:15 UTC
Feature or bug? 
 
Values like: 
 
... 
KV_major () 
{ 
    local KV=; 
    [ -z "$1" ] && return 1; 
    KV="$(echo "$1" |           awk '{ tmp = $0; gsub(/^[0-9\.]*/, "", tmp); sub(tmp, ""); print }')"; 
    echo "${KV}" | awk -- 'BEGIN { FS = "." } { print $1 }'; 
    return 0 
} 
KV_micro () 
{ 
    local KV=; 
    [ -z "$1" ] && return 1; 
    KV="$(echo "$1" |           awk '{ tmp = $0; gsub(/^[0-9\.]*/, "", tmp); sub(tmp, ""); print }')"; 
    echo "${KV}" | awk -- 'BEGIN { FS = "." } { print $3 }'; 
    return 0 
} 
KV_minor () 
{ 
    local KV=; 
    [ -z "$1" ] && return 1; 
    KV="$(echo "$1" |           awk '{ tmp = $0; gsub(/^[0-9\.]*/, "", tmp); sub(tmp, ""); print }')"; 
    echo "${KV}" | awk -- 'BEGIN { FS = "." } { print $2 }'; 
    return 0 
} 
KV_to_int () 
{ 
    local KV_MAJOR=; 
    local KV_MINOR=; 
    local KV_MICRO=; 
    local KV_int=; 
    [ -z "$1" ] && return 1; 
    KV_MAJOR="$(KV_major "$1")"; 
    KV_MINOR="$(KV_minor "$1")"; 
    KV_MICRO="$(KV_micro "$1")"; 
    KV_int="$((KV_MAJOR * 65536 + KV_MINOR * 256 + KV_MICRO))"; 
    if [ "${KV_int}" -ge 131584 ]; then 
        echo "${KV_int}"; 
        return 0; 
    fi; 
    return 1 
} 
broken () 
{ 
    [ -z "$1" ] && return 1; 
    check_dependency broken $*; 
    return $? 
} 
... 
 
i.e. there is a variable in the environment named "broken" with the value "() {..." 
 
This shows up a few places, but can be seen in all its glory in "phpinfo()" output... 
 
 
You can play around with it using an init script like: 
 
start() { 
	ebegin "Starting evironment echo" 
 
	bash 
 
	eend $? 
} 
 
and running <scriptname> start 
 
using baselayout 1.8.6.8-r1
Comment 1 SpanKY gentoo-dev 2003-07-26 19:48:02 UTC
*** Bug 25015 has been marked as a duplicate of this bug. ***
Comment 2 Martin Schlemmer (RETIRED) gentoo-dev 2003-08-05 02:24:30 UTC
Well, it is a bash 'feature'.  All functions in files sourced is listed in
the environment, and those are needed in the rc-system.  I did add filtering
of the "dependency" info in .10, so it will be less machine specific info.
Comment 3 James Hiscock 2003-08-05 05:04:25 UTC
This doesn't occur with 1.8.6.7, so what's the difference between 1.8.6.7 and 1.8.6.8+?
Comment 4 SpanKY gentoo-dev 2003-08-05 20:56:22 UTC
i'd also point out this odd bug i'm working with ... Bug 25754 ... 
 
glftpd is semi broken when using baselayout .8 and greater ... going back to .7 
fixed it ... 
Comment 5 Mr. Bones. (RETIRED) gentoo-dev 2003-10-02 00:54:13 UTC
Old bug.