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: |