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

Unified Diff: build/linux/sysroot_scripts/merge-package-lists.py

Issue 2270253002: Give precedence to trusty-updates in trusty sysroot (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@RefactorSysrootCreator
Patch Set: Created 4 years, 4 months 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
Index: build/linux/sysroot_scripts/merge-package-lists.py
diff --git a/build/linux/sysroot_scripts/merge-package-lists.py b/build/linux/sysroot_scripts/merge-package-lists.py
new file mode 100755
index 0000000000000000000000000000000000000000..4d80c0b3a6f60ef223f0365cdd30843d2ec40829
--- /dev/null
+++ b/build/linux/sysroot_scripts/merge-package-lists.py
@@ -0,0 +1,27 @@
+#!/usr/bin/env python
+# Copyright (c) 2016 The Chromium Authors. All rights reserved.
Lei Zhang 2016/08/24 18:37:02 no (c)
Tom (Use chromium acct) 2016/08/24 22:45:21 Done.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
Lei Zhang 2016/08/24 18:37:02 Can you add some comments to explain what this doe
Tom (Use chromium acct) 2016/08/24 22:45:21 Done.
+import sys
+
+if len(sys.argv) != 2:
+ exit(1)
+
+packages = {}
+
+def AddPackagesFromFile(file):
+ global packages
+ lines = file.readlines()
+ if len(lines) % 3 != 0:
+ exit(1)
+ for i in range(0, len(lines), 3):
Lei Zhang 2016/08/24 18:37:02 xrange?
Tom (Use chromium acct) 2016/08/24 22:45:21 Done.
+ packages[lines[i]] = (lines[i + 1], lines[i + 2])
+
+AddPackagesFromFile(open(sys.argv[1], 'r'))
+AddPackagesFromFile(sys.stdin)
+
+output_file = open(sys.argv[1], 'w')
+
+for (package, (filename, sha256)) in packages.iteritems():
+ output_file.write(package + filename + sha256)
« no previous file with comments | « no previous file | build/linux/sysroot_scripts/sysroot-creator.sh » ('j') | build/linux/sysroot_scripts/sysroot-creator.sh » ('J')

Powered by Google App Engine
This is Rietveld 408576698