VictoriaFreSh 2022.1.10 → 2022.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/victoriafresh.rb +23 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e816682e96950693c25509f5bacef3c369750c4744509b6b4249d07dc3ffb44a
|
4
|
+
data.tar.gz: c6916510d824a4524375dcd88f92aaa24c259a0d8723ea9631352f8f108ef71a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e98134456774cefe3c9f2a22837d3c810365524807218703646643d8c877d2d5d0d5a46f1660a1ef0117746f93dd9f96e879d135dd3aeef9e47072203c3f5967
|
7
|
+
data.tar.gz: 8fd84643f71e5c5a1b016ce444131c324be949d1824d4cf14090b51364fc14d8c3fa8555ffbec96c8983f5565b8f81db9669cd64e0eb1a539eaa82ec8a73f276
|
data/lib/victoriafresh.rb
CHANGED
@@ -88,6 +88,13 @@ class VictoriaFresh
|
|
88
88
|
victoriaFreshData=@externalDataFile.read(packagedFile['file_length']) #读取内容
|
89
89
|
end # if is_duplicate # 是重复文件。
|
90
90
|
|
91
|
+
if (packagedFile['name']=='hgrc')
|
92
|
+
puts packagedFile # Debug
|
93
|
+
puts victoriaFreshData # Debug
|
94
|
+
end
|
95
|
+
|
96
|
+
|
97
|
+
|
91
98
|
pathToMake=pathPrefix + '/' + packagedFile['name'] #构造文件名
|
92
99
|
|
93
100
|
@fileIdPathMap[fileId]=pathToMake # 记录文件编号与路径之间的映射。
|
@@ -365,8 +372,6 @@ class VictoriaFresh
|
|
365
372
|
|
366
373
|
packagedFile={} #创建文件消息对象。
|
367
374
|
|
368
|
-
packagedFile['sub_files'] = [] #加入到子文件列表中。
|
369
|
-
|
370
375
|
directoryPathName=Pathname.new(directoryPath) #构造路径名字对象。
|
371
376
|
|
372
377
|
baseName=directoryPathName.basename.to_s #基本文件名。
|
@@ -381,8 +386,6 @@ class VictoriaFresh
|
|
381
386
|
|
382
387
|
packagedFile['is_symlink']=isSymLink #设置属性,是否是符号链接
|
383
388
|
|
384
|
-
puts directoryPath #Dbug.
|
385
|
-
|
386
389
|
#记录时间戳:
|
387
390
|
begin #读取时间戳
|
388
391
|
mtimeStamp=File.mtime(directoryPath) #获取时间戳
|
@@ -397,7 +400,7 @@ class VictoriaFresh
|
|
397
400
|
end #begin #读取时间戳
|
398
401
|
|
399
402
|
if isFile #是文件,不用再列出其子文件了。
|
400
|
-
packagedFile['file_length']=
|
403
|
+
packagedFile['file_length']=0 #记录文件的内容长度。
|
401
404
|
packagedFile['id']= nextFileId # 设置下一个文件编号
|
402
405
|
|
403
406
|
#读取文件内容:
|
@@ -409,6 +412,8 @@ class VictoriaFresh
|
|
409
412
|
sameFileId=@md5FileIdMap[currentContentMd5] # 尝试寻找对应的相同文件的编号。
|
410
413
|
|
411
414
|
if sameFileId.nil? # 不存在相同的文件
|
415
|
+
packagedFile['file_length']=directoryPathName.size #记录文件的内容长度。
|
416
|
+
|
412
417
|
@contentPartArray << currentFileContent
|
413
418
|
@bufferLength=@bufferLength+ currentFileContent.length #记录缓冲区总长度
|
414
419
|
@md5FileIdMap[currentContentMd5]=packagedFile['id'] # 尝试寻找对应的相同文件的编号。
|
@@ -417,6 +422,18 @@ class VictoriaFresh
|
|
417
422
|
packagedFile['same_file_id']=sameFileId # 设置相同文件的编号。
|
418
423
|
end # if sameFileId.nil? # 不存在相同的文件
|
419
424
|
|
425
|
+
if (packagedFile['name']=='hgrc')
|
426
|
+
puts packagedFile # Debug
|
427
|
+
puts currentFileContent
|
428
|
+
puts @contentPartArray.last
|
429
|
+
puts @contentPartArray.join.length
|
430
|
+
end # if (packagedFile['name']=='hgrc')
|
431
|
+
|
432
|
+
if ((@contentPartArray.join.length-packagedFile['file_length'])!=(packagedFile['file_start_index']))
|
433
|
+
puts packagedFile
|
434
|
+
#raise StandardError
|
435
|
+
end
|
436
|
+
|
420
437
|
assessDiskFlush(layer) #考虑是否要向磁盘先输出内容
|
421
438
|
elsif (isSymLink) #是符号链接
|
422
439
|
linkTarget=directoryPathName.readlink #获取链接目标
|
@@ -434,8 +451,7 @@ class VictoriaFresh
|
|
434
451
|
subFileStartIndex=startIndex #子文件的起始位置,以此目录的起始位置为基准。
|
435
452
|
|
436
453
|
packagedFile['file_length']=0 #本目录的内容长度。
|
437
|
-
|
438
|
-
puts "Listing for #{directoryPathName}" # Debug
|
454
|
+
packagedFile['sub_files'] = [] #加入到子文件列表中。
|
439
455
|
|
440
456
|
directoryPathName.each_child do |subFile| #一个个文件地处理。
|
441
457
|
begin
|
@@ -447,7 +463,6 @@ class VictoriaFresh
|
|
447
463
|
|
448
464
|
assessDiskFlush(layer) #考虑是否要向磁盘先输出内容
|
449
465
|
|
450
|
-
|
451
466
|
subFileStartIndex+=packagedSubFile['file_length'] #记录打包的子文件的长度,更新下一个要打包的子文件的起始位置。
|
452
467
|
|
453
468
|
# puts("237, content string length: #{contentString.length}") #Debug
|