Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 586268 - sys-apps/portage: space separated emerge --exclude arguments must be quoted
Summary: sys-apps/portage: space separated emerge --exclude arguments must be quoted
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
: 609990 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-06-18 08:52 UTC by Toralf Förster
Modified: 2023-05-17 04:05 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 Toralf Förster gentoo-dev 2016-06-18 08:52:18 UTC
# emerge --exclude dev-java/* dev-lang/ruby dev-ruby/*  --deep --update --newuse --changed-use --with-bdeps=y @world
!!! 'dev-ruby/*' is not a valid package atom.
!!! Please check ebuild(5) for full details.


and indeed :

# tail /var/log/emerge.log

1466239830: Started emerge on: Jun 18, 2016 10:50:29
1466239830:  *** emerge --exclude=dev-java/* --verbose-conflicts --reinstall=changed-use --quiet-build=y --color=n --deep --nospinner --newuse --tree --with-bdeps=y --update dev-lang/ruby dev-ruby/* @world
1466239830:  *** terminating.
Comment 1 Toralf Förster gentoo-dev 2016-06-18 09:32:39 UTC
fun fact:
it works for just 2 args with just one '*' :

--exclude dev-ruby/* dev-lang/ruby
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-06-18 09:36:58 UTC
PEBKAC. How is Portage supposed to figure out where parameters to --exclude end and packages begin? You need to use --exclude multiple times to exclude multiple atoms.
Comment 3 Jouni Kosonen 2016-06-18 10:12:21 UTC
(In reply to Michał Górny from comment #2)
> PEBKAC. How is Portage supposed to figure out where parameters to --exclude
> end and packages begin? You need to use --exclude multiple times to exclude
> multiple atoms.

Yes, but that's not what is says on the tin:
--exclude ATOMS
  A space separated list of package names or slot atoms. Emerge won't install any ebuild or binary package that matches any of the given package atoms.
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-06-18 10:25:19 UTC
Then: emerge --exclude 'foo bar baz'

Quoting is significant.
Comment 5 Toralf Förster gentoo-dev 2016-06-18 13:29:13 UTC
(In reply to Michał Górny from comment #4)
much better IMO is to repeat that option for each ATOM, especially in scripts otherwise somebody lands eventually in the quoting hell 

IMO the man page of emerge should reflect this pitfall
Comment 6 Alexander Berntsen (RETIRED) gentoo-dev 2016-06-20 07:21:13 UTC
(In reply to Toralf Förster from comment #5)
> IMO the man page of emerge should reflect this pitfall

How do you propose it should reflect it? We're not going to explain on every single option that takes a space separated list of packages that you need to quote it; but I'm open to other ideas.
Comment 7 Toralf Förster gentoo-dev 2016-06-21 18:42:17 UTC
(In reply to Alexander Berntsen from comment #6)
Hhm, I'd like to have a comma-separated list of atoms.

Would avoid all kind of hassles and can be simply splited within python, or ?
Comment 8 Alexander Berntsen (RETIRED) gentoo-dev 2016-06-22 09:57:54 UTC
(In reply to Toralf Förster from comment #7)
> (In reply to Alexander Berntsen from comment #6)
> Hhm, I'd like to have a comma-separated list of atoms.
I'm not confident enough about the different kinds of shells people might invoke emerge from to know if commas are a good idea. Nor do I know what that would actually add compared to simply quoting them, which is the normal behaviour of every shell I know of, that most shell users are aware of.
Comment 9 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-02-19 09:03:35 UTC
*** Bug 609990 has been marked as a duplicate of this bug. ***
Comment 10 nobody 2017-02-19 16:44:53 UTC
Either make it clearer in man page.
--exclude "ATOMS"
  A quoted list of space separated package na...

or make portage less dumb and make it end the exclude list on @ - or eol
it won't kill anyone that <emerge --exclude pck1 pck2 pck3> will endup with an error that no package was given
while <emerge pck3 --exclude pck1 pck2> will endup good.
it will allow emerge --exclude this that @world
or emerge --exclude this that --oneshot openssh

or force exclude as last argument with end of list to eol.