Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 604164

Summary: portageq --maintainer-email cannot handle special characters
Product: Portage Development Reporter: Göktürk Yüksek <gokturk>
Component: CoreAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal CC: itumaykin+gentoo
Priority: Normal Keywords: InVCS
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 611328    

Description Göktürk Yüksek archtester gentoo-dev 2016-12-30 17:51:05 UTC
Hi,

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

  portageq -n --no-filters --maintainer-email 'itumaykin+gentoo@gmail.com' --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.