Skip to content

Added rpm package as part of build#1149

Open
TejaswiniIBM wants to merge 19 commits intomainfrom
zopen_pax2rpm
Open

Added rpm package as part of build#1149
TejaswiniIBM wants to merge 19 commits intomainfrom
zopen_pax2rpm

Conversation

@TejaswiniIBM
Copy link
Copy Markdown
Collaborator

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Content Update

Category

  • zopen build framework
  • zopen package manager
  • Documentation
  • CI/CD
  • Tools

Description

Added support to generate and publish RPM

Related Issues

  • Related Issue #
  • Closes #

[optional] Are there any post-deployment tasks or follow-up actions required?

@TejaswiniIBM
Copy link
Copy Markdown
Collaborator Author

augment review

@augmentcode
Copy link
Copy Markdown

augmentcode bot commented Mar 17, 2026

🤖 Augment PR Summary

Summary: This PR adds RPM generation and publishing alongside the existing pax.Z artifact flow.

Changes:

  • Adds a new --generate-rpm (-gr) option to bin/zopen-build and wires it into the install step (with RPM generation triggered after the pax archive is produced).
  • Introduces bin/zopen-pax2rpm, a new helper that generates an RPM spec from a zopen-generated pax archive and can optionally validate/build via rpmbuild.
  • Updates CI build invocation (cicd/build.groovy) to run zopen build with -gr (and signing via -sp).
  • Adjusts the Jenkins pipeline (cicd/pipeline.jenkins) to use the Port-Build-Test job and to copy artifacts from that job.
  • Extends the publish script (cicd/publish.groovy) to detect RPM artifacts under rpmbuild/RPMS and upload them to the GitHub release when present.

Technical Notes: RPM building is performed through rpmbuild using a configurable buildroot, with optional spec validation via rpmlint when available.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 5 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

"-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.

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 6 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

bin/zopen-build Outdated
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 computed but never used; if this was meant to feed RPM Requires, it currently isn’t passed to zopen-pax2rpm, so generated RPMs may miss dependency metadata.

Severity: medium

Fix This in Augment

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


