Bug 899241 - Add process_install_manifest build action; r=glandium
authorGregory Szorc <gps@mozilla.com>
Tue, 30 Jul 2013 16:58:33 -0700
changeset 140690 a9e41a4c4ee4a65f5208c67a93e8f9319b12f360
parent 140689 aebee2f3b9b22529a2d3ad03f6ec6d8a7a76ac98
child 140691 7656ce2cd32952dc09fa03abcca60a8f49a7d189
push id31827
push usergszorc@mozilla.com
push dateWed, 31 Jul 2013 02:05:27 +0000
treeherdermozilla-inbound@a9e41a4c4ee4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs899241
milestone25.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 899241 - Add process_install_manifest build action; r=glandium
python/mozbuild/mozbuild/action/process_install_manifest.py
new file mode 100644
--- /dev/null
+++ b/python/mozbuild/mozbuild/action/process_install_manifest.py
@@ -0,0 +1,41 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+from __future__ import print_function, unicode_literals
+
+import argparse
+from mozpack.copier import FileCopier
+from mozpack.manifests import InstallManifest
+
+
+COMPLETE = 'From {dest}: Kept {existing} existing; Added/updated {updated}; ' \
+    'Removed {rm_files} files and {rm_dirs} directories.'
+
+
+def process_manifest(destdir, *paths):
+    manifest = InstallManifest()
+    for path in paths:
+        manifest |= InstallManifest(path=path)
+
+    copier = FileCopier()
+    manifest.populate_registry(copier)
+    return copier.copy(destdir)
+
+
+if __name__ == '__main__':
+    parser = argparse.ArgumentParser(
+        description='Process install manifest files.')
+
+    parser.add_argument('destdir', help='Destination directory.')
+    parser.add_argument('manifests', nargs='+', help='Path to manifest file(s).')
+
+    args = parser.parse_args()
+
+    result = process_manifest(args.destdir, *args.manifests)
+
+    print(COMPLETE.format(dest=args.destdir,
+        existing=result.existing_files_count,
+        updated=result.updated_files_count,
+        rm_files=result.removed_files_count,
+        rm_dirs=result.removed_directories_count))