Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
25 changes: 25 additions & 0 deletions bin/zopen-build
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ Option:
with the .rej extension.
-g, --get-source get the source and apply patch without building.
-gp, --generate-pax generate a pax.Z file based on the install contents.
-gr, --generate-rpm generate an RPM package from the pax archive.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR also adds a top-level zopen-build file that appears as a binary/empty file in the checkout; if it’s intended as an entrypoint wrapper, it may be an accidentally committed artifact or missing content.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR also changes the binary zopen-diagnostics file (shown as a binary diff); please confirm this binary update is intentional and reproducible from source, not an accidentally committed artifact.

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

-h, --help, -? print this information.
--no-set-active do not change the pinned version.
--no-install-deps do not install project's runtime dependencies.
Expand Down Expand Up @@ -379,6 +380,7 @@ processOptions()
buildEnvFile="./buildenv"
getSourceOnly=false
generatePax=false
generateRPM=false
setActive=true
signPax=false
forcePatchApply=false
Expand Down Expand Up @@ -476,11 +478,16 @@ processOptions()
"-gp" | "--generate-pax")
generatePax=true
;;
"-gr" | "--generate-rpm")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--generate-rpm currently only flips generateRPM=true, but the RPM creation logic is nested under the pax-generation flow, so using --generate-rpm by itself appears to do nothing (and won’t hit the “ensure --generate-pax” error). Consider either enforcing the pairing or making the behavior explicit to users.

Severity: medium

Other Locations
  • bin/zopen-build:2222

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

generateRPM=true
generatePax=true
;;
"-s" | "--shell")
startShell=true
;;
"-sp" | "--sign-pax")
signPax=true
generatePax=true
;;
*)
printError "Unknown option ${1} specified"
Expand Down Expand Up @@ -2310,7 +2317,25 @@ install()
if ! runAndLog "${ZOPEN_PAX_CMD}"; then
printError "Could not generate pax \"${paxFileName}\""
fi
fi

if ${generateRPM}; then
if [ -f "${paxFileName}" ]; then
printHeader "Generating RPM from ${ZOPEN_INSTALL_DIR}"
rpm_deps=$(echo "${ZOPEN_RUNTIME_DEPS}" | xargs -n1 | sort -u | xargs)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rpm_deps is normalized via xargs -n1 | sort -u, which splits dependency expressions on whitespace; this will break versioned deps like oef >= 1.1.0 into separate tokens and can produce an invalid --requires/Requires: value in the generated spec.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

cmd="PATH=\"${ZOPEN_ROOTFS}/usr/local/bin:${PATH}\" \"${MYDIR}/zopen-pax2rpm\" \"${paxFileName}\" --summary \"${ZOPEN_NAME} package\" --build --buildroot \"${ZOPEN_ROOT}/rpmbuild\""
if [ -n "${rpm_deps}" ]; then
cmd="${cmd} --requires \"${rpm_deps}\""
fi
if ! runAndLog "${cmd}"; then
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bin/zopen-build:2233: runAndLog executes via eval, so building cmd from variables like paxFileName/ZOPEN_NAME means any unexpected shell metacharacters or quotes in those values can break the command line or be interpreted as additional shell syntax.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

printError "Could not generate RPM from \"${paxFileName}\""
fi
else
printError "Pax file ${paxFileName} not found. Ensure --generate-pax is also used."
fi
fi

if ${generatePax}; then
#TODO: Hack so that we can use coreutils md5sum without impacting builds
ZOPEN_DEPS="${ZOPEN_DEPS} coreutils jq"
if [ "${signPax}" = "true" ] && ( [ -z "${ZOPEN_GPG_SECRET_KEY_FILE}" ] || [ -z "${ZOPEN_GPG_SECRET_KEY_PASSPHRASE_FILE}" ] || [ -z "${ZOPEN_GPG_PUBLIC_KEY_FILE}" ] || [ ! -r "${ZOPEN_GPG_SECRET_KEY_FILE}" ] || [ ! -r "${ZOPEN_GPG_SECRET_KEY_PASSPHRASE_FILE}" ] || [ ! -r "${ZOPEN_GPG_PUBLIC_KEY_FILE}" ] ); then
Expand Down
Loading
Loading