summaryrefslogtreecommitdiff
path: root/PC
diff options
context:
space:
mode:
authorPaul Monson <paulmon@users.noreply.github.com>2019-04-12 09:55:57 -0700
committerSteve Dower <steve.dower@microsoft.com>2019-04-12 09:55:57 -0700
commitf4e5661e85ac41c987165246d2b33f363cd01e34 (patch)
treedb0b47a72c422139e38d3b6cf798186987e9893d /PC
parentaa25d5d026b21a6bac66ff1c47e96cbf6227473a (diff)
downloadcpython-git-f4e5661e85ac41c987165246d2b33f363cd01e34.tar.gz
bpo-36509: Add iot layout for Windows IoT containers (GH-12663)
This enables using the `--preset-iot` option with the PC/layout script, but does not enable IoT builds as part of any normal release.
Diffstat (limited to 'PC')
-rw-r--r--PC/layout/main.py16
-rw-r--r--PC/layout/support/options.py4
2 files changed, 18 insertions, 2 deletions
diff --git a/PC/layout/main.py b/PC/layout/main.py
index 185e6498e1..624033e721 100644
--- a/PC/layout/main.py
+++ b/PC/layout/main.py
@@ -66,6 +66,18 @@ DATA_DIRS = FileNameSet("data")
TOOLS_DIRS = FileNameSet("scripts", "i18n", "pynche", "demo", "parser")
TOOLS_FILES = FileSuffixSet(".py", ".pyw", ".txt")
+def copy_if_modified(src, dest):
+ try:
+ dest_stat = os.stat(dest)
+ except FileNotFoundError:
+ do_copy = True
+ else:
+ src_stat = os.stat(src)
+ do_copy = (src_stat.st_mtime != dest_stat.st_mtime or
+ src_stat.st_size != dest_stat.st_size)
+
+ if do_copy:
+ shutil.copy2(src, dest)
def get_lib_layout(ns):
def _c(f):
@@ -426,7 +438,7 @@ def copy_files(files, ns):
need_compile.append((dest, ns.copy / dest))
else:
(ns.temp / "Lib" / dest).parent.mkdir(parents=True, exist_ok=True)
- shutil.copy2(src, ns.temp / "Lib" / dest)
+ copy_if_modified(src, ns.temp / "Lib" / dest)
need_compile.append((dest, ns.temp / "Lib" / dest))
if src not in EXCLUDE_FROM_CATALOG:
@@ -436,7 +448,7 @@ def copy_files(files, ns):
log_debug("Copy {} -> {}", src, ns.copy / dest)
(ns.copy / dest).parent.mkdir(parents=True, exist_ok=True)
try:
- shutil.copy2(src, ns.copy / dest)
+ copy_if_modified(src, ns.copy / dest)
except shutil.SameFileError:
pass
diff --git a/PC/layout/support/options.py b/PC/layout/support/options.py
index 22492f220d..00f05667eb 100644
--- a/PC/layout/support/options.py
+++ b/PC/layout/support/options.py
@@ -63,6 +63,10 @@ PRESETS = {
"props"
],
},
+ "iot": {
+ "help": "Windows IoT Core",
+ "options": ["stable", "pip"],
+ },
"default": {
"help": "development kit package",
"options": [