Skip to content

Commit

Permalink
Merge pull request #537 from jrafanie/clean_hotfix_directory
Browse files Browse the repository at this point in the history
Clean hotfix directory before patching the srpm contents
  • Loading branch information
Fryguy authored Jan 3, 2025
2 parents 43e6a84 + 8894d25 commit 4adf2af
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/manageiq/rpm_build/build_hotfix.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def generate_rpm
where_am_i

Dir.chdir(HOTFIX_DIR) do
clean_hotfix_directory
unpack_srpm
update_spec
copy_patches
Expand Down Expand Up @@ -64,6 +65,11 @@ def update_spec
File.write(rpm_spec, spec_text)
end

def clean_hotfix_directory
files = Dir.glob("*[!.src.rpm]")
FileUtils.rm_f(files, :verbose => true)
end

def unpack_srpm
srpm = Dir.glob("*.src.rpm").first
shell_cmd("rpm2cpio #{srpm} | cpio -idmv")
Expand Down

0 comments on commit 4adf2af

Please sign in to comment.