diff options
| author | Brian Dolbec <dolsen@gentoo.org> | 2013-08-11 08:58:02 -0700 |
|---|---|---|
| committer | Brian Dolbec <dolsen@gentoo.org> | 2013-08-11 08:59:25 -0700 |
| commit | 11dd993b67271054cf7a5746e55ebaf41795cfc0 (patch) | |
| tree | bca9de575a8ece471674e8c09278047998995cb7 /pym | |
| parent | 000580dda57439ab0bb1dab42b91edac835a6e96 (diff) | |
| download | gentoolkit-11dd993b67271054cf7a5746e55ebaf41795cfc0.tar.gz | |
Add fifo type to equery files, bug 480308.
Diffstat (limited to 'pym')
| -rw-r--r-- | pym/gentoolkit/equery/__init__.py | 5 | ||||
| -rw-r--r-- | pym/gentoolkit/equery/files.py | 16 |
2 files changed, 19 insertions, 2 deletions
diff --git a/pym/gentoolkit/equery/__init__.py b/pym/gentoolkit/equery/__init__.py index c44de90..7f20103 100644 --- a/pym/gentoolkit/equery/__init__.py +++ b/pym/gentoolkit/equery/__init__.py @@ -145,7 +145,7 @@ def format_filetype(path, fdesc, show_type=False, show_md5=False, @param path: the path @type fdesc: list @param fdesc: [file_type, timestamp, MD5 sum/symlink target] - file_type is one of dev, dir, obj, sym. + file_type is one of dev, dir, obj, sym, fif. If file_type is dir, there is no timestamp or MD5 sum. If file_type is sym, fdesc[2] is the target of the symlink. @type show_type: bool @@ -179,6 +179,9 @@ def format_filetype(path, fdesc, show_type=False, show_md5=False, elif fdesc[0] == "dev": ftype = "dev" fpath = path + elif fdesc[0] == "fif": + ftype = "fifo" + fpath = path else: sys.stderr.write( pp.error("%s has unknown type: %s" % (path, fdesc[0])) diff --git a/pym/gentoolkit/equery/files.py b/pym/gentoolkit/equery/files.py index 2843baf..9ef87cf 100644 --- a/pym/gentoolkit/equery/files.py +++ b/pym/gentoolkit/equery/files.py @@ -43,7 +43,8 @@ QUERY_OPTS = { } FILTER_RULES = ( - 'dir', 'obj', 'sym', 'dev', 'path', 'conf', 'cmd', 'doc', 'man', 'info' + 'dir', 'obj', 'sym', 'dev', 'path', 'conf', 'cmd', 'doc', 'man', 'info', + 'fifo' ) # ========= @@ -199,6 +200,17 @@ def filter_by_conf(contents): return filtered_content +def filter_by_fifo(contents): + """Return a copy of content filtered by fifo entries.""" + + filtered_content = {} + for path in contents: + if contents[path][0] in ['fif']: + filtered_content[path] = contents[path] + + return filtered_content + + def filter_contents(contents): """Filter files by type if specified by the user. @@ -228,6 +240,8 @@ def filter_contents(contents): filtered_content.update(filter_by_conf(contents)) if frozenset(('doc' ,'man' ,'info')).intersection(content_filter): filtered_content.update(filter_by_doc(contents, content_filter)) + if "fifo" in content_filter: + filtered_content.update(filter_by_fifo(contents)) return filtered_content |
