Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 73718 Details for
Bug 96515
equery doesn't account for symlinks
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
equery-b-symlinks.patch
equery-b-symlinks.patch (text/plain), 3.29 KB, created by
Harald van Dijk (RETIRED)
on 2005-11-28 05:06:18 UTC
(
hide
)
Description:
equery-b-symlinks.patch
Filename:
MIME Type:
Creator:
Harald van Dijk (RETIRED)
Created:
2005-11-28 05:06:18 UTC
Size:
3.29 KB
patch
obsolete
>--- gentoolkit-0.2.1_rc2/src/equery/equery >+++ gentoolkit-0.2.1_rc2/src/equery/equery >@@ -278,7 +278,6 @@ > def __init__(self): > self.default_opts = { > "category": "*", >- "fullRegex": 0, > "earlyOut": 0, > "nameOnly": 0 > } >@@ -305,8 +304,6 @@ > skip = 1 > elif x in ["-e", "--earlyout"]: > opts["earlyOut"] = 1 >- elif x in ["-f", "--full-regex"]: >- opts["fullRegex"] = 1 > elif x in ["-n", "--name-only"]: > opts["nameOnly"] = 1 > else: >@@ -321,16 +318,11 @@ > def perform(self, args): > (query, opts) = self.parseArgs(args) > >- if opts["fullRegex"]: >- q = query >- else: >- q = map(lambda x: ((len(x) and x[0] == "/") and "^" or "/") >- + re.escape(x) + "$", query) >- try: >- q = string.join(q, "|") >- rx = re.compile(q) >- except: >- die(2, "The query '" + pp.regexpquery(q) + "' does not appear to be a valid regular expression") >+ q = map(os.path.split, query) >+ for c in q: >+ if len(c[0]) and c[0][0] != "/": >+ print_error("File names must be either include the full path or not include the path at all") >+ sys.exit(-1) > > # Pick out only selected categories > cat = opts["category"] >@@ -352,13 +344,16 @@ > #cnt = pkg.get_contents() > if not cnt: return > for file in cnt.keys(): >- if rx.search(file) and (opts["category"] == "*" or portage.catpkgsplit(pkg)[0] == opts["category"]): >- if opts["nameOnly"]: >- x = portage.catpkgsplit(pkg) >- print x[0]+"/"+x[1] >- else: >- print pkg >- return >+ if opts["category"] == "*" or portage.catpkgsplit(pkg)[0] == opts["category"]: >+ (dir, base) = os.path.split(file) >+ for c in q: >+ if base == c[1] and (c[0] == "" or dir == c[0] or os.path.samefile(dir, c[0])): >+ if opts["nameOnly"]: >+ x = portage.catpkgsplit(pkg) >+ print x[0]+"/"+x[1] >+ else: >+ print pkg >+ return > > class DummyExp: > pass >@@ -369,16 +364,19 @@ > #cnt = pkg.get_contents() > if not cnt: return > for file in cnt.keys(): >- if rx.search(file) and (opts["category"] == "*" or portage.catpkgsplit(pkg)[0] == opts["category"]): >- if opts["nameOnly"]: >- x = portage.catpkgsplit(pkg) >- s = x[0]+"/"+x[1] >- else: >- s = pkg >- s += " (" + pp.path(fileAsStr(file, cnt[file])) + ")" >- print_info(0, s) >- if opts["earlyOut"]: >- raise DummyExp >+ if opts["category"] == "*" or portage.catpkgsplit(pkg)[0] == opts["category"]: >+ (dir, base) = os.path.split(file) >+ for c in q: >+ if base == c[1] and (c[0] == "" or dir == c[0] or os.path.samefile(dir, c[0])): >+ if opts["nameOnly"]: >+ x = portage.catpkgsplit(pkg) >+ s = x[0]+"/"+x[1] >+ else: >+ s = pkg >+ s += " (" + pp.path(fileAsStr(file, cnt[file])) + ")" >+ print_info(0, s) >+ if opts["earlyOut"]: >+ raise DummyExp > > try: > if Config["piping"]: >@@ -402,7 +400,6 @@ > pp.localoption("<local-opts>") + " is either of: \n" + \ > " " + pp.localoption("-c, --category cat") + " - only search in category " + \ > pp.pkgquery("cat") + "\n" + \ >- " " + pp.localoption("-f, --full-regex") + " - supplied query is a regex\n" + \ > " " + pp.localoption("-e, --earlyout") + " - stop when first match is found\n" + \ > " " + pp.localoption("-n, --name-only") + " - don't print the version." >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 96515
: 73718 |
268039