Skip to content

Commit

Permalink
- Escape '*' and '[' in the rpm files list to keep rpm from trying to
Browse files Browse the repository at this point in the history
  use it as a glob. Fixes jordansissel#202
  • Loading branch information
jordansissel committed Apr 10, 2012
1 parent 476f6d1 commit 58f047d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions templates/rpm.erb
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,14 @@ fi
# with "/", then make sure paths with spaces are quoted. I hate rpm so much.

# 'files' here is the method FPM::Package#files.
# The 'files' section of rpm can be
# Replace [ with [\[] to make rpm not use globs
# Replace * with [*] to make rpm not use globs
files.collect { |f| "/#{f}" } \
.reject { |f| config_files.include?(f) } \
.collect { |f| f[/\s/] and "\"#{f}\"" or f } \
.collect { |f| f.gsub("[", "[\\[]") } \
.collect { |f| f.gsub("*", "[*]") } \
.join("\n")
%>

Expand Down

0 comments on commit 58f047d

Please sign in to comment.