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

Unified Diff: autoupdate.py

Issue 5297002: --archive_dir will now serve existing update.gz (Closed) Base URL: http://git.chromium.org/git/dev-util.git@master
Patch Set: Created 10 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: autoupdate.py
diff --git a/autoupdate.py b/autoupdate.py
index 2addd2c760976eeaa6382ed0b911d5f2b9a2088e..cc84c9613e5e56fb0f572c73665440170708c678 100644
--- a/autoupdate.py
+++ b/autoupdate.py
@@ -22,8 +22,9 @@ class Autoupdate(BuildObject):
"""Class that contains functionality that handles Chrome OS update pings.
Members:
- serve_only: Serve images from a pre-built image.zip file. static_dir
- must be set to the location of the image.zip.
+ serve_only: Serve updates from a pre-built image.zip file. If an update.gz
sosa 2010/11/23 19:50:36 is newer*
+ newer than the extracted image exists in the static_dir, it will be
sosa 2010/11/23 19:50:36 This is a little confusing. Can you make another
+ served instead. static_dir must be set to the location of the image.zip.
factory_config: Path to the factory config file if handling factory
requests.
use_test_image: Use chromiumos_test_image.bin rather than the standard.
@@ -545,6 +546,15 @@ class Autoupdate(BuildObject):
self.forced_image,
static_image_dir=static_image_dir)
elif self.serve_only:
+ image_path = os.path.join(static_image_dir, self._GetImageName())
+ update_path = os.path.join(static_image_dir, UPDATE_FILE)
+
+ # If a valid update already exists, no need to generate.
+ if (os.path.exists(image_path) and os.path.exists(update_path) and
+ os.path.getmtime(image_path) < os.path.getmtime(update_path)):
sosa 2010/11/23 19:50:36 Can you fold this into GenerateImageFromZip and re
DaleCurtis 2010/11/23 20:11:20 I can if you really want to. I think it's confusin
sosa 2010/11/23 20:45:57 I'm ok with removing the logic but you many want t
DaleCurtis 2010/11/23 21:02:37 Sent, I'll give it until next week before making a
+ _LogMessage('Existing update found to serve.')
+ return UPDATE_FILE
+
return self.GenerateImageFromZip(static_image_dir)
else:
if board_id:
« 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