Skip to content

Commit

Permalink
fixed bugs in the bin/hash_verify package to use the correct method i…
Browse files Browse the repository at this point in the history
…n database library
  • Loading branch information
nathannorton committed Apr 16, 2012
1 parent 0cf5337 commit 8a82101
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bin/hash_verify
Expand Up @@ -39,7 +39,7 @@ end
def verify_hash_action_delete( file )
pub = convert_to_local_pub( file )

if check_values( pub ) and @dbase.different_host?( pub )
if @dbase.check_values( pub ) and @dbase.different_host?( pub )
File.delete file
puts "The following file has been deleted: #{f}!"

Expand Down Expand Up @@ -159,7 +159,7 @@ def main()
# publish the hashes we have found
publish_files.each do |fn|
hash = @hasher.generate_hash( fn ) unless @dbase.contains?( fn )
@dbase.publish_hashes( hash ) unless @dbase.contains?( fn )
@dbase.publish_hash( hash, fn ) unless @dbase.contains?( fn )
end

# verify the local hashes to what we have in the db
Expand Down
2 changes: 1 addition & 1 deletion lib/database.rb
Expand Up @@ -63,7 +63,7 @@ def self.contains?( path )
return false
end

def different_host?( path )
def self.different_host?( path )
@collection.find( "path" => path, "host" => @hostname ).each {|row| return false}
return true
end
Expand Down

0 comments on commit 8a82101

Please sign in to comment.