Revert "Append private key into cache folder logic so we don't collide."
This reverts commit b1799c43de7270da81633a02110854c3492a0741
Change-Id: Icab3bb8e412617cf51e062a1cea5a1db5b233c55
Reviewed-on: http://gerrit.chromium.org/gerrit/7375
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
diff --git a/autoupdate.py b/autoupdate.py
index 5666ca3..b02b7f5 100644
--- a/autoupdate.py
+++ b/autoupdate.py
@@ -286,26 +286,24 @@
def FindCachedUpdateImageSubDir(self, src_image, dest_image):
"""Find directory to store a cached update.
- Given one, or two images for an update, this finds which
- cache directory should hold the update files, even if they don't exist
- yet. The directory will be inside static_image_dir, and of the form:
+ Given one, or two images for an update, this finds which
+ cache directory should hold the update files, even if they don't exist
+ yet. The directory will be inside static_image_dir, and of the form:
- Non-delta updates:
- CACHE_DIR/12345678
- Delta updates:
- CACHE_DIR/12345678_12345678
+ Non-delta updates:
+ CACHE_DIR/12345678
- If self.private_key -- Signed updates:
- CACHE_DIR/from_above+12345678
- """
- sub_dir = self._GetMd5(dest_image)
- if src_image:
- sub_dir = '%s_%s' % (self._GetMd5(src_image), sub_dir)
+ Delta updates:
+ CACHE_DIR/12345678_12345678
+ """
+ # If there is no src, we only have an image file, check image for changes
+ if not src_image:
+ return os.path.join(CACHE_DIR, self._GetMd5(dest_image))
- if self.private_key:
- sub_dir = '%s+%s' % (sub_dir, self._GetMd5(self.private_key))
-
- return os.path.join(CACHE_DIR, sub_dir)
+ # If we have src and dest, we are a delta, and check both for changes
+ return os.path.join(CACHE_DIR,
+ "%s_%s" % (self._GetMd5(src_image),
+ self._GetMd5(dest_image)))
def GenerateUpdateImage(self, image_path, output_dir):
"""Force generates an update payload based on the given image_path.