Skip to content

Commit ffeb12c

Browse files
authored
Merge pull request #5575 from jmarrero/upgrade-r2
deploy: Print status message on container early-return path
2 parents 333974b + a194bf5 commit ffeb12c

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

src/daemon/rpmostreed-transaction-types.cxx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1603,7 +1603,13 @@ deploy_transaction_execute (RpmostreedTransaction *transaction, GCancellable *ca
16031603
* need to continue to deploy. */
16041604
const bool have_refspec_or_revision = self->refspec || self->revision;
16051605
if (skip_base_check && !changed && !have_refspec_or_revision)
1606-
return TRUE;
1606+
{
1607+
if (is_upgrade)
1608+
rpmostree_output_message ("No upgrade available.");
1609+
else
1610+
rpmostree_output_message ("No change.");
1611+
return TRUE;
1612+
}
16071613

16081614
if (dry_run)
16091615
/* Note early return here; we printed the transaction already */

tests/kolainst/destructive/idempotent-layering

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,14 @@ case "${AUTOPKGTEST_REBOOT_MARK:-}" in
265265
assert_streq "${rc}" "77"
266266
echo "ok upgrade --unchanged-exit-77 reports no change when already up to date"
267267

268+
# Test 9: Verify upgrade prints "No upgrade available." when already up to date
269+
# Regression test for https://github.com/coreos/rpm-ostree/issues/5574
270+
# Before this fix, container-based systems would exit silently with code 0
271+
# without printing any message when no upgrade was available.
272+
rpm-ostree upgrade 2>&1 | tee upgrade-output.txt
273+
assert_file_has_content upgrade-output.txt "No upgrade available."
274+
echo "ok upgrade prints 'No upgrade available.' on container-based system"
275+
268276
;;
269277
*) echo "unexpected mark: ${AUTOPKGTEST_REBOOT_MARK}"; exit 1;;
270278
esac

0 commit comments

Comments
 (0)