# HG changeset patch # User Mike Miller # Date 1492743743 25200 # Node ID 75a4b9a34999cb2a69da3da37f29215a97b572c1 # Parent 0412433f016f7155076d15cf367530b52c13c7da Ensure generated source files are deterministic and reproducible * mk-builtins.pl: Sort the list of dispatch types for built-in functions to ensure that the contents of libinterp/builtins.cc are reproducible. * mk-errno-list: Sort the list of system error codes in the embedded perl and python scripts to ensure that the contents of libinterp/corefcn/oct-errno.cc are reproducible. Update the python script to be Python 3 compatible. diff -r 0412433f016f -r 75a4b9a34999 build-aux/mk-builtins.pl --- a/build-aux/mk-builtins.pl Thu Apr 20 00:16:08 2017 -0400 +++ b/build-aux/mk-builtins.pl Thu Apr 20 20:02:23 2017 -0700 @@ -274,7 +274,7 @@ } } - foreach $fcn (keys %dispatch_map) + foreach $fcn (sort (keys (%dispatch_map))) { print "\n"; diff -r 0412433f016f -r 75a4b9a34999 libinterp/mk-errno-list --- a/libinterp/mk-errno-list Thu Apr 20 00:16:08 2017 -0400 +++ b/libinterp/mk-errno-list Thu Apr 20 20:02:23 2017 -0700 @@ -25,7 +25,7 @@ if [ $1 = "--perl" ]; then PERL="$2" - $PERL -e 'foreach $key (keys(%!)) { + $PERL -e 'foreach $key (sort (keys (%!))) { $x .= "#if defined ($key)\n { \"$key\", $key, },\n#endif\n"; } while (<>) { @@ -37,15 +37,15 @@ PYTHON="$2" $PYTHON -c ' from errno import errorcode -from sys import stdin +from sys import stdin, stdout t = "#if defined (%s)\n { \"%s\", %s, },\n#endif\n" errstr = "" -for k in errorcode.keys (): - errstr += t % tuple(3*[errorcode[k]]) +for v in sorted (errorcode.values ()): + errstr += t % tuple (3 * [v]) for l in stdin: - print l.replace("@SYSDEP_ERRNO_LIST@", errstr), + stdout.write (l.replace ("@SYSDEP_ERRNO_LIST@", errstr)) ' fi