Merge branch 'release/1.10.x'
This commit is contained in:
commit
5a4ff7f6c0
|
|
@ -1751,7 +1751,7 @@ class Freezer:
|
|||
return target
|
||||
|
||||
def generateRuntimeFromStub(self, target, stub_file, use_console, fields={},
|
||||
log_append=False):
|
||||
log_append=False, log_filename_strftime=False):
|
||||
self.__replacePaths()
|
||||
|
||||
# We must have a __main__ module to make an exe file.
|
||||
|
|
@ -1934,9 +1934,12 @@ class Freezer:
|
|||
# A null entry marks the end of the module table.
|
||||
blob += struct.pack(entry_layout, 0, 0, 0)
|
||||
|
||||
# These flags should match the enum in deploy-stub.c
|
||||
flags = 0
|
||||
if log_append:
|
||||
flags |= 1
|
||||
if log_filename_strftime:
|
||||
flags |= 2
|
||||
|
||||
# Compose the header we will be writing to the stub, to tell it
|
||||
# where to find the module data blob, as well as other variables.
|
||||
|
|
|
|||
|
|
@ -186,6 +186,7 @@ class build_apps(setuptools.Command):
|
|||
self.extra_prc_data = ''
|
||||
self.default_prc_dir = None
|
||||
self.log_filename = None
|
||||
self.log_filename_strftime = False
|
||||
self.log_append = False
|
||||
self.requirements_path = os.path.join(os.getcwd(), 'requirements.txt')
|
||||
self.use_optimized_wheels = True
|
||||
|
|
@ -721,7 +722,7 @@ class build_apps(setuptools.Command):
|
|||
'prc_executable_args_envvar': None,
|
||||
'main_dir': None,
|
||||
'log_filename': self.expand_path(self.log_filename, platform),
|
||||
}, self.log_append)
|
||||
}, self.log_append, self.log_filename_strftime)
|
||||
stub_file.close()
|
||||
|
||||
if temp_file:
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
/* Stored in the flags field of the blobinfo structure below. */
|
||||
enum Flags {
|
||||
F_log_append = 1,
|
||||
F_log_filename_strftime = 2,
|
||||
};
|
||||
|
||||
/* Define an exposed symbol where we store the offset to the module data. */
|
||||
|
|
@ -671,6 +672,14 @@ int main(int argc, char *argv[]) {
|
|||
}
|
||||
|
||||
if (log_filename != NULL) {
|
||||
char log_filename_buf[PATH_MAX];
|
||||
if (blobinfo.flags & F_log_filename_strftime) {
|
||||
log_filename_buf[0] = 0;
|
||||
time_t now = time(NULL);
|
||||
if (strftime(log_filename_buf, sizeof(log_filename_buf), log_filename, localtime(&now)) > 0) {
|
||||
log_filename = &log_filename_buf;
|
||||
}
|
||||
}
|
||||
setup_logging(log_filename, (blobinfo.flags & F_log_append) != 0);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue