all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob 403b2df62aeeadb1d762dd101fcc989e580a03d8 877 bytes (raw)
name: gnu/packages/patches/python-3.4.3-source-date-epoch.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
 
diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py
index 5b91c05..a87d178 100644
--- Lib/importlib/_bootstrap.py
+++ Lib/importlib/_bootstrap.py
@@ -666,8 +666,15 @@ def _compile_bytecode(data, name=None, bytecode_path=None, source_path=None):
 def _code_to_bytecode(code, mtime=0, source_size=0):
     """Compile a code object into bytecode for writing out to a byte-compiled
     file."""
+    """os and locale are required for the SOURCE_DATE_EPOCH
+    deterministic timestamp conditional."""
+    import os
+    import locale
     data = bytearray(MAGIC_NUMBER)
-    data.extend(_w_long(mtime))
+    if os.getenv('SOURCE_DATE_EPOCH'):
+        data.extend(_w_long(locale.atoi(os.getenv('SOURCE_DATE_EPOCH'))))
+    else:
+        data.extend(_w_long(mtime))
     data.extend(_w_long(source_size))
     data.extend(marshal.dumps(code))
     return data

debug log:

solving 403b2df ...
found 403b2df in https://yhetil.org/guix/20160204231708.GA1297@jasmine/

applying [1/1] https://yhetil.org/guix/20160204231708.GA1297@jasmine/
diff --git a/gnu/packages/patches/python-3.4.3-source-date-epoch.patch b/gnu/packages/patches/python-3.4.3-source-date-epoch.patch
new file mode 100644
index 0000000..403b2df

Checking patch gnu/packages/patches/python-3.4.3-source-date-epoch.patch...
Applied patch gnu/packages/patches/python-3.4.3-source-date-epoch.patch cleanly.

index at:
100644 403b2df62aeeadb1d762dd101fcc989e580a03d8	gnu/packages/patches/python-3.4.3-source-date-epoch.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.