diff options
author | mona <mona@monapc.(none)> | 2010-06-15 00:08:06 +0300 |
---|---|---|
committer | mona <mona@monapc.(none)> | 2010-06-15 00:14:16 +0300 |
commit | f743b077a6063322f478caa1479ea1f326eefeb5 (patch) | |
tree | 069df2e648abb49cf427ba6c3570abe34267c1d5 | |
parent | Add export of requested packages (including distfiles) for twrapper (diff) | |
download | portage-idfetch-f743b077a6063322f478caa1479ea1f326eefeb5.tar.gz portage-idfetch-f743b077a6063322f478caa1479ea1f326eefeb5.tar.bz2 portage-idfetch-f743b077a6063322f478caa1479ea1f326eefeb5.zip |
Add check for duplicates - don't append duplicated distfiles to the list.
-rw-r--r-- | pym/portage/package/ebuild/fetch.py | 48 |
1 files changed, 29 insertions, 19 deletions
diff --git a/pym/portage/package/ebuild/fetch.py b/pym/portage/package/ebuild/fetch.py index bad635f5..973ddaf5 100644 --- a/pym/portage/package/ebuild/fetch.py +++ b/pym/portage/package/ebuild/fetch.py @@ -224,7 +224,7 @@ _size_suffix_map = { def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",use_locks=1, try_mirrors=1): "fetch files. Will use digest file if available." - use_twrapper_to_download = "USE_TWRAPPER" in mysettings + use_twrapper_to_download = ("USE_TWRAPPER" in mysettings) and fetchonly; if use_twrapper_to_download: # print("mysettings[DISTDIR]: ",mysettings["DISTDIR"]) # TO-DO: wait for release of lock_file, create lock_file, load file, unlink lock_file @@ -800,24 +800,34 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks", continue # fetch any remaining files if use_twrapper_to_download: - idfetch_distfile=dict() - idfetch_distfile['name']=myfile - idfetch_distfile['url_list']=filedict[myfile][:] - if restrict_fetch and not(filedict[myfile]): - idfetch_distfile['myuri']=myuri - msg = _("\n!!! %s/%s" - " has fetch restriction turned on.\n" - "!!! This probably means that this " - "ebuild's files must be downloaded\n" - "!!! manually. See the comments in" - " the ebuild for more information.\n\n") % \ - (mysettings["CATEGORY"], mysettings["PF"]) - writemsg_level(msg, - level=logging.ERROR, noiselevel=-1) - print("*** Download file",myuri," manually and place it in "+mysettings["DISTDIR"]+"\n") - for field in mydigests[myfile]: - idfetch_distfile[field]=mydigests[myfile][field] - idfetch_pkg['distfile_list'].append(idfetch_distfile) + #check for duplicates + has_duplicate=0 + for cur_pkg in idfetch_pkg_list: + for cur_distfile in cur_pkg['distfile_list']: + if cur_distfile['name']==myfile: + has_duplicate=1 + break + if has_duplicate: + break; + if not(has_duplicate): + idfetch_distfile=dict() + idfetch_distfile['name']=myfile + idfetch_distfile['url_list']=filedict[myfile][:] + if restrict_fetch and not(filedict[myfile]): + idfetch_distfile['myuri']=myuri + msg = _("\n!!! %s/%s" + " has fetch restriction turned on.\n" + "!!! This probably means that this " + "ebuild's files must be downloaded\n" + "!!! manually. See the comments in" + " the ebuild for more information.\n\n") % \ + (mysettings["CATEGORY"], mysettings["PF"]) + writemsg_level(msg, + level=logging.ERROR, noiselevel=-1) + print("*** Download file",myuri," manually and place it in "+mysettings["DISTDIR"]+"\n") + for field in mydigests[myfile]: + idfetch_distfile[field]=mydigests[myfile][field] + idfetch_pkg['distfile_list'].append(idfetch_distfile) continue # Create a reversed list since that is optimal for list.pop(). |