Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 111682 - linux-info.eclass does not like directory names with spaces in them
Summary: linux-info.eclass does not like directory names with spaces in them
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: John Mylchreest (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-06 04:59 UTC by Dieter Verfaillie
Modified: 2005-12-30 10:36 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
pathnames.patch (pathnames.patch,726 bytes, patch)
2005-11-06 15:59 UTC, Dieter Verfaillie
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dieter Verfaillie 2005-11-06 04:59:01 UTC
I got this error:
/usr/portage/eclass/linux-info.eclass: line 120: cd: /home/dieterv/dev/3: No
such file or directory

The directory is there but has a space right after the 3. Somehow I get the
feeling something happens in the eclass that doesn't like spaces in
directorynames...

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2005-11-06 05:16:45 UTC
Uhm, using spaces in file/directory names is always a bad idea, and putting
space at the *end* of file/directory name is the *worst* one really... Don't do
this. 
Comment 2 Dieter Verfaillie 2005-11-06 15:58:09 UTC
Uhm, I was only trying to help, but should have been more clear
on this, so here goes:

The directory name _contains_ spaces (lot's of them),
but does not end with a space. It also contains
lot's of "weird" characters not used in the English language...

If I understand the code correctly:
- line 112 stores the current directory into a variable
- line 117 changes the current directory and
- line 120 tries to restore the current directory to whatever
  was stored in line 112.

If I understand Unix (and as far as I know Linux)
file/directory names, they may not:
- exceed 255 characters in length
- include a forward slash (path name element seperator)
- include a NULL character
- be . and .. (reserved for current and parent dir)
- maybe more I don't know about. Please share ;-)

and as a consequense the following should be noted:
- file/directory names may include spaces
- file/directory names are case sensitive

Anyway, adding quotes around the variables fixes this as
can be seen in the included patch.
Comment 3 Dieter Verfaillie 2005-11-06 15:59:11 UTC
Created attachment 72338 [details, diff]
pathnames.patch

fixes this issue.
Comment 4 John Mylchreest (RETIRED) gentoo-dev 2005-12-30 10:36:45 UTC
No objections to this at all. Thanks for the catch.