Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 383269 - sys-apps/portage doesn't work with PORTDIR_OVERLAY paths containing whitespace and/or single quotes
Summary: sys-apps/portage doesn't work with PORTDIR_OVERLAY paths containing whitespac...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 381649
  Show dependency tree
 
Reported: 2011-09-16 20:18 UTC by gentoo
Modified: 2011-09-19 04:47 UTC (History)
1 user (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 gentoo 2011-09-16 20:18:53 UTC
The command failed when my path contained "' ". I moved the overlay directoy up to /tmp so that the path is free of ' and (space), and then the command worked.

See command and output below.

sunrise-commit -d -c "Added ~amd64 for bug 166275 after consultation with _AxS_ on #gentoo-sunrise"
Reverted 'ChangeLog'
 * Adding local changes to working copy ...                                                                                                                                                                  [ ok ]
 * Appending/creating ChangeLog ...
--- ChangeLog	2011-09-16 22:28:34.935629838 +0300
+++ ChangeLog.new	2011-09-16 22:28:35.124626324 +0300
@@ -1,7 +1,11 @@
 # ChangeLog for app-misc/japanese-vocabulary
-# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
 # $Header: $
 
+  16 Sep 2011; Christian Asseburg (Zoominee) <christianasseburg@yahoo.co.uk>
+  japanese-vocabulary-0.6.ebuild:
+  Added ~amd64 for bug 166275 after consultation with _AxS_ on #gentoo-sunrise
+
   12 Jan 2010; Markos Chandras <hwoarang@gentoo.org>
   japanese-vocabulary-0.6.ebuild:
   Migrate to qt4-r2 eclass                                                                                                                                                                                  [ ok ]
 * Digesting ebuilds ...
Appending /tmp/ca's Temp/sunrise to PORTDIR_OVERLAY...
>>> Creating Manifest for /tmp/ca's Temp/sunrise/app-misc/japanese-vocabulary                                                                                                                                [ ok ]
 * Adding local changes to working copy ...                                                                                                                                                                  [ ok ]
 * Running repoman ...

RepoMan scours the neighborhood...
/bin/sh: -c: line 0: unexpected EOF while looking for matching `''
/bin/sh: -c: line 1: syntax error: unexpected end of file
/bin/sh: -c: line 0: unexpected EOF while looking for matching `''
/bin/sh: -c: line 1: syntax error: unexpected end of file
/bin/sh: -c: line 0: unexpected EOF while looking for matching `''
/bin/sh: -c: line 1: syntax error: unexpected end of file
!!! metadata.xml is invalid:
Traceback (most recent call last):
  File "/usr/bin/repoman", line 1902, in <module>
    env=env, _eprefix=eprefix)
  File "/usr/lib64/portage/pym/portage/package/ebuild/config.py", line 497, in __init__
    self.repositories = load_repository_config(self)
  File "/usr/lib64/portage/pym/portage/repository/config.py", line 528, in load_repository_config
    return RepoConfigLoader(repoconfigpaths, settings)
  File "/usr/lib64/portage/pym/portage/repository/config.py", line 299, in __init__
    ignored_map, ignored_location_map)
  File "/usr/lib64/portage/pym/portage/repository/config.py", line 197, in _add_overlays
    port_ov = [normalize_path(i) for i in shlex_split(portdir_overlay)]
  File "/usr/lib64/portage/pym/portage/util/__init__.py", line 512, in shlex_split
    rval = shlex.split(s)
  File "/usr/lib64/python3.1/shlex.py", line 275, in split
    return list(lex)
  File "/usr/lib64/python3.1/shlex.py", line 265, in __next__
    token = self.get_token()
  File "/usr/lib64/python3.1/shlex.py", line 92, in get_token
    raw = self.read_token()
  File "/usr/lib64/python3.1/shlex.py", line 168, in read_token
    raise ValueError("No closing quotation")
ValueError: No closing quotation
Comment 1 Mike Gilbert gentoo-dev 2011-09-17 03:03:26 UTC
I'm pretty sure this is a problem with repoman/portage rather than sunrise-commit/overlay-utils.
Comment 3 Mike Gilbert gentoo-dev 2011-09-17 05:23:16 UTC
I still get a ValueError with a single quote after applying that commit to alpha58.

floppym@naomi testpkg % pwd
/home/floppym/temp/mikes'stuff/overlay1/app-misc/testpkg
floppym@naomi testpkg % PORTDIR_OVERLAY="/home/floppym/temp/mikes'stuff/overlay1" repoman manifest
Traceback (most recent call last):
  File "/usr/bin/repoman", line 99, in <module>
    repoman_settings = portage.config(local_config=False, _eprefix=eprefix)
  File "/usr/lib64/portage/pym/portage/proxy/objectproxy.py", line 31, in __call__
    return result(*args, **kwargs)
  File "/usr/lib64/portage/pym/portage/package/ebuild/config.py", line 497, in __init__
    self.repositories = load_repository_config(self)
  File "/usr/lib64/portage/pym/portage/repository/config.py", line 528, in load_repository_config
    return RepoConfigLoader(repoconfigpaths, settings)
  File "/usr/lib64/portage/pym/portage/repository/config.py", line 299, in __init__
    ignored_map, ignored_location_map)
  File "/usr/lib64/portage/pym/portage/repository/config.py", line 197, in _add_overlays
    port_ov = [normalize_path(i) for i in shlex_split(portdir_overlay)]
  File "/usr/lib64/portage/pym/portage/util/__init__.py", line 512, in shlex_split
    rval = shlex.split(s)
  File "/usr/lib64/python2.7/shlex.py", line 279, in split
    return list(lex)
  File "/usr/lib64/python2.7/shlex.py", line 269, in next
    token = self.get_token()
  File "/usr/lib64/python2.7/shlex.py", line 96, in get_token
    raw = self.read_token()
  File "/usr/lib64/python2.7/shlex.py", line 172, in read_token
    raise ValueError, "No closing quotation"
ValueError: No closing quotation
Comment 5 Mike Gilbert gentoo-dev 2011-09-17 16:41:22 UTC
Ok, it works if I do not have the path in PORTDIR_OVERLAY and let repoman figure out the repository path by itself.

However, I still get the ValueError above when PORTDIR_OVERLAY actually contains the funny path.
Comment 6 Zac Medico gentoo-dev 2011-09-17 17:19:08 UTC
(In reply to comment #5)
> However, I still get the ValueError above when PORTDIR_OVERLAY actually
> contains the funny path.

You'll have to set it like this:

PORTDIR_OVERLAY="\"/home/floppym/temp/mikes'stuff/overlay1\""

The reason being that the PORTDIR_OVERLAY value needs to be split with shlex.
Comment 7 Zac Medico gentoo-dev 2011-09-17 17:23:04 UTC
This might work too:

PORTDIR_OVERLAY="/home/floppym/temp/mikes\\'stuff/overlay1"

This issue is that the apostrophe character also happens to be a shell quote character that is recognized by shlex.
Comment 8 Mike Gilbert gentoo-dev 2011-09-17 17:34:37 UTC
Both of the above suggestions work in repoman, thanks.

Now, when I try to emerge the "testpkg", I get the following:

floppym@naomi ~ % ACCEPT_KEYWORDS='~amd64' emerge -pv testpkg

These are the packages that would be merged, in order:

Calculating dependencies... done!
Traceback (most recent call last):
  File "/usr/bin/emerge", line 43, in <module>
    retval = emerge_main()
  File "/usr/lib64/portage/pym/_emerge/main.py", line 1948, in emerge_main
    myopts, myaction, myfiles, spinner)
  File "/usr/lib64/portage/pym/_emerge/actions.py", line 386, in action_build
    favorites=favorites)
  File "/usr/lib64/portage/pym/_emerge/depgraph.py", line 5690, in display
    return display(self, mylist, favorites, verbosity)
  File "/usr/lib64/portage/pym/_emerge/resolver/output.py", line 811, in __call__
    self.verbose_size(pkg, repoadd_set, pkg_info)
  File "/usr/lib64/portage/pym/_emerge/resolver/output.py", line 346, in verbose_size
    pkg_info.repo_path_real)
  File "/usr/lib64/portage/pym/_emerge/resolver/output_helpers.py", line 58, in repoStr
    real_index = self._repo_paths_real.index(repo_path_real)
ValueError: u"/home/floppym/temp/mikes'stuff/overlay1" is not in list
Comment 9 Zac Medico gentoo-dev 2011-09-17 18:10:50 UTC
(In reply to comment #8)
> repoStr
>     real_index = self._repo_paths_real.index(repo_path_real)
> ValueError: u"/home/floppym/temp/mikes'stuff/overlay1" is not in list

That's fixed now:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c5ffb546b7833dfcefffe7c68ab3a3f040139a91

And here's handling for the issue from comment #5:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=dc23070e710acecf9b0229f81a980719605d9409
Comment 10 Mike Gilbert gentoo-dev 2011-09-17 19:36:03 UTC
Nice. I've run out of ways to break it. :)
Comment 11 Zac Medico gentoo-dev 2011-09-19 04:47:07 UTC
Thanks for testing. This is fixed in 2.1.10.19 and 2.2.0_alpha59.