Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 1669 - /usr/lib/portage/bin/* doesn't handle files with spaces in the names
Summary: /usr/lib/portage/bin/* doesn't handle files with spaces in the names
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: x86 Linux
: Normal major (vote)
Assignee: Nicholas Jones (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-10 22:48 UTC by Sandy McArthur
Modified: 2011-10-30 22:20 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sandy McArthur 2002-04-10 22:48:50 UTC
I first noticed this from an error in /usr/lib/portage/bin/doins. I looked at
the source and saw lots of lines like:
if [ -L $x ]
and
cp $x ${T}

They should be:
if [ -L "$x" ]
and
cp "$x" "${T}"

With out the quotes files with spaces in their name will be treated as two
parameters. eg:
cp /path/to/file/with/some spaces in the name.txt /somewhere/else/
will try to copy 5 files to a directory, not one file into a directory.

I only checked a few files in /usr/lib/portage/bin/* but all of the ones I
looked at had this problem.
Comment 1 Daniel Robbins (RETIRED) gentoo-dev 2002-04-12 23:42:10 UTC
OK, we should fix this -- but -- our policy is not to install files with spaces
in their names.  Do any ebuilds have such files?
Comment 2 Sandy McArthur 2002-04-13 01:09:53 UTC
Not that I know of. I was trying to install a helper file for VMware that added
menu items to kde. The file created be kmenuedit (or whatever it's called) gave
it a space in the name and I didn't think to rename it. My workaround was to
rename it without the space.
Comment 3 SpanKY gentoo-dev 2002-05-29 23:12:35 UTC
perhaps Bug 1957 is related to this ? 
the emerge fails because of spaces in a library configure option 
Comment 4 Jon Nelson (RETIRED) 2002-05-30 20:14:09 UTC
Despite the policy of "no files with spaces in them" (which I don't agree with,
but won't argue here), for safety' sake it's not a bad idea to robustify the
scripts. If the scripts WARN that a file has spaces in it seems like a good
middle ground to me.

Additionally, while we're on the topic, I've noticed a few shortcomings with the
other scripts (dodoc doesn't recurse, etc...).  If I may suggest, a discussion
on -dev for general script improvement and/or replacement might not be a bad idea.

Comment 5 Nicholas Jones (RETIRED) gentoo-dev 2002-08-02 01:44:40 UTC
Bash file globs being used to pass files might cause problems as "detecting" 
spaces is a non-trivial exercise. Using $* and $@ would be one of the major 
problems as it gets/gives a _space delimited_ list of arguments to for loops 
and other scripts... Thereby failing anything looking for spaces...

I think the palm emulator is one that includes files with spaces.
*  app-emulation/pose [ Masked ]  <---  That's it.
Comment 6 Nicholas Jones (RETIRED) gentoo-dev 2002-11-14 06:08:44 UTC
in cvs