aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2009-06-06 18:26:47 +0100
committerAvatar David Leverton <levertond@googlemail.com> 2009-06-06 18:26:47 +0100
commit80fe0746ac3e93b859d0972ac5578a2d147b1fa8 (patch)
tree0fd4edfc844dc47c7f472d088e90359564d7bf5a
parent99d32c9a80921bbdf13a8d468648461aafdf7bd6 (diff)
downloadpaludis-80fe0746ac3e93b859d0972ac5578a2d147b1fa8.tar.gz
paludis-80fe0746ac3e93b859d0972ac5578a2d147b1fa8.tar.xz
Filter out empty strings directly in the argument to find
Don't break the assumptions made elsewhere in the script, that the paths have no trailing slash.
-rwxr-xr-xruby/demos/find_unmanaged_files.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/ruby/demos/find_unmanaged_files.rb b/ruby/demos/find_unmanaged_files.rb
index 78c8a10..0aa8875 100755
--- a/ruby/demos/find_unmanaged_files.rb
+++ b/ruby/demos/find_unmanaged_files.rb
@@ -78,7 +78,7 @@ end
env = Paludis::EnvironmentFactory.instance.create env_spec
db = env.package_database
-root = ( env.root.length > 1 && env.root[-1] == ?/ ) ? env.root.chop : env.root
+root = env.root[-1] == ?/ ? env.root.chop : env.root
files = []
@@ -100,7 +100,7 @@ else
end
in_fs = []
-Find.find(*files) {|file| in_fs << file}
+Find.find(*(files.collect {|f| f.empty? ? "/" : f})) {|file| in_fs << file}
db.repositories do |repo|
next unless repo.some_ids_might_support_action(SupportsActionTest.new(InstalledAction))