This commit is contained in:
Shelley Vohr 2024-06-07 12:21:02 +02:00 коммит произвёл GitHub
Родитель 540d88f809
Коммит 52bc1dc085
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
3 изменённых файлов: 3 добавлений и 82 удалений

Просмотреть файл

@ -260,9 +260,9 @@ step-depot-tools-get: &step-depot-tools-get
index c305c248..e6e0fbdc 100755
--- a/gclient.py
+++ b/gclient.py
@@ -735,7 +735,8 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
if dep_type == 'cipd':
@@ -783,7 +783,8 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
not condition or "non_git_source" not in condition):
continue
cipd_root = self.GetCipdRoot()
- for package in dep_value.get('packages', []):
+ packages = dep_value.get('packages', [])

Просмотреть файл

@ -127,4 +127,3 @@ fix_add_support_for_skipping_first_2_no-op_refreshes_in_thumb_cap.patch
refactor_expose_file_system_access_blocklist.patch
partially_revert_is_newly_created_to_allow_for_browser_initiated.patch
feat_add_support_for_missing_dialog_features_to_shell_dialogs.patch
cherry-pick-22db6918bac9.patch

Просмотреть файл

@ -1,78 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Josip Sokcevic <sokcevic@chromium.org>
Date: Thu, 9 May 2024 18:45:52 +0000
Subject: Add hook to delete stale files
download_from_google_storage leaves archive data on disk, near .sha1
files. As we move those hooks to native DEPS, we no longer need to do
that.
Old checkouts will still have archive files around, and removing just
.gitignore entry can be confusing to our users as it will show up as
untracked file. This CL adds a hook runs that cleans up stale files left
by download_from_google_storage (and anything else in the future). This
change also removes .gitignore entry for test_fonts.tar.gz.
R=bjoyce@chromium.org
Bug: 336625018
Change-Id: Id40b7f30d3353e4fa57a4c0dd172414838b483af
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5523918
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: Benjamin Joyce (Ben) <bjoyce@chromium.org>
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: Thomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1298764}
diff --git a/DEPS b/DEPS
index b15e782d99659792fa03fea7cf7abf9df3425803..35690149aa76c7557a83f5d1291e41181708359b 100644
--- a/DEPS
+++ b/DEPS
@@ -4660,6 +4660,17 @@ hooks = [
'--disable',
],
},
+ {
+ # Ensure we remove any file from disk that is no longer needed (e.g. after
+ # hooks to native GCS deps migration).
+ 'name': 'remove_stale_files',
+ 'pattern': '.',
+ 'action': [
+ 'python3',
+ 'src/tools/remove_stale_files.py',
+ 'src/third_party/test_fonts/test_fonts.tar.gz', # Remove after 20240901
+ ],
+ },
{
# Ensure that we don't accidentally reference any .pyc files whose
# corresponding .py files have since been deleted.
diff --git a/tools/remove_stale_files.py b/tools/remove_stale_files.py
new file mode 100755
index 0000000000000000000000000000000000000000..5973fd57bc99e7e702346eb048985c599268c2b2
--- /dev/null
+++ b/tools/remove_stale_files.py
@@ -0,0 +1,23 @@
+#!/usr/bin/env python
+# Copyright 2024 The Chromium Authors
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import os
+import sys
+
+
+def RemoveAllStaleFiles(paths):
+ """Check if any stale files (e.g. old GCS archives) are on filesystem, and
+ remove them."""
+ for path in paths:
+ try:
+ if os.path.exists(path) and not os.path.isdir(path):
+ os.remove(path)
+ except OSError:
+ # Wrap OS calls in try/except in case another process touched this file.
+ pass
+
+
+if __name__ == '__main__':
+ RemoveAllStaleFiles(sys.argv[1:])