qdumpfs 1.6.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1594429d5e80a9642960701f07ca24f2acc200fa7c7d5762f45d788f5efda0f1
4
- data.tar.gz: 954c39775382b64539ad80cebc613f09dddfd8c23feeaff5e9a9f153ad6dfd9c
3
+ metadata.gz: c40a12aea824fb5604c06c594a9ba0fa1b0fbfd6e819bb271ab29047384ead99
4
+ data.tar.gz: a2938d403f31fe1cec068ca3d3e91c633d8cb231938c6d181f4954e6202dfe39
5
5
  SHA512:
6
- metadata.gz: daa758f9b2486038f1fd668ae321af249606a4e836fe0223e28738f4c9011ff5a30dcbcb9b350e6e65873f37dea70d26cd7f0485277815eacba42fd1dc7043a2
7
- data.tar.gz: 10dbb763cf7e3969cc344d34ce42d70403fceee304b253ad055a250676b63c34c50cd1238e9684c404cfdff7f2dda272726615496e498235d34bc6b01d53eca5
6
+ metadata.gz: 248fba71422ed863d433f72d4be6ab846ee0f329bf2ad289512a876a66222fb0926d3062fced451335b541da11dd6d5cd3fd407c1fabea22c3f3bd62ea148eb2
7
+ data.tar.gz: b549c992447e8a22a955f5218f655e6a5d5f3342fe80ee147ba108023df05353871a6cda8ce1ab3dcbe67e8c0e0e4b0995f5f4e91f7cc1896986632ff19e3fb4
data/.gitignore CHANGED
@@ -11,10 +11,13 @@ list*
11
11
  log.txt
12
12
  *test.cmd
13
13
  test*.cmd
14
+ test*.sh
14
15
  *.log
15
16
  /data/to
16
17
  /data/to2
17
-
18
-
18
+ .idea/workspace.xml
19
+ .idea/tasks.xml
20
+ .idea/dataSources.xml
21
+ .idea/dataSources.local.xml
19
22
  /sync_d.cmd