# PAX file should be a copied artifact
PAX=`find . -type f -path "*install/*zos.pax.Z"`
RPM=`find rpmbuild/RPMS -type f -name "*.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.

RPM is populated via find, which can return 0 or multiple matches; in the multi-match case, [ -f "$RPM" ], basename, and github-release --file "$RPM" will fail or pick an unintended path.

Severity: high

Other Locations
  • cicd/publish.groovy:37
  • cicd/publish.groovy:66
  • cicd/publish.groovy:210

Fix This in Augment

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

if [[ "$source_file" == *.pax.Z ]]; then
cat >> "$output_file" << 'EOF'
# Extract compressed pax archive
pax -rzf %{SOURCE0}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The generated spec runs pax -r... %{SOURCE0} after cd into %{_builddir}/%{name}-%{version}; %{SOURCE0} is typically located in %{_sourcedir}, so extraction may fail at build time.

Severity: high

Other Locations
  • bin/zopen-pax2rpm:338

Fix This in Augment

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


if [ -n "$FOUND_PATH" ]; then
FOUND_PATH=${FOUND_PATH#./}
if [[ "$FOUND_PATH" == */pyz ]]; 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.

This heredoc emits [[ ... ]] into the spec’s %install script; RPM executes %install under /bin/sh, so non-POSIX [[ can break builds on systems where sh isn’t bash.

Severity: medium

Fix This in Augment

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


# Run rpmlint
local rpmlint_output
rpmlint_output=$(rpmlint "$spec_file" 2>&1)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

With set -e, a non-zero rpmlint exit in rpmlint_output=$(rpmlint ...) will abort the script before the error/warning parsing runs, making --validate unexpectedly terminate.

Severity: medium

Fix This in Augment

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

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.

@TejaswiniIBM
Copy link
Copy Markdown
Collaborator Author

augment review

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.


mkdir -p "$buildroot"/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}

if [ ! -f "$HOME/.rpmmacros" ]; 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.

If the user already has ~/.rpmmacros, rpmbuild may still use an existing %_topdir and ignore the script’s chosen --buildroot, which can make later steps (like finding artifacts under $buildroot/RPMS) inconsistent or fail unexpectedly. Consider ensuring the requested build root is honored even when ~/.rpmmacros already exists (or at least warning the user).

Severity: medium

Fix This in Augment

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

PAX=`find . -type f -path "*install/*zos.pax.Z"`
METADATA=`find . -type f -path "*install/metadata.json"`
PAX=`find . -type f -path "*install/*zos.pax.Z" | head -n 1`
RPM=`find rpmbuild/RPMS -type f -name "*.rpm" | head -n 1`
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

find ... | head -n 1 will silently pick an arbitrary RPM if more than one is present (e.g., multiple output RPMs/arches), which can cause CI to upload the wrong asset without failing. Consider asserting there’s exactly one match or selecting deterministically.

Severity: medium

Fix This in Augment

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

@TejaswiniIBM
Copy link
Copy Markdown
Collaborator Author

augment review

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

# This will check syntax without actually building
# Use --nodeps to check syntax/prep logic without requiring local RPM DB to have all deps
local temp_output=$(mktemp)
if rpmbuild --define "_topdir $buildroot" -bp --nodeps "$spec_file" &> "$temp_output"; 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.

validate_spec_syntax calls rpmbuild --define "_topdir $buildroot" ..., but $buildroot isn’t set in this function (the script otherwise uses BUILDROOT/function parameters). This makes --validate potentially run against the wrong topdir (or an empty one) and fail unexpectedly.

Severity: medium

Other Locations
  • bin/zopen-pax2rpm:657

Fix This in Augment

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

local date=$(date "+%a %b %d %Y")

# Analyze the pax contents first (populate global DIR_STRUCTURE)
analyze_pax_contents "$source_file"
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_spec calls analyze_pax_contents unguarded, but analyze_pax_contents can return 1 on an empty/failed listing; with set -e this will abort the whole script. That seems to contradict the “using default structure” warning path and can prevent spec generation in edge cases.

Severity: medium

Fix This in Augment

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

@TejaswiniIBM
Copy link
Copy Markdown
Collaborator Author

augment review

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 5 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

bin/zopen-build Outdated
if [ -f "${paxFileName}" ]; then
printHeader "Generating RPM from ${ZOPEN_INSTALL_DIR}"
rpm_deps=$(echo "${ZOPEN_RUNTIME_DEPS}" | xargs -n1 | sort -u | xargs)
PATH="${ZOPEN_ROOTFS}/usr/local/bin:${PATH}" "${MYDIR}/zopen-pax2rpm" "${paxFileName}" --summary "${ZOPEN_NAME} package" --requires "${rpm_deps}" --build
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

zopen-pax2rpm defaults --buildroot to ${HOME}/rpmbuild, but cicd/publish.groovy later searches for RPMs under ./rpmbuild/RPMS, so the publish step may not find the built RPM depending on HOME. Consider aligning the output location between build and publish (e.g., by explicitly setting the buildroot used here).

Severity: high

Fix This in Augment

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

mkdir -p "$buildroot"/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}

if [ ! -f "$HOME/.rpmmacros" ]; then
cat > "$HOME/.rpmmacros" << EOF
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

setup_rpmbuild writes ~/.rpmmacros, which can fail in CI where $HOME is read-only and can also have surprising side effects for users. Since the script already passes --define "_topdir ...", consider making the ~/.rpmmacros write best-effort (or avoiding it) so builds don't fail unnecessarily.

Severity: medium

Fix This in Augment

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

# Function to analyze pax contents and categorize files
analyze_pax_contents() {
local pax_file="$1"
local temp_dir=$(mktemp -d)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

analyze_pax_contents creates temp_dir via mktemp -d but never uses it, and with set -e a missing/failed mktemp would abort the entire run. Consider removing this dependency or guarding it so content analysis can't hard-fail for an unused temp directory.

Severity: low

Fix This in Augment

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

exit 1
fi

RPM=`find rpmbuild/RPMS -type f -name "*.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.

Publish now hard-fails unless exactly one RPM exists under rpmbuild/RPMS; this will break publish runs for ports/builds that still only produce a pax artifact (or produce multiple RPM subpackages). Consider confirming the Port-Build job always generates exactly one RPM before enforcing this check.

Severity: medium

Fix This in Augment

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

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 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.

@TejaswiniIBM
Copy link
Copy Markdown
Collaborator Author

augment review

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 4 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

