diff options
author | Mnikolenko Productengine <mnikolenko@productengine.com> | 2022-03-02 00:46:10 +0200 |
---|---|---|
committer | Mnikolenko Productengine <mnikolenko@productengine.com> | 2022-03-02 00:46:10 +0200 |
commit | 0aaf5284dced4ec41924c771a382d12ddc5f3d1b (patch) | |
tree | 448ad9399feee611f992ceeb667cd4e47e9ab594 /scripts/packages-formatter.py | |
parent | 882600de2afa366729be870355767282247be0ef (diff) | |
parent | 6ca09a94554ec01f5c94ec60fffd01d7e33f3546 (diff) |
Merge branch 'master' into DRTVWR-539
# Conflicts:
# autobuild.xml
# doc/contributions.txt
# indra/cmake/GLOD.cmake
# indra/llcommon/tests/llprocess_test.cpp
# indra/newview/VIEWER_VERSION.txt
# indra/newview/lldrawpoolavatar.cpp
# indra/newview/llfloatermodelpreview.cpp
# indra/newview/llmodelpreview.cpp
# indra/newview/llviewertexturelist.cpp
# indra/newview/llvovolume.cpp
# indra/newview/viewer_manifest.py
Diffstat (limited to 'scripts/packages-formatter.py')
-rwxr-xr-x | scripts/packages-formatter.py | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/scripts/packages-formatter.py b/scripts/packages-formatter.py index b1eef3c721..ff7c892577 100755 --- a/scripts/packages-formatter.py +++ b/scripts/packages-formatter.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """\ This module formats the package version and copyright information for the viewer and its dependent packages. @@ -37,6 +37,9 @@ parser.add_argument('version', help='viewer version number') args = parser.parse_args() _autobuild=os.getenv('AUTOBUILD', 'autobuild') +_autobuild_env=os.environ.copy() +# Coerce stdout encoding to utf-8 as cygwin's will be detected as cp1252 otherwise. +_autobuild_env["PYTHONIOENCODING"] = "utf-8" pkg_line=re.compile('^([\w-]+):\s+(.*)$') @@ -50,7 +53,7 @@ def autobuild(*args): try: child = subprocess.Popen(command, stdin=None, stdout=subprocess.PIPE, - universal_newlines=True) + universal_newlines=True, env=_autobuild_env) except OSError as err: if err.errno != errno.ENOENT: # Don't attempt to interpret anything but ENOENT @@ -110,20 +113,20 @@ for key, rawdata in ("versions", versions), ("copyrights", copyrights): break # Now that we've run through all of both outputs -- are there duplicates? -if any(pkgs for pkgs in dups.values()): - for key, pkgs in dups.items(): +if any(pkgs for pkgs in list(dups.values())): + for key, pkgs in list(dups.items()): if pkgs: - print >>sys.stderr, "Duplicate %s for %s" % (key, ", ".join(pkgs)) + print("Duplicate %s for %s" % (key, ", ".join(pkgs)), file=sys.stderr) sys.exit(1) -print "%s %s" % (args.channel, args.version) -print viewer_copyright +print("%s %s" % (args.channel, args.version)) +print(viewer_copyright) version = list(info['versions'].items()) version.sort() for pkg, pkg_version in version: - print ': '.join([pkg, pkg_version]) + print(': '.join([pkg, pkg_version])) try: - print info['copyrights'][pkg] + print(info['copyrights'][pkg]) except KeyError: sys.exit("No copyright for %s" % pkg) - print + print() |