20
- /test.
23
+ /test
data/.idea/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ # Default ignored files
2
+ /shelf/
3
+ /workspace.xml
4
+ # Editor-based HTTP Client requests
5
+ /httpRequests/
6
+ # Datasource local storage ignored files
7
+ /dataSources/
8
+ /dataSources.local.xml
9
+ # GitHub Copilot persisted chat sessions
10
+ /copilot/chatSessions
@@ -0,0 +1,16 @@
1
+ <component name="InspectionProjectProfileManager">
2
+ <profile version="1.0">
3
+ <option name="myName" value="Project Default" />
4
+ <inspection_tool class="RubyArgCount" enabled="false" level="ERROR" enabled_by_default="false" />
5
+ <inspection_tool class="RubyCaseWithoutElseBlockInspection" enabled="false" level="WARNING" enabled_by_default="false" />
6
+ <inspection_tool class="RubyTooManyInstanceVariablesInspection" enabled="false" level="WARNING" enabled_by_default="false" />
7
+ <inspection_tool class="RubyTooManyMethodsInspection" enabled="false" level="WARNING" enabled_by_default="false" />
8
+ <inspection_tool class="RubyUnnecessaryReturnStatement" enabled="false" level="WARNING" enabled_by_default="false" />
9
+ <inspection_tool class="RubyUnusedLocalVariable" enabled="false" level="WARNING" enabled_by_default="false" />
10
+ <inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
11
+ <option name="processCode" value="true" />
12
+ <option name="processLiterals" value="true" />
13
+ <option name="processComments" value="true" />
14
+ </inspection_tool>
15
+ </profile>
16
+ </component>
data/.idea/misc.xml ADDED
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectRootManager" version="2" project-jdk-name="rbenv: 3.1.3" project-jdk-type="RUBY_SDK" />
4
+ </project>
data/.idea/modules.xml ADDED
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/qdumpfs.iml" filepath="$PROJECT_DIR$/.idea/qdumpfs.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
data/.idea/qdumpfs.iml ADDED
@@ -0,0 +1,91 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="RUBY_MODULE" version="4">
3
+ <component name="ModuleRunConfigurationManager">
4
+ <shared />
5
+ </component>
6
+ <component name="NewModuleRootManager">
7
+ <content url="file://$MODULE_DIR$">
8
+ <sourceFolder url="file://$MODULE_DIR$/features" isTestSource="true" />
9
+ <sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
10
+ <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
11
+ <excludeFolder url="file://$MODULE_DIR$/.idea/copilot/chatSessions" />
12
+ </content>
13
+ <orderEntry type="inheritedJdk" />
14
+ <orderEntry type="sourceFolder" forTests="false" />
15
+ <orderEntry type="module-library">
16
+ <library name="minitest (v5.22.3) [path][gem]" type="rubylib">
17
+ <properties>
18
+ <option name="version" value="4" />
19
+ </properties>
20
+ <CLASSES>
21
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/minitest-5.22.3/lib" />
22
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/minitest-5.22.3/test" />
23
+ </CLASSES>
24
+ <JAVADOC />
25
+ <SOURCES>
26
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/minitest-5.22.3/lib" />
27
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/minitest-5.22.3/test" />
28
+ </SOURCES>
29
+ <excluded>
30
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/minitest-5.22.3/test" />
31
+ </excluded>
32
+ </library>
33
+ </orderEntry>
34
+ <orderEntry type="module-library">
35
+ <library name="rake (v13.1.0) [path][gem]" type="rubylib">
36
+ <properties>
37
+ <option name="version" value="4" />
38
+ </properties>
39
+ <CLASSES>
40
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/rake-13.1.0/doc" />
41
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/rake-13.1.0/exe" />
42
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/rake-13.1.0/lib" />
43
+ </CLASSES>
44
+ <JAVADOC />
45
+ <SOURCES>
46
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/rake-13.1.0/doc" />
47
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/rake-13.1.0/exe" />
48
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/rake-13.1.0/lib" />
49
+ </SOURCES>
50
+ <excluded>
51
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/rake-13.1.0/doc" />
52
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/rake-13.1.0/exe" />
53
+ </excluded>
54
+ </library>
55
+ </orderEntry>
56
+ <orderEntry type="library" scope="PROVIDED" name="bundler (v2.4.20, rbenv: 3.1.3) [gem]" level="application" />
57
+ </component>
58
+ <component name="RakeTasksCache-v2">
59
+ <option name="myRootTask">
60
+ <RakeTaskImpl id="rake">
61
+ <subtasks>
62
+ <RakeTaskImpl description="Build qdumpfs-1.6.1.gem into the pkg directory" fullCommand="build" id="build" />
63
+ <RakeTaskImpl id="build">
64
+ <subtasks>
65
+ <RakeTaskImpl description="Generate SHA512 checksum if qdumpfs-1.6.1.gem into the checksums directory" fullCommand="build:checksum" id="checksum" />
66
+ </subtasks>
67
+ </RakeTaskImpl>
68
+ <RakeTaskImpl description="Remove any temporary products" fullCommand="clean" id="clean" />
69
+ <RakeTaskImpl description="Remove any generated files" fullCommand="clobber" id="clobber" />
70
+ <RakeTaskImpl description="Build and install qdumpfs-1.6.1.gem into system gems" fullCommand="install" id="install" />
71
+ <RakeTaskImpl id="install">
72
+ <subtasks>
73
+ <RakeTaskImpl description="Build and install qdumpfs-1.6.1.gem into system gems without network access" fullCommand="install:local" id="local" />
74
+ </subtasks>
75
+ </RakeTaskImpl>
76
+ <RakeTaskImpl description="Create tag v1.6.1 and build and push qdumpfs-1.6.1.gem to rubygems.org" fullCommand="release[remote]" id="release[remote]" />
77
+ <RakeTaskImpl description="Run tests" fullCommand="test" id="test" />
78
+ <RakeTaskImpl description="" fullCommand="default" id="default" />
79
+ <RakeTaskImpl description="" fullCommand="release" id="release" />
80
+ <RakeTaskImpl id="release">
81
+ <subtasks>
82
+ <RakeTaskImpl description="" fullCommand="release:guard_clean" id="guard_clean" />
83
+ <RakeTaskImpl description="" fullCommand="release:rubygem_push" id="rubygem_push" />
84
+ <RakeTaskImpl description="" fullCommand="release:source_control_push" id="source_control_push" />
85
+ </subtasks>
86
+ </RakeTaskImpl>
87
+ </subtasks>
88
+ </RakeTaskImpl>
89
+ </option>
90
+ </component>
91
+ </module>
data/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="" vcs="Git" />
5
+ </component>
6
+ </project>
data/Gemfile.lock CHANGED
@@ -1,13 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- qdumpfs (1.6.0)
4
+ qdumpfs (1.7.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- minitest (5.19.0)
10
- rake (13.0.6)
9
+ minitest (5.22.3)
10
+ rake (13.2.0)
11
11
 
12
12
  PLATFORMS
13
13
  x64-mingw32
@@ -20,4 +20,4 @@ DEPENDENCIES
20
20
  rake (>= 12.3.3)
21
21
 
22
22
  BUNDLED WITH
23
- 2.2.33
23
+ 2.4.20
@@ -68,6 +68,7 @@ module Qdumpfs
68
68
  class NullMatcher
69
69
  def initialize(options = {})
70
70
  end
71
+ # @param [Object] path
71
72
  def exclude?(path)
72
73
  false
73
74
  end
data/lib/qdumpfs/util.rb CHANGED
@@ -1,4 +1,7 @@
1
1
  # coding: utf-8
2
+
3
+ require 'fileutils'
4
+
2
5
  def wprintf(format, *args)
3
6
  STDERR.printf("pdumpfs: " + format + "\n", *args)
4
7
  end
@@ -35,7 +38,8 @@ class File
35
38
  begin
36
39
  File.unlink(dest) if File.anything_exist?(dest)
37
40
  File.symlink(src, dest)
38
- rescue
41
+ rescue
42
+ puts "force_symlink fails #{src} #{dest}"
39
43
  end
40
44
  end
41
45
 
@@ -65,10 +69,10 @@ module QdumpfsFind
65
69
  def find(logger, *paths)
66
70
  block_given? or return enum_for(__method__, *paths)
67
71
  paths.collect!{|d|
68
- raise Errno::ENOENT unless File.exist?(d);
72
+ raise Errno::ENOENT unless File.exist?(d)
69
73
  d.dup
70
74
  }
71
- while file = paths.shift
75
+ while (file = paths.shift)
72
76
  catch(:prune) do
73
77
  yield file.dup.taint
74
78
  begin
@@ -77,7 +81,7 @@ module QdumpfsFind
77
81
  logger.print("File.lstat path=#{file} error=#{e.message}")
78
82
  next
79
83
  end
80
- if s.directory? then
84
+ if s.directory?
81
85
  begin
82
86
  fs = Dir.entries(file, :encoding=>'UTF-8')
83
87
  rescue => e
@@ -107,22 +111,25 @@ module QdumpfsUtils
107
111
 
108
112
  # We don't use File.copy for calling @interval_proc.
109
113
  def copy_file(src, dest)
110
- begin
111
- File.open(src, 'rb') {|r|
112
- File.open(dest, 'wb') {|w|
113
- block_size = (r.stat.blksize or 8192)
114
- i = 0
115
- while true
116
- block = r.sysread(block_size)
117
- w.syswrite(block)
118
- i += 1
119
- @write_bytes += block.size
120
- end
121
- }
122
- }
123
- rescue EOFError => e
124
- # puts e.message, e.backtrace
125
- end
114
+ # begin
115
+ # File.open(src, 'rb') {|r|
116
+ # File.open(dest, 'wb') {|w|
117
+ # block_size = (r.stat.blksize or 8192)
118
+ # i = 0
119
+ # while true
120
+ # block = r.sysread(block_size)
121
+ # w.syswrite(block)
122
+ # i += 1
123
+ # @write_bytes += block.size
124
+ # end
125
+ # }
126
+ # }
127
+ # rescue EOFError
128
+ # # この実装だとファイルサイズがblock_sizeより小さい場合にEOFErrorが発生する
129
+ # # それはしかたがないので無視する
130
+ # # puts e.message
131
+ # end
132
+ FileUtils.cp(src, dest)
126
133
  unless FileTest.file?(dest)
127
134
  raise "copy_file fails #{dest}"
128
135
  end
@@ -194,7 +201,7 @@ module QdumpfsUtils
194
201
  type = "new_file"
195
202
  when "link"
196
203
  type = "symlink"
197
- end
204
+ end
198
205
  end
199
206
  end
200
207
  return type
@@ -1,4 +1,4 @@
1
1
  module Qdumpfs
2
- VERSION = "1.6.0"
2
+ VERSION = "1.7.0"
3
3
  end
4
4
 
data/lib/qdumpfs.rb CHANGED
@@ -182,16 +182,17 @@ module Qdumpfs
182
182
  # today: 差分バックアップ先ディレクトリ ex)j:/to/backup1/2019/05/10/home
183
183
  dirs = {};
184
184
  QdumpfsFind.find(@opt.logger, src) do |s| # path of the source file
185
- if @opt.matcher.exclude?(s)
186
- if File.lstat(s).directory? then Find.prune() else next end
187
- end
188
- # バックアップ元ファイルのパスからディレクトリ部分を削除
189
- r = make_relative_path(s, src)
190
- # 既存バックアップファイルのパス
191
- l = File.join(latest, r) # path of the latest snapshot
192
- # 新規バックアップファイルのパス
193
- t = File.join(today, r) # path of the today's snapshot
194
185
  begin
186
+ if @opt.matcher.exclude?(s)
187
+ if File.lstat(s).directory? then Find.prune else next end
188
+ end
189
+ # バックアップ元ファイルのパスからディレクトリ部分を削除
190
+ r = make_relative_path(s, src)
191
+ # 既存バックアップファイルのパス
192
+ l = File.join(latest, r) # path of the latest snapshot
193
+ # 新規バックアップファイルのパス
194
+ t = File.join(today, r) # path of the today's snapshot
195
+
195
196
  # ファイルのアップデート
196
197
  update_file(s, l, t)
197
198
  dirs[t] = File.stat(s) if File.ftype(s) == "directory"
@@ -208,12 +209,13 @@ module Qdumpfs
208
209
  def recursive_copy(src, dst)
209
210
  dirs = {}
210
211
  QdumpfsFind.find(@opt.logger, src) do |s|
211
- if @opt.matcher.exclude?(s)
212
- if File.lstat(s).directory? then Find.prune() else next end
213
- end
214
- r = make_relative_path(s, src)
215
- t = File.join(dst, r)
216
212
  begin
213
+ if @opt.matcher.exclude?(s)
214
+ if File.lstat(s).directory? then Find.prune else next end
215
+ end
216
+ r = make_relative_path(s, src)
217
+ t = File.join(dst, r)
218
+
217
219
  type = detect_type(s)
218
220
  report(type, s)
219
221
  next if @opt.dry_run
@@ -228,7 +230,7 @@ module Qdumpfs
228
230
  # just ignore it
229
231
  else
230
232
  raise "#{type}: shouldn't be reached here"
231
- end
233
+ end
232
234
  chown_if_root(type, s, t)
233
235
  dirs[t] = File.stat(s) if File.ftype(s) == "directory"
234
236
  rescue => e
@@ -424,7 +426,7 @@ module Qdumpfs
424
426
  file = @opt.open_verifyfile
425
427
 
426
428
  start_time = Time.now
427
- add_log("##### verify start #{fmt(start_time)} #####")
429
+ log("##### verify start #{fmt(start_time)} #####")
428
430
 
429
431
  src_count, dst_count = do_verify(src, dst)
430
432
 
@@ -435,7 +437,7 @@ module Qdumpfs
435
437
 
436
438
  end_time = Time.now
437
439
  diff = time_diff(start_time, end_time)
438
- add_log("##### list end #{fmt(end_time)} diff=#{diff} #####")
440
+ log("##### list end #{fmt(end_time)} diff=#{diff} #####")
439
441
 
440
442
  file.close
441
443
  end
data/test_qdumpfs.sh CHANGED
@@ -1,6 +1,5 @@
1
1
  #!/bin/sh
2
2
 
3
3
  curdir=$(dirname $0)
4
- bundle exec ruby $curdir/exe/qdumpfs $* ~/_qdumpfs/src ~/_qdumpfs/dst
5
-
6
-
4
+ #bundle exec ruby $curdir/exe/qdumpfs $* ~/_qdumpfs/src ~/_qdumpfs/dst
5
+ bundle exec ruby $curdir/exe/qdumpfs $* --exclude="/Users/sora/Documents/Virtual Machines.localized" /Users/sora /Volumes/qdumpfs/home
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qdumpfs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - src
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-08-21 00:00:00.000000000 Z
11
+ date: 2024-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -62,6 +62,12 @@ extensions: []
62
62
  extra_rdoc_files: []
63
63
  files:
64
64
  - ".gitignore"
65
+ - ".idea/.gitignore"
66
+ - ".idea/inspectionProfiles/Project_Default.xml"
67
+ - ".idea/misc.xml"
68
+ - ".idea/modules.xml"
69
+ - ".idea/qdumpfs.iml"
70
+ - ".idea/vcs.xml"
65
71
  - ".travis.yml"
66
72
  - ".vscode/settings.json"
67
73
  - CODE_OF_CONDUCT.md
@@ -121,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
127
  - !ruby/object:Gem::Version
122
128
  version: '0'
123
129
  requirements: []
124
- rubygems_version: 3.2.33
130
+ rubygems_version: 3.3.26
125
131
  signing_key:
126
132
  specification_version: 4
127
133
  summary: qdumpfs