First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 66985
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Portage team <dev-portage@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Matthew Kennedy (RETIRED) <mkennedy@gentoo.org>
Add CC:
CC:
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
portage.diff remove extra variable expansion patch erik quanstrom 2005-05-13 19:37 0000 658 bytes Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 66985 depends on: Show dependency tree
Bug 66985 blocks: 58564
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2004-10-10 08:55 0000
Here's an example (which the next update for app-shells/scsh
exhibits):

In /etc/env.d/50scsh:

    SCSH_LIB_DIRS='"/usr/lib/scsh/modules/0.6" "/usr/lib/scsh" "."'

In /etc/profile.env after env-update has run:

    export SCSH_LIB_DIRS=''/usr/lib/scsh/modules/0.6 /usr/lib/scsh .''

Which of course fails with:

    -bash: export: `/usr/lib/scsh': not a valid identifier
    -bash: export: `.': not a valid identifier

Needs to be fixed.  The workaround is to "einfo" something like
"Sorry, env-update doesn't handle a corner case.  Please manually add
export SCSH_LIB_DIRS=''/usr/lib/scsh/modules/0.6 /usr/lib/scsh .'' to
your /etc/profile"... which is unprofessional of course.

------- Comment #1 From Matthew Kennedy (RETIRED) 2004-10-10 08:56:58 0000 -------
It might not be clear depending on what font you're using but the '' in

    export SCSH_LIB_DIRS=''/usr/lib/scsh/modules/0.6 /usr/lib/scsh .''

Is two (2) single quotes, NOT a double quote.

------- Comment #2 From SpanKY 2004-10-10 18:38:14 0000 -------
portage manages env-update

------- Comment #3 From Nicholas Jones (RETIRED) 2004-10-11 07:18:33 0000 -------
I'm going to guess this is csh?

This definately doesn't play well with bash.

Could you provide a rough outline of the meaning and how it is
supposed to result?

------- Comment #4 From Matthew Kennedy (RETIRED) 2004-10-18 12:19:21 0000 -------
Its not csh, its not even shell dependent.  The environment variable should 
*contain* several strings in double quotes, separated by white space.

ie. if you echo $SCSH_LIB_DIRS, then the following is the expected output:

    $ echo $SCSH_LIB_DIRS
    "/usr/lib/scsh/modules/0.6" "/usr/lib/scsh" "."
    $

The fact that these are paths in double quotes separated by space should not be 
interpretted by the bash.  (If you really want to know the reason, then 
app-shells/scsh scsh binary looks in that environment variable and calls the 
scheme reader function (which reads scheme expressions -- like "asdf" and '(a b c) are scheme expressions) in a loop until all scheme expressions have been 
read. Presumably this builds up a list of paths for it to search for libraries 
in.)

------- Comment #5 From Matthew Kennedy (RETIRED) 2004-10-18 12:28:01 0000 -------
I guess their algorithm for operating on the environment variable looks 
something like this:

(defun read-paths (stream)
  (let ((path (read stream)))
    (when path
      (cons path
	    (read-paths stream)))))

(with-input-from-string (stream (get-env "SCSH_LIB_DIRS"))
  (read-paths stream)) 

  => ("/usr/lib/scsh/modules/0.6" "/usr/lib/scsh" ".")

...excuse my broken scheme accent.

------- Comment #6 From Matthew Kennedy (RETIRED) 2004-12-01 21:05:34 0000 -------
Bug 58564 and bug 58565 on this.  I could incorporate the ebuild and eclass as
is (ie. "please add some foo to your /etc/profile now because /etc/env.d is
broken") but it really requires the /etc/env.d system to be a policy compliant
port.

------- Comment #7 From erik quanstrom 2005-05-13 19:37:24 0000 -------
Created an attachment (id=58848) [details]
remove extra variable expansion

the problem with the quoting is that the text is parsed twice:
once by getconfig() and once by varexpand(). i removed the varexpand(),
which seems to solve this problem. also, i was working on a file to
provide MAIL=$HOME/.maildir which required \\\$HOME to get the $ through.
the first pass turned \\ -> \ and \$ -> $ resulting in '\$HOME' which was
then reparsed into $HOME. without the removal of varexpand there appeared no
way to sneak a ' (so that $HOME could be evaluated by the shell on login) past 

env-update. 

------- Comment #8 From Jason Stubbs (RETIRED) 2005-05-13 20:19:50 0000 -------
Yep. That makes a total of three varexpand calls per special - there's one in
getconfig too.

------- Comment #9 From Jason Stubbs (RETIRED) 2005-07-14 05:48:01 0000 -------
Fixed on or before 2.0.51.22-r1 

------- Comment #10 From Jason Stubbs (RETIRED) 2005-07-14 06:58:44 0000 -------
Looking through the batch of bugs, I'm not sure that some of these are 
actually fixed in stable. Others, the requirements have possibly changed after 
the initial fix was committed. 
 
If you think this bug has been closed incorrectly, please reopen or ask that 
it be reopened. 

First Last Prev Next    No search results available      Search page      Enter new bug