Skip to content
Browse files

Escape percents in filenames in %install section

  • Loading branch information...
1 parent e0472f3 commit c7bb5052e518dec34122a9bd522bc426112e6ff0 @jwittkoski jwittkoski committed Sep 25, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 templates/rpm.erb
View
4 templates/rpm.erb
@@ -69,9 +69,9 @@ Obsoletes: <%= repl %>
%install
<% files.each do |path| -%>
-<% source = Shellwords.shellescape(File.join(staging_path, path)) -%>
+<% source = Shellwords.shellescape(File.join(staging_path, path)).gsub("%", "%%") -%>
<% # Copy to the build_path/BUILD/ to make rpmbuild happy -%>
-<% target = Shellwords.shellescape(File.join(build_path, build_sub_dir, path)) -%>
+<% target = Shellwords.shellescape(File.join(build_path, build_sub_dir, path)).gsub("%", "%%") -%>
<% dir = File.dirname(target) %>
mkdir -p <%= dir %>
if [ -f <%= source %> ] || [ -h <%= source %> ] ; then

0 comments on commit c7bb505

Please sign in to comment.
Something went wrong with that request. Please try again.