method renamed to use the same semantic like duperemove (dedupe_extent)
This commit is contained in:
parent
3cc57e2e78
commit
01b3ebe04f
|
@ -9,14 +9,13 @@ Gem::Specification.new do |s|
|
||||||
s.homepage = 'https://git.denkn.at/deac/deduperemoverb'
|
s.homepage = 'https://git.denkn.at/deac/deduperemoverb'
|
||||||
s.summary = 'Deduplication of file junks of found files by deduperemove.'
|
s.summary = 'Deduplication of file junks of found files by deduperemove.'
|
||||||
s.files =
|
s.files =
|
||||||
FileList[
|
FileList[ %w[
|
||||||
'lib/**/*.rb',
|
lib/**/*.rb
|
||||||
'bin/*',
|
bin/*
|
||||||
'Gemfile',
|
Gemfile Gemfile.lock
|
||||||
'Gemfile.lock',
|
ext/*/*.c ext/*/extconf.rb
|
||||||
'ext/*/*.c',
|
]]
|
||||||
'ext/*/extconf.rb'
|
s.bindir = %w[bin]
|
||||||
]
|
|
||||||
s.require_paths = %w[lib]
|
s.require_paths = %w[lib]
|
||||||
s.extensions = %w[ext/deduperemoverb/extconf.rb]
|
s.extensions = %w[ext/deduperemoverb/extconf.rb]
|
||||||
|
|
||||||
|
@ -24,5 +23,6 @@ Gem::Specification.new do |s|
|
||||||
s.add_dependency "ffi", '~> 1.15'
|
s.add_dependency "ffi", '~> 1.15'
|
||||||
s.add_dependency "sqlite3", '~> 1.4'
|
s.add_dependency "sqlite3", '~> 1.4'
|
||||||
|
|
||||||
#s.install_tasks name: 'compile'
|
s.requirements << 'cc'
|
||||||
|
s.requirements << 'ruby-dev'
|
||||||
end
|
end
|
||||||
|
|
|
@ -111,7 +111,7 @@ class Duperemove
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def self.duperemove fd, offset, length, dupes
|
def self.dedupe_extent fd, offset, length, dupes
|
||||||
rr = FileDedupeRange[dupes.size].new offset, length
|
rr = FileDedupeRange[dupes.size].new offset, length
|
||||||
fds = []
|
fds = []
|
||||||
dupes.each_with_index do |(fd,os),i|
|
dupes.each_with_index do |(fd,os),i|
|
||||||
|
@ -224,7 +224,7 @@ class Duperemove
|
||||||
begin
|
begin
|
||||||
t1 = Time.now
|
t1 = Time.now
|
||||||
rs =
|
rs =
|
||||||
Duperemove.duperemove fst.file,
|
Duperemove.dedupe_extent fst.file,
|
||||||
fst.offset,
|
fst.offset,
|
||||||
[ fst.size - fst.offset, block_size ].min,
|
[ fst.size - fst.offset, block_size ].min,
|
||||||
fs.map {|f| [f.file, f.offset] }.to_h
|
fs.map {|f| [f.file, f.offset] }.to_h
|
||||||
|
|
Loading…
Reference in a new issue