[Pkg-puppet-devel] [facter] 127/352: Use Dir.glob(), don't require rubygems or rake, use Dir.chdir as a block
Stig Sandbeck Mathisen
ssm at debian.org
Sun Apr 6 22:21:38 UTC 2014
This is an automated email from the git hooks/post-receive script.
ssm pushed a commit to branch master
in repository facter.
commit 9773b994d93ac28423cc009677142cd8fc2a4ba2
Author: Clay Caviness <clay at boobah.com>
Date: Tue Aug 13 15:41:48 2013 -0400
Use Dir.glob(), don't require rubygems or rake, use Dir.chdir as a block
---
ext/osx/preflight.erb | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/ext/osx/preflight.erb b/ext/osx/preflight.erb
index 6e185f8..ab7d9af 100755
--- a/ext/osx/preflight.erb
+++ b/ext/osx/preflight.erb
@@ -8,31 +8,26 @@
# ${3} is the destination volume so that this works correctly
# when being installed to volumes other than the current OS.
-<%- begin -%>
- <%- require 'rubygems' -%>
-<%- rescue LoadError -%>
-<%- end -%>
-<%- require 'rake' -%>
-
<%- ["@apple_libdir", "@apple_sbindir", "@apple_bindir", "@apple_docdir", "@package_name"].each do |i| -%>
<%- val = eval(i) -%>
<%- raise "Critical variable #{i} is unset!" if val.nil? or val.empty? -%>
<%- end -%>
# remove ruby library files
-<%- Dir.chdir("lib") -%>
-<%- [@apple_old_libdir, @apple_libdir].select {|i| i}.each do |libdir| -%>
- <%- FileList["*"].each do |file| -%>
+<%- Dir.chdir("lib") do -%>
+ <%- [@apple_old_libdir, @apple_libdir].compact.each do |libdir| -%>
+ <%- Dir.glob("*").each do |file| -%>
/bin/rm -Rf "${3}<%= libdir %>/<%= file %>"
+ <%- end -%>
<%- end -%>
<%- end -%>
# remove bin files
-<%- Dir.chdir("../bin") -%>
-<%- FileList["*"].each do |file| -%>
+<%- Dir.chdir("bin") do -%>
+ <%- Dir.glob("*").each do |file| -%>
/bin/rm -Rf "${3}<%= @apple_bindir %>/<%= file %>"
+ <%- end -%>
<%- end -%>
-<%- Dir.chdir("..") -%>
# remove old doc files
/bin/rm -Rf "${3}<%= @apple_docdir %>/<%= @package_name %>"
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-puppet/facter.git
More information about the Pkg-puppet-devel
mailing list