From 917d12cd7eec223508c3ecd7b958ddb6e95a10a1 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Tue, 19 Jan 2021 16:28:51 +0100 Subject: [PATCH 1/3] bootstrap_sdk: The CONTENTS files are now gzipped A newer version of catalyst seems to be actually gzipping the CONTENTS files, so take this into accout. --- bootstrap_sdk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrap_sdk b/bootstrap_sdk index d7910631e3..3dbac8150f 100755 --- a/bootstrap_sdk +++ b/bootstrap_sdk @@ -91,8 +91,8 @@ if [[ "$STAGES" =~ stage4 ]]; then release_name="${TYPE}-${ARCH}-${FLAGS_version}.tar.bz2" build_image="${BUILDS}/${build_name}" release_image="${BUILDS}/${release_name}" - build_contents="${build_image}.CONTENTS" - release_contents="${release_image}.CONTENTS" + build_contents="${build_image}.CONTENTS.gz" + release_contents="${release_image}.CONTENTS.gz" build_digests="${build_image}.DIGESTS" release_digests="${release_image}.DIGESTS" ln -f "${build_image}" "${release_image}" From 647690e264e52d4edb56cbf4fcb70d807fadccf7 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Wed, 3 Feb 2021 14:16:20 +0100 Subject: [PATCH 2/3] build_library/check_root: Port to python3 The script needs to be ported, because it is importing portage code which became python3 only. The porting I did is likely a lousy job, but at least it stopped failing with some p(yt)hony errors. --- build_library/check_root | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/build_library/check_root b/build_library/check_root index fb181a5756..8c522957a2 100755 --- a/build_library/check_root +++ b/build_library/check_root @@ -1,11 +1,9 @@ -#!/usr/bin/python +#!/usr/bin/python3 # Copyright (c) 2015 The CoreOS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -from __future__ import unicode_literals - import fnmatch import os import stat @@ -106,12 +104,12 @@ IGNORE_MISSING = { USR_LINKS = ("/bin/", "/sbin/", "/lib/", "/lib32/", "/lib64/") IGNORE_SHEBANG = ( - b"*/python[0-9].[0-9]/cgi.py", - b"*/usr/lib64/modules/*/source/scripts/*", - b"*/usr/share/nova-agent/*/etc/gentoo/nova-agent", - b"*/tmp/*", - b"*/Documentation/*", - b"*/doc/*", + "*/python[0-9].[0-9]/cgi.py", + "*/usr/lib64/modules/*/source/scripts/*", + "*/usr/share/nova-agent/*/etc/gentoo/nova-agent", + "*/tmp/*", + "*/Documentation/*", + "*/doc/*", ) IGNORE_SYMLINK = ( @@ -145,7 +143,7 @@ def provided_sonames(): def ignore_sonames(cpv): - for key in dep.match_to_list(cpv, IGNORE_MISSING.iterkeys()): + for key in dep.match_to_list(cpv, IGNORE_MISSING.keys()): for atom in IGNORE_MISSING[key]: yield atom @@ -231,10 +229,11 @@ def check_shebang(): continue if not is_exe(path): continue - with open(path, "r") as fd: + with open(path, "rb") as fd: line = fd.readline(80) if not line.startswith(b"#!"): continue + line = line.decode('utf-8') args = line[2:].rstrip().split(None, 2) cmd = args.pop(0) if cmd in ('/usr/bin/env', '/bin/env') and args: From f09a648222dbacaa58854da4ca8e140328425a50 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Wed, 3 Feb 2021 17:24:40 +0100 Subject: [PATCH 3/3] check_out_of_date: Add a TODO about porting it The script is written in python2 and it imports portage code. Since the portage is going to become a python3-only code, the script needs porting to python3. It is not the high priority right now, because it seems to be not used by other scripts or jenkins. --- check_out_of_date.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_out_of_date.py b/check_out_of_date.py index 0f32991cab..91785525ba 100755 --- a/check_out_of_date.py +++ b/check_out_of_date.py @@ -1,5 +1,5 @@ #!/usr/bin/python2 -# needs to be python2 for portage +# TODO: This script needs porting to python3, since portage is also in python3 now. # Prints out a list of all packages in portage-stable and how they stand relative to gentoo upstream