summaryrefslogtreecommitdiff
path: root/scripts/packages-formatter.py
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2022-02-28 21:56:25 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2022-02-28 21:56:25 +0200
commit1e0eafd50cc03f0796fe8678d3460aac614db603 (patch)
tree6b9efda5d63749238a786667fc2ac4c9b3fabfad /scripts/packages-formatter.py
parent1f1d762693027a0f6ce7b913bcc8984767e947be (diff)
parent6ca09a94554ec01f5c94ec60fffd01d7e33f3546 (diff)
Merge branch 'master' into DRTVWR-544-maint
# Conflicts: # indra/llaudio/llstreamingaudio_fmodstudio.cpp # indra/newview/llviewerregion.cpp
Diffstat (limited to 'scripts/packages-formatter.py')
-rwxr-xr-xscripts/packages-formatter.py23
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()