This repository was archived by the owner on May 22, 2026. It is now read-only.
Fix offline rpm/dpkg install status when piping to tee.#805
Open
sercanokur wants to merge 2 commits into
Open
Conversation
Without pipefail, the exit status of a pipeline was that of tee, so a failed rpm or dpkg run could still be treated as success. Run each pipeline in a subshell with set -o pipefail so failures propagate. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request description — #804 (
install.shpipefail + tee)Suggested PR title:
install.sh: use pipefail for offline rpm/dpkg pipelines with teeBase branch:
develop· Compare branch:sercanokur-804-pipefail-rpm-dpkg-tee🗣 Description
During offline installs,
install.shpipesrpmanddpkgoutput throughtee(for examplesudo rpm … | tee /tmp/rpm_install.logandsudo dpkg … | tee /tmp/dpkg_install.log). In Bash, unlesspipefailis enabled, the pipeline’s exit status is that oftee, which almost always exits0. That meansrpmordpkgcan fail while the enclosingifstill takes the success path, skipping failure handling (exit 1, dependency diagnostics, etc.).Both pipelines are wrapped in a subshell with
set -o pipefailso only those commands are affected:( set -o pipefail; sudo rpm … | tee … )( set -o pipefail; sudo dpkg … | tee … )💭 Motivation and context
| teeis useful, but withoutpipefailthe pipeline can report success even whenrpm/dpkgfailed.set -o pipefailpattern at those two locations ininstall.sh.Closes #804(If merging to
developdoes not auto-close issues, link issue #804 in the PR sidebar Development section, per the repo PR template.)🧪 Testing
Local
bash -n install.sh— syntax OK.Docker
ubuntu:22.04, repo mounted read-only:bash -noninstall.sh; reproduceddpkgfailure on a missing.deb. Withoutpipefail,dpkg … | teebehaved as success; with( set -o pipefail; … ), the pipeline failed correctly.rockylinux:9: same comparison for failingrpmwith a missing RPM file —pipefailcorrectly surfaced the failure.How someone else can verify
install.shnow stops in the intended error path.✅ Pre-approval checklist
✅ Pre-merge Checklist
✅ Post-merge Checklist