# Parse command line options
while [ $# -gt 0 ]; do
case "$1" in
--name)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Option parsing assumes every flag has a value (e.g., --name), and with set -e a missing $2 will cause a confusing shift error instead of a clear message. This can make CLI failures hard to diagnose for users/CI.

Severity: low

Fix This in Augment

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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done


# Check for rpmbuild if building or validating
if [ "$BUILD_RPM" = true ] || [ "$VALIDATE_SPEC" = true ]; then
echo "DEBUG: Current PATH is $PATH" >&2
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

check_required_tools always prints DEBUG: Current PATH... whenever --build or --validate is set, even when --verbose isn’t enabled. This can clutter normal output and makes “debug” logging hard to interpret.

Severity: low

Fix This in Augment

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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done

@TejaswiniIBM
Copy link
Copy Markdown
Collaborator Author

augment review

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

echo "# Pax file contents (first 100 entries):" >&2

if [[ "$pax_file" == *.pax.Z ]]; then
pax -rvzf "$pax_file" 2>&1 | head -100
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-pax2rpm:213: list_pax_contents uses pax -r..., which extracts files into the current working directory (and piping to head can interrupt extraction), even though the function says it’s listing contents. Consider switching this helper to pax’s list mode so it can’t mutate the caller’s workspace.

Severity: high

Fix This in Augment

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

bin/zopen-build Outdated
if [ -f "${paxFileName}" ]; then
printHeader "Generating RPM from ${ZOPEN_INSTALL_DIR}"
rpm_deps=$(echo "${ZOPEN_RUNTIME_DEPS}" | xargs -n1 | sort -u | xargs)
if ! runAndLog "PATH=\"${ZOPEN_ROOTFS}/usr/local/bin:${PATH}\" \"${MYDIR}/zopen-pax2rpm\" \"${paxFileName}\" --summary \"${ZOPEN_NAME} package\" --requires \"${rpm_deps}\" --build --buildroot \"${ZOPEN_ROOT}/rpmbuild\""; 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:2229: This always passes --requires "${rpm_deps}"; if ZOPEN_RUNTIME_DEPS is empty/unset in some build contexts, that expands to an empty value and zopen-pax2rpm will fail option parsing (--requires demands a non-empty argument). Consider only including --requires when there’s at least one dependency to emit.

Severity: low

Fix This in Augment

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

@TejaswiniIBM
Copy link
Copy Markdown
Collaborator Author

augment review

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

--url "https://www.ibm.com"

EOF
exit 1
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

usage() always exits with status 1, so --help will look like a failure in CI/scripts even when it’s just printing help output. Consider exiting 0 for the help path.

Severity: low

Fix This in Augment

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

fi

# Check for uncompress if dealing with .Z files
if [[ "$pax_file" == *.pax.Z ]] && ! command -v uncompress &> /dev/null; 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.

check_required_tools() hard-requires uncompress for *.pax.Z, but this script never invokes uncompress directly and relies on pax -z for (de)compression. This can cause a false “missing tool” failure on systems where pax handles the archive without uncompress (or uses gzip instead).

Severity: medium

Fix This in Augment

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

RELEASE="1"
LICENSE="Proprietary"
BUILD_ARCH=$(uname -m 2>/dev/null || echo "s390x")
PACKAGER_NAME="${USER}"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

PACKAGER_NAME/PACKAGER_EMAIL are derived from $USER, which is often unset in non-interactive CI environments. If these end up empty, the generated spec’s %changelog header line may be malformed and could trigger rpmbuild/rpmlint warnings or failures.

Severity: low

Fix This in Augment

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

@TejaswiniIBM
Copy link
Copy Markdown
Collaborator Author

augment review

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

ME=$(basename "$0")
MYDIR="$( cd "$(dirname "$0")" >/dev/null 2>&1 && pwd -P )"
INCDIR="${MYDIR}/../include"
if ! [ -d "${INCDIR}" ] && ! [ -f "${INCDIR}/common.sh" ]; 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-pax2rpm:30: The setupMyself guard only errors when both the include dir is missing and common.sh is missing (&&), so if the directory exists but common.sh is absent/mispackaged the script will fall through and fail later at the . with a less clear error.

Severity: low

Fix This in Augment

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

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.

@TejaswiniIBM
Copy link
Copy Markdown
Collaborator Author

augment review

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

fi
echo "Detected nested root: $ROOT_DIR"
mkdir -p %{buildroot}%{install_dir}
cp -RP "$ROOT_DIR"/* %{buildroot}%{install_dir}/
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-pax2rpm:279 The generated %install snippet copies with "$ROOT_DIR"/* (and later "$SUB_DIR"/* / *), which will skip dotfiles like .env/.depsenv and can also fail when a directory contains only dotfiles (glob expands to a literal *). This risks producing RPMs missing critical runtime files or causing build-time copy failures.

Other locations where this applies: bin/zopen-pax2rpm:285, bin/zopen-pax2rpm:290

Severity: high

Fix This in Augment

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

generate_files_list() {
cat << 'EOF'
%defattr(-,root,root,-)
%{install_dir}
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-pax2rpm:308 The generated %files list only contains %{install_dir}, which typically won’t include the directory contents; rpmbuild commonly errors with “Installed (but unpackaged) file(s) found” (or produces an RPM with an empty payload). Consider ensuring the %files section captures the installed tree under %{buildroot}%{install_dir}.

Severity: high

Fix This in Augment

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

# Default values
RELEASE="1"
LICENSE="Proprietary"
BUILD_ARCH=$(uname -m 2>/dev/null || echo "s390x")
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-pax2rpm:41 BUILD_ARCH is taken directly from uname -m, but some environments return values that RPM may not recognize as valid arches (which can make BuildArch: invalid or mislabel the artifact). Consider normalizing/mapping the output to RPM architecture names expected by your target build environment.

Severity: medium

Fix This in Augment

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

@TejaswiniIBM
Copy link
Copy Markdown
Collaborator Author

augment review

Signed-off-by: TejaswiniIBM <tejaswini.r1@ibm.com>
Signed-off-by: TejaswiniIBM <tejaswini.r1@ibm.com>
Signed-off-by: TejaswiniIBM <tejaswini.r1@ibm.com>
Signed-off-by: TejaswiniIBM <tejaswini.r1@ibm.com>
Signed-off-by: TejaswiniIBM <tejaswini.r1@ibm.com>
Signed-off-by: TejaswiniIBM <tejaswini.r1@ibm.com>
Signed-off-by: TejaswiniIBM <tejaswini.r1@ibm.com>
Signed-off-by: TejaswiniIBM <tejaswini.r1@ibm.com>
Signed-off-by: TejaswiniIBM <tejaswini.r1@ibm.com>
Signed-off-by: TejaswiniIBM <tejaswini.r1@ibm.com>
Signed-off-by: TejaswiniIBM <tejaswini.r1@ibm.com>
Signed-off-by: TejaswiniIBM <tejaswini.r1@ibm.com>
Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

is_os_layout=false

# Analyze each file
echo "$pax_listing" | while IFS= read -r line; do
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

analyze_pax_contents sets has_* flags inside a while loop that’s fed by a pipeline (echo ... | while ...), which runs in a subshell under POSIX sh; those assignments won’t persist, so the later "Detected structure" output will likely always be empty/misleading.

Severity: low

Fix This in Augment

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

Signed-off-by: TejaswiniIBM <tejaswini.r1@ibm.com>
@TejaswiniIBM
Copy link
Copy Markdown
Collaborator Author

augment review

Signed-off-by: TejaswiniIBM <tejaswini.r1@ibm.com>
Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

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.

fi
else
# Check if _topdir is already defined and different
existing_topdir=$(grep "%_topdir" "$HOME/.rpmmacros" | awk '{print $2}')
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

In setup_rpmbuild, if ~/.rpmmacros exists but doesn’t define %_topdir, existing_topdir becomes empty and the script still emits a warning claiming _topdir is set to '', which is misleading and can confuse debugging.

Severity: low

Fix This in Augment

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

Signed-off-by: TejaswiniIBM <tejaswini.r1@ibm.com>
Signed-off-by: TejaswiniIBM <tejaswini.r1@ibm.com>
Signed-off-by: TejaswiniIBM <tejaswini.r1@ibm.com>
@TejaswiniIBM
Copy link
Copy Markdown
Collaborator Author

augment review

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

Signed-off-by: TejaswiniIBM <tejaswini.r1@ibm.com>
Signed-off-by: TejaswiniIBM <tejaswini.r1@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants