summaryrefslogtreecommitdiffstats
path: root/media/mtransport/third_party/import.py
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /media/mtransport/third_party/import.py
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'media/mtransport/third_party/import.py')
-rw-r--r--media/mtransport/third_party/import.py40
1 files changed, 40 insertions, 0 deletions
diff --git a/media/mtransport/third_party/import.py b/media/mtransport/third_party/import.py
new file mode 100644
index 000000000..6defdf26b
--- /dev/null
+++ b/media/mtransport/third_party/import.py
@@ -0,0 +1,40 @@
+#!/usr/bin/env python
+# 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/.
+#
+# Execute as: /import.py <source-distribution> <target-dir>
+# <target-dir> must have 'IMPORT_FILES' in it
+
+import sys
+import re
+import os
+import shutil
+
+def die(msg):
+ sys.stderr.write('ERROR:' + msg + '\n')
+ sys.exit(1)
+
+DISTRO = sys.argv[1]
+IMPORT_DIR = sys.argv[2]
+FILES = []
+
+f = open("%s/IMPORT_FILES" % IMPORT_DIR)
+for l in f:
+ l = l.strip()
+ l = l.strip("'")
+ if l.startswith("#"):
+ continue
+ if not l:
+ continue
+ FILES.append(l)
+
+for f in FILES:
+ print f
+ SOURCE_PATH = "%s/%s"%(DISTRO,f)
+ DEST_PATH = "%s/%s"%(IMPORT_DIR,f)
+ if not os.path.exists(SOURCE_PATH):
+ die("%s does not exist"%SOURCE_PATH)
+ if not os.path.exists(os.path.dirname(DEST_PATH)):
+ os.makedirs(os.path.dirname(DEST_PATH))
+ shutil.copyfile(SOURCE_PATH, DEST_PATH)