diff -u a/pym/portage/package/ebuild/fetch.py b/pym/portage/package/ebuild/fetch.py --- a/pym/portage/package/ebuild/fetch.py 2011-08-22 15:02:36.000000000 +0200 +++ b/pym/portage/package/ebuild/fetch.py 2011-08-22 23:25:10.000000000 +0200 @@ -364,6 +364,10 @@ else: mydigests = digests + listheader = 0 + if listonly: + listheader = mysettings.get("PORTAGE_FETCH_LISTHEADER", "${nl}") + ro_distdirs = [x for x in \ shlex_split(mysettings.get("PORTAGE_RO_DISTDIRS", "")) \ if os.path.isdir(x)] @@ -576,7 +580,12 @@ has_space_superuser = True file_lock = None if listonly: - writemsg_stdout("\n", noiselevel=-1) + listonly_dolist = not os.path.isfile(myfile_path) or \ + (pruned_digests is not None and not verify_all(myfile_path, pruned_digests)[0]) + if listonly_dolist: + variables = dict(pruned_digests, file=myfile, nl='\n', tab='\t') + variables["size"] = str(size) + writemsg_stdout(varexpand(listheader, variables), noiselevel=-1) else: # check if there is enough space in DISTDIR to completely store myfile # overestimate the filesize so we aren't bitten by FS overhead @@ -826,7 +835,8 @@ continue tried_locations.add(loc) if listonly: - writemsg_stdout(loc+" ", noiselevel=-1) + if listonly_dolist: + writemsg_stdout(loc+" ", noiselevel=-1) continue # allow different fetchcommands per protocol protocol = loc[0:loc.find("://")] @@ -1092,7 +1102,7 @@ unlockfile(file_lock) file_lock = None - if listonly: + if listonly and listonly_dolist: writemsg_stdout("\n", noiselevel=-1) if fetched != 2: if restrict_fetch and not restrict_fetch_msg: