version 0.0.3. deduperemoverb -> duperemoverb. extension named fideduperange.
This commit is contained in:
parent
e8273e2aae
commit
4d72462ea0
1
Gemfile
1
Gemfile
|
@ -2,3 +2,4 @@ source 'https://rubygems.org'
|
|||
gem 'ffi'
|
||||
gem 'sqlite3'
|
||||
gem 'rake-compiler'
|
||||
gem 'rake-extensions'
|
||||
|
|
19
README.adoc
Normal file
19
README.adoc
Normal file
|
@ -0,0 +1,19 @@
|
|||
duperemove(rb)
|
||||
==============
|
||||
|
||||
Replaces `duperemove`s dedupe-functionality.
|
||||
It is an own program, which uses the database like `duperemove`.
|
||||
While `duperemove` scans directories and builds database, this program only dedupes files extents.
|
||||
|
||||
The advantage is, duperemoverb allowes incremental/partial deduplications.
|
||||
While duperemove deduplicates any files registered in database, you can give a path, which files to deduplicate.
|
||||
Files outside this path will be ignored, but will be deduplicated, if it shares same digests like extends of file inside this path.
|
||||
|
||||
Partial deduplication
|
||||
---------------------
|
||||
|
||||
* /a/1 has two extents: 0x12, 0x54
|
||||
* /b/1 has two extents: 0x54, 0xa8
|
||||
* /b/2 has two extents: 0x90, 0xa8
|
||||
|
||||
If you call `duperemoverb dedupe /a`, `/b/1` and `/b/2` will be ignored, but the first extent of `/b/1` will be deduplicated with `/a/1` second extent.
|
18
Rakefile
18
Rakefile
|
@ -4,18 +4,26 @@ require 'rake'
|
|||
require 'rake/extensiontask'
|
||||
require 'bundler'
|
||||
|
||||
Rake::ExtensionTask.new( "deduperemoverb") do |extension|
|
||||
extension.lib_dir = "ext"
|
||||
extensions = %w[fideduperange].map {|n| [n, Pathname.new( 'ext') + n + "#{n}.so"] }.to_h
|
||||
|
||||
extensions.each do |name, path|
|
||||
Rake::ExtensionTask.new name do |extension|
|
||||
extension.lib_dir = path.dirname
|
||||
end
|
||||
end
|
||||
|
||||
task :chmod do
|
||||
File.chmod 0775, 'ext/deduperemoverb.so'
|
||||
extensions.each do |_,path|
|
||||
path.chmod 0755
|
||||
end
|
||||
end
|
||||
|
||||
task :clean do
|
||||
File.unlink 'ext/deduperemoverb.so' if File.exists? 'ext/deduperemoverb.so'
|
||||
extensions.each do |_,path|
|
||||
path.unlink if path.exist?
|
||||
end
|
||||
end
|
||||
|
||||
task :build => [:clean, :compile, :chmod]
|
||||
|
||||
Bundler::GemHelper.install_tasks name: 'deduperemoverb'
|
||||
Bundler::GemHelper.install_tasks name: 'duperemoverb'
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# vim: set noet sw=2 ts=2 sts=2:
|
||||
|
||||
require 'dencli'
|
||||
require 'deduperemoverb'
|
||||
require 'duperemoverb'
|
||||
require 'ostruct'
|
||||
require 'logger'
|
||||
|
|
@ -1,14 +1,14 @@
|
|||
# vim: set noet sw=2 ts=2 sts=2:
|
||||
require 'rake'
|
||||
require_relative 'lib/deduperemoverb/version'
|
||||
require_relative 'lib/duperemoverb/version'
|
||||
|
||||
Gem::Specification.new do |s|
|
||||
s.name = 'deduperemoverb'
|
||||
s.name = 'duperemoverb'
|
||||
s.version = Duperemove::VERSION
|
||||
s.licenses = %w[LGPLv3]
|
||||
s.authors = 'Denis Knauf'
|
||||
s.homepage = 'https://git.denkn.at/deac/deduperemoverb'
|
||||
s.summary = 'Deduplication of file junks of found files by deduperemove.'
|
||||
s.homepage = 'https://git.denkn.at/deac/duperemoverb'
|
||||
s.summary = 'Deduplication of file junks of found files by duperemove.'
|
||||
s.files =
|
||||
FileList[ %w[
|
||||
lib/**/*.rb
|
||||
|
@ -17,9 +17,9 @@ Gem::Specification.new do |s|
|
|||
ext/*/*.c ext/*/extconf.rb
|
||||
]]
|
||||
s.bindir = %w[bin]
|
||||
s.executables << 'deduperemoverb'
|
||||
s.executables << 'duperemoverb'
|
||||
s.require_paths = %w[lib]
|
||||
s.extensions = %w[ext/deduperemoverb/extconf.rb]
|
||||
s.extensions = %w[ext/fideduperange/extconf.rb]
|
||||
|
||||
s.add_development_dependency "rake", "~> 13"
|
||||
s.add_dependency "ffi", '~> 1.15'
|
|
@ -1,3 +0,0 @@
|
|||
require "mkmf"
|
||||
|
||||
create_makefile "deduperemoverb"
|
3
ext/fideduperange/extconf.rb
Normal file
3
ext/fideduperange/extconf.rb
Normal file
|
@ -0,0 +1,3 @@
|
|||
require "mkmf"
|
||||
|
||||
create_makefile "fideduperange"
|
|
@ -4,7 +4,7 @@
|
|||
require 'sqlite3'
|
||||
require 'pathname'
|
||||
require 'ostruct'
|
||||
require 'deduperemoverb/file_dedupe_range'
|
||||
require 'duperemoverb/file_dedupe_range'
|
||||
|
||||
class SQLite3::ResultSet
|
||||
def each_enum
|
|
@ -15,7 +15,7 @@ module FileDedupeRange
|
|||
extend FFI::Library
|
||||
ffi_lib Pathname.new( __FILE__).
|
||||
dirname.dirname.dirname.
|
||||
join( *%w[ext deduperemoverb deduperemoverb.so]).
|
||||
join( *%w[ext fideduperange fideduperange.so]).
|
||||
expand_path.
|
||||
to_s
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
class Duperemove
|
||||
VERSION = '0.0.2'
|
||||
VERSION = '0.0.3'
|
||||
end
|
Loading…
Reference in a new issue