From bf2b3a2a0b16c017abff41fdb4f8c82e2aef82fd Mon Sep 17 00:00:00 2001 From: Andy Fiddaman Date: Sun, 11 Sep 2022 19:00:07 +0000 Subject: 14961 validate_pkg crashes with bad manifest Reviewed by: Jason King Reviewed by: Gordon Ross Approved by: Joshua M. Clulow --- usr/src/tools/scripts/validate_pkg.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'usr/src/tools/scripts/validate_pkg.py') diff --git a/usr/src/tools/scripts/validate_pkg.py b/usr/src/tools/scripts/validate_pkg.py index 18a2c0cc77..058a8f6542 100644 --- a/usr/src/tools/scripts/validate_pkg.py +++ b/usr/src/tools/scripts/validate_pkg.py @@ -25,7 +25,7 @@ # Use is subject to license terms. # -# Copyright 2018 OmniOS Community Edition (OmniOSce) Association. +# Copyright 2022 OmniOS Community Edition (OmniOSce) Association. # # Compare the content generated by a build to a set of manifests @@ -34,6 +34,8 @@ import getopt +import gettext +import locale import os import stat import sys @@ -41,7 +43,6 @@ import sys from pkg import actions from pkg import manifest - # # Dictionary used to map action names to output format. Each entry is # indexed by action name, and consists of a list of tuples that map @@ -889,6 +890,10 @@ def main(argv): trees[0].compare(trees[1]) if __name__ == '__main__': + locale.setlocale(locale.LC_ALL, "") + gettext.install("pkg", "/usr/share/locale", + codeset=locale.getpreferredencoding()) + try: main(sys.argv[1:]) except KeyboardInterrupt: -- cgit v1.2.3