Remove package name argument when building from source, we don't need it

This commit is contained in:
MKLeb 2023-04-03 10:36:36 -04:00 committed by Gareth J. Greenaway
parent 4af7116317
commit bd378232d4
3 changed files with 4 additions and 24 deletions

View file

@ -22,12 +22,12 @@ override_dh_auto_build:
&& build/onedir/venv/bin/python3 -m pip install -r requirements/static/ci/py$${PY}/tools.txt
build/onedir/venv/bin/relenv fetch
build/onedir/venv/bin/relenv toolchain fetch
build/onedir/venv/bin/tools pkg build onedir-dependencies --arch $${SALT_PACKAGE_ARCH} --python-version $${SALT_PYTHON_VERSION} --package-name $${SALT_PACKAGE_NAME} --platform linux
build/onedir/venv/bin/tools pkg build onedir-dependencies --arch $${SALT_PACKAGE_ARCH} --python-version $${SALT_PYTHON_VERSION} --package-name build/onedir/salt --platform linux
# Fix any hardcoded paths to the relenv python binary on any of the scripts installed in the <onedir>/bin directory
find build/onedir/salt/bin/ -type f -exec sed -i 's:#!/\(.*\)salt/bin/python3:#!/bin/sh\n"exec" "$$(dirname $$(readlink -f $$0))/python3" "$$0" "$$@":g' {} \;
build/onedir/venv/bin/tools pkg build salt-onedir . --package-name $${SALT_PACKAGE_NAME} --platform linux
build/onedir/venv/bin/tools pkg build salt-onedir . --package-name build/onedir/salt --platform linux
build/onedir/venv/bin/tools pkg pre-archive-cleanup --pkg build/onedir/salt
else
override_dh_auto_build:

View file

@ -142,13 +142,13 @@ cd $RPM_BUILD_DIR
build/venv/bin/relenv fetch
build/venv/bin/relenv toolchain fetch
cd %{_salt_src}
$RPM_BUILD_DIR/build/venv/bin/tools pkg build onedir-dependencies --arch ${SALT_PACKAGE_ARCH} --python-version ${SALT_PYTHON_VERSION} --package-name $RPM_BUILD_DIR/${SALT_PACKAGE_NAME} --platform linux
$RPM_BUILD_DIR/build/venv/bin/tools pkg build onedir-dependencies --arch ${SALT_PACKAGE_ARCH} --python-version ${SALT_PYTHON_VERSION} --package-name $RPM_BUILD_DIR/build/salt --platform linux
# Fix any hardcoded paths to the relenv python binary on any of the scripts installed in
# the <onedir>/bin directory
find $RPM_BUILD_DIR/build/salt/bin/ -type f -exec sed -i 's:#!/\(.*\)salt/bin/python3:#!/bin/sh\n"exec" "$(dirname $(readlink -f $0))/python3" "$0" "$@":g' {} \;
$RPM_BUILD_DIR/build/venv/bin/tools pkg build salt-onedir . --package-name $RPM_BUILD_DIR/${SALT_PACKAGE_NAME} --platform linux
$RPM_BUILD_DIR/build/venv/bin/tools pkg build salt-onedir . --package-name $RPM_BUILD_DIR/build/salt --platform linux
$RPM_BUILD_DIR/build/venv/bin/tools pkg pre-archive-cleanup --pkg $RPM_BUILD_DIR/build/salt
%else
# The relenv onedir is being provided, all setup up until Salt is installed

View file

@ -48,9 +48,6 @@ def _get_shared_constants():
"arch": {
"help": "The arch to build for",
},
"package_name": {
"help": "The name of the relenv environment to create",
},
},
)
def debian(
@ -59,7 +56,6 @@ def debian(
relenv_version: str = None,
python_version: str = None,
arch: str = None,
package_name: str = None,
):
"""
Build the deb package.
@ -79,18 +75,12 @@ def debian(
"Building the package from the source files but the arch to build for has not been given"
)
ctx.exit(1)
if package_name is None:
package_name = "build/onedir/salt"
ctx.debug(
f"Building the package in {str(package_name)} since package_name has not been given"
)
ctx.info(f"Building the package from the source files")
shared_constants = _get_shared_constants()
new_env = {
"SALT_RELENV_VERSION": relenv_version or shared_constants["relenv_version"],
"SALT_PYTHON_VERSION": python_version
or shared_constants["python_version_linux"],
"SALT_PACKAGE_NAME": str(package_name),
"SALT_PACKAGE_ARCH": str(arch),
}
for key, value in new_env.items():
@ -118,9 +108,6 @@ def debian(
"arch": {
"help": "The arch to build for",
},
"package_name": {
"help": "The name of the relenv environment to create",
},
},
)
def rpm(
@ -129,7 +116,6 @@ def rpm(
relenv_version: str = None,
python_version: str = None,
arch: str = None,
package_name: str = None,
):
"""
Build the RPM package.
@ -149,18 +135,12 @@ def rpm(
"Building the package from the source files but the arch to build for has not been given"
)
ctx.exit(1)
if package_name is None:
package_name = "build/salt"
ctx.debug(
f"Building the package in {str(package_name)} since package_name has not been given"
)
ctx.info(f"Building the package from the source files")
shared_constants = _get_shared_constants()
new_env = {
"SALT_RELENV_VERSION": relenv_version or shared_constants["relenv_version"],
"SALT_PYTHON_VERSION": python_version
or shared_constants["python_version_linux"],
"SALT_PACKAGE_NAME": str(package_name),
"SALT_PACKAGE_ARCH": str(arch),
}
for key, value in new_env.items():