Revert "Use fixed timestamps before performing api diff operation." am: 28a0ee3240

Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2265384

Change-Id: I174120c09a6dcc467d519d00c54a23b602393daa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Gurpreet Singh
2022-10-21 13:43:49 +00:00
committed by Automerger Merge Worker

View File

@@ -303,11 +303,6 @@ def set_default_timestamp(base_dir, paths):
p = os.path.join(base_dir, path) p = os.path.join(base_dir, path)
os.utime(p, (timestamp, timestamp)) os.utime(p, (timestamp, timestamp))
# set the timestamp of the file path to default_zip_time.
def set_default_timestamp_to_file(file_path):
timestamp = default_zip_time.timestamp()
os.utime(file_path, (timestamp, timestamp))
@dataclasses.dataclass() @dataclasses.dataclass()
class SnapshotBuilder: class SnapshotBuilder:
@@ -541,8 +536,6 @@ java_sdk_library_import {{
with zipfile.ZipFile(sdk_zip_file, "r") as zipObj: with zipfile.ZipFile(sdk_zip_file, "r") as zipObj:
extracted_current_api = zipObj.extract( extracted_current_api = zipObj.extract(
member=current_api, path=snapshots_dir) member=current_api, path=snapshots_dir)
set_default_timestamp_to_file(extracted_current_api)
set_default_timestamp_to_file(latest_api)
# The diff tool has an exit code of 0, 1 or 2 depending on whether # The diff tool has an exit code of 0, 1 or 2 depending on whether
# it find no differences, some differences or an error (like missing # it find no differences, some differences or an error (like missing
# file). As 0 or 1 are both valid results this cannot use check=True # file). As 0 or 1 are both valid results this cannot use check=True