Skip to content

fix: resolve DNF5 module stream naming and invalid recovery instructions#21

Merged
Thavarshan merged 1 commit into
mainfrom
fix/dnf5-module-stream-issue-20
Jun 27, 2026
Merged

fix: resolve DNF5 module stream naming and invalid recovery instructions#21
Thavarshan merged 1 commit into
mainfrom
fix/dnf5-module-stream-issue-20

Conversation

@Thavarshan

Copy link
Copy Markdown
Owner

Summary

Fixes all defects reported in #20 (phpvm install fails on Fedora 44 / DNF5).

  • Resolve real stream name: new dnf_resolve_php_stream helper parses dnf module list php to find the actual stream for a requested version — handles both Remi (remi-8.2) and RHEL AppStream (8.2) naming instead of hardcoding the non-existent php:8.2 stream
  • Skip destructive reset: new dnf_stream_enabled helper lets install and use skip dnf module reset when the correct stream is already active, preventing the reset-then-fail loop
  • Correct DNF5 recovery instructions: suggest_repository_setup now uses dnf config-manager setopt <repo>.enabled=1 on DNF5 (Fedora 41+) and replaces the non-existent remi-php82 repo reference with the correct dnf module enable php:remi-X.Y -y instruction
  • Fix false "not found": pkg_search_php uses stream resolution so un-enabled remi-X.Y streams are detected as available

Test plan

  • bash -n phpvm.sh — syntax clean
  • bats tests/ — 91/91 pass (8 new tests in tests/05_dnf.bats using PATH stubs for Remi/DNF5, enabled-stream, and AppStream/DNF4 fixtures)
  • CI runs Ubuntu + macOS; DNF logic is validated via BATS stubs since CI lacks a Fedora runner

Closes #20

🤖 Generated with Claude Code

…ons (closes #20)

- Add dnf_resolve_php_stream() to detect real stream name from dnf module
  list php (handles both Remi remi-X.Y and RHEL AppStream X.Y naming)
- Add dnf_stream_enabled() to skip destructive reset/enable when the
  correct stream is already active
- Add dnf_major_version() to emit correct config-manager syntax for DNF4
  vs DNF5 (--set-enabled removed in DNF5/Fedora 41+)
- Fix install_php_dnf() and use_php_version() to use resolved stream name
  instead of hardcoded php:X.Y (which does not exist on Remi/Fedora)
- Fix pkg_search_php() to detect un-enabled remi-X.Y streams as available
- Fix suggest_repository_setup() Fedora instructions: replace non-existent
  remi-php82 repo with dnf module enable php:remi-X.Y, use version-aware
  config-manager syntax
- Add tests/05_dnf.bats with 8 unit tests using PATH-based dnf stubs for
  Remi (DNF5), enabled-stream, and AppStream (DNF4) fixtures
- Bump version to 1.12.2

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Thavarshan Thavarshan merged commit cd81d63 into main Jun 27, 2026
7 of 9 checks passed
@Thavarshan Thavarshan deleted the fix/dnf5-module-stream-issue-20 branch June 27, 2026 12:15
@Thavarshan Thavarshan self-assigned this Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants