+# vim:fileencoding=utf-8
# Copyright 2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
header_length = portdata.version_length
content_length = keywords.length
else:
- header = string_rotator().rotateContent(portdata.content, portdata.content_length, order, bold)
+ header = string_rotator().rotateContent(portdata.content, portdata.content_length, bold)
content = keywords.content
sep = [''.ljust(keywords.length) for x in range(portdata.slot_length-1)]
content.extend(sep)
parser.add_argument('-S', '--ignore-slot', action='store_true', default=False,
help='Treat slots as irelevant during detection of redundant pacakges.')
- return parser.parse_args(args=argv[1:])
+ return parser.parse_args(args=argv)
-def main(argv):
+def main(argv, indirect = False):
global ignore_slots, bold, order, topper
- # equery support
- if argv[0] = 'equery':
- pkgsearch_only = True
-
#opts parsing
opts = process_args(argv)
ignore_slots = opts.ignore_slot
package = opts.package
# equery support
- if pkgsearch_only and len(package) <= 0:
+ if indirect and len(package) <= 0:
msg_err = 'No packages specified'
raise SystemExit(msg_err)
map(lambda x: process_display(x, keywords, dbapi), package)
else:
currdir = os.getcwd()
- package=os.path.basename(currdir)
# check if there are actualy some ebuilds
ebuilds = ['%s' % x for x in os.listdir(currdir)
if fnmatch.fnmatch(x, '*.ebuild')]
if len(ebuilds) <= 0:
msg_err = 'No ebuilds at "%s"' % currdir
raise SystemExit(msg_err)
+ package= '%s/%s' % (os.path.basename(os.path.abspath('../')), os.path.basename(currdir))
ourtree = os.path.abspath('../../')
-
- mysettings = portc(env={'PORTDIR_OVERLAY': os.path.abspath('../../')})
+ overlays = '%s %s' % (ports['PORTDIR_OVERLAY'], ourtree)
+ mysettings = portc(env={'PORTDIR_OVERLAY': overlays})
dbapi = portdbapi(mysettings=mysettings)
# specify that we want just our nice tree we are in cwd
dbapi.porttrees = [ourtree]
return 0
if __name__ == '__main__':
- sys.exit(main(sys.argv))
+ sys.exit(main(sys.argv[1:]))