summaryrefslogtreecommitdiff
path: root/lib/dslkeywords/package.rb
AgeCommit message (Collapse)Author
2026-03-01bugfix/refactor: add error handling to DNFPackageManager shell commandsPaul Buetow
system() returns false/nil on failure but the original code ignored the return value, silently swallowing dnf errors. Add a private run_dnf! helper that checks the return value and raises DNFPackageManager::CommandFailed with the dnf exit code on failure. Replace the one-liner methods with full method bodies that delegate to run_dnf!. Also fix two latent constant-resolution bugs: - Use $? instead of $CHILD_STATUS (the latter requires `require 'English'` and is always nil without it) - Use ::File instead of File in Package#initialize to avoid resolving to RCM::File once file.rb is loaded Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-01fix: replace shell-interpolation with system() in DNFPackageManagerPaul Buetow
Backtick calls interpolated the package name directly into a shell command string, allowing metacharacters (;, $(), backticks) to execute arbitrary commands. Using system() with separate arguments bypasses the shell entirely, so the package name is passed as a literal argv element to dnf. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2025-02-18test for dup resourcePaul Buetow
2025-02-18only backup file when it changedPaul Buetow
2025-02-18add package initiallyPaul Buetow