Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean hotfix directory before patching the srpm contents #537

Merged
merged 1 commit into from
Jan 3, 2025

Conversation

jrafanie
Copy link
Member

@jrafanie jrafanie commented Jan 2, 2025

For those of us who don't patch the srpm contents correctly the first or
even second time, we should do something like make clean before we extract
the srpm, patch things, and attempt to rpmbuild.

@@ -64,6 +65,11 @@ def update_spec
File.write(rpm_spec, spec_text)
end

def clean_hotfix_directory
files = Dir.glob("*").reject {|path| path.end_with?("src.rpm") }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor

Suggested change
files = Dir.glob("*").reject {|path| path.end_with?("src.rpm") }
files = Dir.glob("*").reject { |path| path.end_with?("src.rpm") }

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're not using the glob part of Dir.glob would Dir.children(".") work?

Copy link
Member

@Fryguy Fryguy Jan 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even better:

Suggested change
files = Dir.glob("*").reject {|path| path.end_with?("src.rpm") }
files = Dir.glob("*[!.src.rpm]")

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha, I had glob negation at first but thought this looked more obvious considering performance isn't going to matter on a handful of file. I can change it if you also liked it 😉

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally think it reads better :D

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha, ship it... just verifying it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, testing looks fine

For those of us who don't patch the srpm contents correctly the first or
even second time, we should do something like make clean before we extract
the srpm, patch things, and attempt to rpmbuild.
@jrafanie jrafanie force-pushed the clean_hotfix_directory branch from 80eb3c1 to 8894d25 Compare January 3, 2025 15:03
@Fryguy Fryguy merged commit 4adf2af into ManageIQ:master Jan 3, 2025
4 checks passed
@Fryguy Fryguy assigned Fryguy and unassigned agrare Jan 3, 2025
@Fryguy Fryguy added the bug Something isn't working label Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants