Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Side by Side Diff: parallel_emerge

Issue 3035058: parallel_emerge: catch 404 errors when getting packages (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/crosutils.git
Patch Set: sigh. tab fix Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python2.6 1 #!/usr/bin/python2.6
2 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 2 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Program to run emerge in parallel, for significant speedup. 6 """Program to run emerge in parallel, for significant speedup.
7 7
8 Usage: 8 Usage:
9 ./parallel_emerge [--board=BOARD] [--workon=PKGS] [--no-workon-deps] 9 ./parallel_emerge [--board=BOARD] [--workon=PKGS] [--no-workon-deps]
10 [emerge args] package" 10 [emerge args] package"
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 Returns: 806 Returns:
807 A dict mapping package identifiers to modification times. 807 A dict mapping package identifiers to modification times.
808 """ 808 """
809 809
810 if not binhost_url: 810 if not binhost_url:
811 return {} 811 return {}
812 812
813 url = binhost_url + "/Packages" 813 url = binhost_url + "/Packages"
814 814
815 prebuilt_pkgs = {} 815 prebuilt_pkgs = {}
816 f = urllib2.urlopen(url) 816 try:
817 f = urllib2.urlopen(url)
818 except urllib2.HTTPError as e:
819 if e.code == 404:
820 return {}
821 else:
822 raise
817 for line in f: 823 for line in f:
818 if line.startswith("CPV: "): 824 if line.startswith("CPV: "):
819 pkg = line.replace("CPV: ", "").rstrip() 825 pkg = line.replace("CPV: ", "").rstrip()
820 elif line.startswith("MTIME: "): 826 elif line.startswith("MTIME: "):
821 prebuilt_pkgs[pkg] = int(line[:-1].replace("MTIME: ", "")) 827 prebuilt_pkgs[pkg] = int(line[:-1].replace("MTIME: ", ""))
822 f.close() 828 f.close()
823 829
824 return prebuilt_pkgs 830 return prebuilt_pkgs
825 831
826 def LocalPackageDatabase(): 832 def LocalPackageDatabase():
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
1323 world_set.update(new_world_pkgs) 1329 world_set.update(new_world_pkgs)
1324 1330
1325 # Update environment (library cache, symlinks, etc.) 1331 # Update environment (library cache, symlinks, etc.)
1326 if deps.board and "--pretend" not in emerge.opts: 1332 if deps.board and "--pretend" not in emerge.opts:
1327 portage.env_update() 1333 portage.env_update()
1328 1334
1329 print "Done" 1335 print "Done"
1330 1336
1331 if __name__ == "__main__": 1337 if __name__ == "__main__":
1332 main() 1338 main()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698