summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Mauch <genone@gentoo.org>2006-07-15 01:27:15 +0000
committerMarius Mauch <genone@gentoo.org>2006-07-15 01:27:15 +0000
commitfcf3fb91f4c98f98808f0cc86788006cfdf04695 (patch)
treecc00bb22ea75be7826b098e553e3bb6ca51b4597
parent2aa1936fd77132175f3012de2ba27d4620926100 (diff)
downloadportage-fcf3fb91f4c98f98808f0cc86788006cfdf04695.tar.gz
portage-fcf3fb91f4c98f98808f0cc86788006cfdf04695.tar.bz2
portage-fcf3fb91f4c98f98808f0cc86788006cfdf04695.zip
disable regular expressions for search by default
svn path=/main/trunk/; revision=3876
-rwxr-xr-xbin/emerge15
1 files changed, 8 insertions, 7 deletions
diff --git a/bin/emerge b/bin/emerge
index 34b3688d5..4d9c0342f 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -418,16 +418,17 @@ class search:
self.matches = {"pkg":[]}
print "Searching... ",
+ regexsearch = False
+ if self.searchkey[0] == '%':
+ regexsearch = True
+ self.searchkey = self.searchkey[1:]
if self.searchkey[0] == '@':
match_category = 1
self.searchkey = self.searchkey[1:]
- if self.searchkey=="*":
- #hack for people who aren't regular expression gurus
- self.searchkey==".*"
- if re.search("\+\+", self.searchkey):
- #hack for people who aren't regular expression gurus
- self.searchkey=re.sub("\+\+","\+\+",self.searchkey)
- self.searchre=re.compile(self.searchkey.lower(),re.I)
+ if regexsearch:
+ self.searchre=re.compile(self.searchkey,re.I)
+ else:
+ self.searchre=re.compile(re.escape(self.searchkey), re.I)
for package in self.portdb.cp_all():
self.spinner.update()