Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BIGTOP-4063: Adapt bigtop-select to Python 3 #1236

Merged
merged 4 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
224 changes: 0 additions & 224 deletions bigtop-packages/src/common/bigtop-select/conf-select

This file was deleted.

17 changes: 7 additions & 10 deletions bigtop-packages/src/common/bigtop-select/distro-select
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python3
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
Expand Down Expand Up @@ -154,7 +154,7 @@ def listPackages( packages ):
if packages == None:
packages = leaves

packages.sort()
packages = sorted(packages)
for pkg in packages:
linkname = current + "/" + pkg
if os.path.isdir(linkname):
Expand All @@ -165,13 +165,11 @@ def listPackages( packages ):

# Print the avaialable package names
def printPackages():
packages = leaves.keys()
packages.sort()
packages = sorted(leaves.keys())
print("Packages:")
for pkg in packages:
print(" " + pkg)
groups = aliases.keys()
groups.sort()
groups = sorted(aliases.keys())
print("Aliases:")
for pkg in groups:
print(" " + pkg)
Expand All @@ -196,8 +194,7 @@ def printVersions():
print("ERROR: Unexpected file/directory found in %s: %s" % (root, f))
sys.exit(1)

keys = result.keys()
keys.sort()
keys = sorted(result.keys())
for k in keys:
print(result[k])

Expand All @@ -218,9 +215,9 @@ def setPackages(packages, version, rpm_mode):
sys.exit(1)

if not os.path.isdir(current):
os.mkdir(current, 0755)
os.mkdir(current, 0o755)

packages.sort()
packages = sorted(packages)
for pkg in packages:
linkname = current + "/" + pkg
if os.path.islink(linkname) and rpm_mode:
Expand Down
2 changes: 0 additions & 2 deletions bigtop-packages/src/common/bigtop-select/install_select.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,11 @@ CONF_DIR=${CONF_DIR:-/etc/bigtop-select/conf.dist}

STACK_ROOT_DIR=$(echo ${PARENT_DIR} | sed -e "s/\/${BIGTOP_BASE_VERSION}$//")
STACK_SELECTOR=distro-select
CONF_SELECTOR=conf-select

# Install packages
install -d -p -m 755 $PREFIX${LIB_DIR}/
install -d -p -m 755 $PREFIX${PARENT_DIR}/
install -p -m 755 ${DISTRO_DIR}/${STACK_SELECTOR} $PREFIX${LIB_DIR}/
install -p -m 755 ${DISTRO_DIR}/${CONF_SELECTOR} $PREFIX${LIB_DIR}/
cat > $PREFIX${LIB_DIR}/params.py <<EOF
#!/usr/bin/env python2
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,15 @@ BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildArch: noarch
Source0: install_select.sh
Source1: LICENSE
Source2: conf-select
Source3: distro-select
Source2: distro-select
Requires: bash

# "which" command is needed for a lot of projects.
# It is part of the package "util-linux" on suse and "which" everywhere else
%if %{?suse_version:1}0
Requires: util-linux
%else
Requires: which
Requires: which, python3
%endif

%description
Expand All @@ -53,7 +52,6 @@ This includes a collection of useful tools and files for Bigtop and Ambari
install -p -m 755 %{SOURCE0} .
install -p -m 755 %{SOURCE1} .
install -p -m 755 %{SOURCE2} .
install -p -m 755 %{SOURCE3} .


%build
Expand Down