Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 604164 - portageq --maintainer-email cannot handle special characters
Summary: portageq --maintainer-email cannot handle special characters
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
Keywords: InVCS
Depends on:
Blocks: 611328
  Show dependency tree
Reported: 2016-12-30 17:51 UTC by Göktürk Yüksek
Modified: 2017-05-20 18:10 UTC (History)
1 user (show)

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


Note You need to log in before you can comment on or make changes to this bug.
Description Göktürk Yüksek archtester gentoo-dev 2016-12-30 17:51:05 UTC

I'm running the following to determine the packages that belong to a user and it returns empty:

  portageq -n --no-filters --maintainer-email '' --repo gentoo

If I change the code to do an exact string match, it works fine. We should either do that, or escape regex-sensitive characters properly.
Comment 1 Zac Medico gentoo-dev 2016-12-30 19:42:14 UTC
The --help output says that it accepts regexes:

Package matching options:
  --maintainer-email MAINTAINER_EMAIL
                        comma-separated list of maintainer email regexes to
                        search for

So, the assumption is that you'll escape special characters yourself. If we change the behavior, then we'll be breaking compatibility with previous versions (and also with pkgcore's pquery that the --maintainer-email option was copied from).

If we use re.escape(), then people won't be able to use regexes anymore.

I suppose we could add a new option which automatically escapes regexes for you, like --maintainer-email-no-regex or something like that.
Comment 2 Zac Medico gentoo-dev 2016-12-30 20:46:51 UTC
Maybe we should add a --no-regex flag that would affect the behavior of the --maintainer-email arguments.
Comment 3 Göktürk Yüksek archtester gentoo-dev 2016-12-30 21:23:29 UTC
I like the '--no-regex' flag, although it's not evidently clear that it applies to '--maintainer-email'. I'll change it up and submit another patch.
Comment 5 Zac Medico gentoo-dev 2017-05-20 18:10:01 UTC
Fixed in portage-2.3.5.