Entropy/Spritz:

- implement sources download here too


git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@2766 cd1c1023-2f26-0410-ae45-c471fc1f0318
This commit is contained in:
lxnay
2008-12-11 00:05:42 +00:00
parent daae0887d6
commit c9f2a293a5
3 changed files with 1277 additions and 1269 deletions
+14 -6
View File
@@ -51,7 +51,7 @@ class QueueExecutor:
else:
return 0,licenses
def run(self, install_queue, removal_queue, do_purge_cache = [], fetch_only = False):
def run(self, install_queue, removal_queue, do_purge_cache = [], fetch_only = False, download_sources = False):
# unmask packages
for match in self.Spritz.etpbase.unmaskingPackages:
@@ -96,6 +96,13 @@ class QueueExecutor:
# first fetch all
fetchqueue = 0
mykeys = {}
fetch_action = "fetch"
fetch_string = "%s: " % (_("Fetching"),)
if download_sources:
fetch_string = "%s: " % (_("Downloading sources"),)
fetch_action = "source"
for packageInfo in runQueue:
self.Spritz.queue_bombing()
@@ -104,7 +111,7 @@ class QueueExecutor:
Package = self.Entropy.Package()
metaopts = {}
metaopts['fetch_abort_function'] = self.Spritz.mirror_bombing
Package.prepare(packageInfo,"fetch",metaopts)
Package.prepare(packageInfo,fetch_action,metaopts)
myrepo = Package.infoDict['repository']
if not mykeys.has_key(myrepo):
@@ -112,7 +119,7 @@ class QueueExecutor:
mykeys[myrepo].add(self.Entropy.entropyTools.dep_getkey(Package.infoDict['atom']))
self.Entropy.updateProgress(
"Fetching: "+Package.infoDict['atom'],
fetch_string+Package.infoDict['atom'],
importance = 2,
count = (fetchqueue,totalqueue)
)
@@ -131,12 +138,13 @@ class QueueExecutor:
self.Entropy.UGC.add_downloads(myrepo, mypkgkeys)
except:
pass
t = self.Entropy.entropyTools.parallelTask(spawn_ugc)
t.start()
if not download_sources:
t = self.Entropy.entropyTools.parallelTask(spawn_ugc)
t.start()
self.Spritz.ui.skipMirror.hide()
if fetch_only:
if fetch_only or download_sources:
return 0,0
# then removalQueue
+1258 -1259
View File
File diff suppressed because it is too large Load Diff
+5 -4
View File
@@ -1283,7 +1283,7 @@ class SpritzApplication(Controller):
self.resetQueueProgressBars()
self.disable_ugc = False
def processPackageQueue(self, pkgs, remove_repos = [], fetch_only = False):
def processPackageQueue(self, pkgs, remove_repos = [], fetch_only = False, download_sources = False):
# preventive check against other instances
locked = self.Equo.application_lock_check()
@@ -1312,7 +1312,7 @@ class SpritzApplication(Controller):
controller = QueueExecutor(self)
try:
e,i = controller.run(install_queue[:], removal_queue[:], do_purge_cache, fetch_only = fetch_only)
e,i = controller.run(install_queue[:], removal_queue[:], do_purge_cache, fetch_only = fetch_only, download_sources = download_sources)
except exceptionTools.QueueError:
e = 1
self.ui.skipMirror.hide()
@@ -1326,7 +1326,7 @@ class SpritzApplication(Controller):
self.endWorking()
self.progress.reset_progress()
if not fetch_only:
if (not fetch_only) and (not download_sources):
self.etpbase.clearPackages()
self.etpbase.clearCache()
for myrepo in remove_repos:
@@ -2015,8 +2015,9 @@ class SpritzApplication(Controller):
return
fetch_only = self.ui.queueProcessFetchOnly.get_active()
download_sources = self.ui.queueProcessDownloadSource.get_active()
rc = self.processPackageQueue(self.queue.packages, fetch_only = fetch_only)
rc = self.processPackageQueue(self.queue.packages, fetch_only = fetch_only, download_sources = download_sources)
self.resetQueueProgressBars()
if rc and not fetch_only:
self.queue.clear() # Clear package queue