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

(PA-5947) Added condition for Amazon Linux in project.spec.erb #828

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/vanagon/platform.rb
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,13 @@ def is_fedora?
return [email protected](/^fedora-.*$/)
end

# Utility matcher to determine is the platform is a amazon linux variety
#
# @return [true, false] true if it is a amazon linux variety, false otherwise
def is_amazon?
return [email protected](/^amazon-.*$/)
end

# Utility matcher to determine is the platform is a debian variety
#
# @return [true, false] true if it is a debian variety, false otherwise
Expand Down
2 changes: 1 addition & 1 deletion resources/rpm/project.spec.erb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Requires: <%= requires.requirement %><%= requires.version ? " #{requires.versio
# did not specify a dependency on these.
# In the future, we will supress pre/post scripts completely if there's nothing
# specified by the project or the components.
<%- if @platform.is_fedora? || (@platform.is_el? && @platform.os_version.to_i >= 9) -%>
<%- if @platform.is_fedora? || @platform.is_amazon? || (@platform.is_el? && @platform.os_version.to_i >= 9) -%>
Requires(pre): /usr/bin/mkdir
Requires(pre): /usr/bin/touch
Requires(post): /usr/bin/mkdir
Expand Down