Skip to content

Commit

Permalink
Merge pull request #106 from CCBR/vnk_dev
Browse files Browse the repository at this point in the history
Accuracy calculation of bytes if hard links exist.
  • Loading branch information
kopardev authored Jul 16, 2024
2 parents 9019043 + ee0ae8d commit 7e23327
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

### Bug fixes

## spacesavers2 v0.14.0

- resolved #102

### New features

## spacesavers2 v0.13.0

### New features
Expand Down
15 changes: 7 additions & 8 deletions spacesavers2_mimeo
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ def process_hh(
if foldest.uid == uid or 0 == uid : user_owns_original = True
uid_file_index = list(filter(lambda x:x!=oldest_index,uid_file_index)) # remove oldest if present in list
inodes_already_summerized = [foldest.inode]
if user_owns_original:
fpaths = foldest.get_paths(mindepth, maxdepth)
for p in fpaths:
perfolder_summaries[p].nnondup_files += 1
perfolder_summaries[p].non_dup_Bytes.append(foldest.calculated_size)
perfolder_summaries[p].non_dup_ages.append(foldest.mtime)
# if hashhash[h].ndup_files > 0: # we have duplicates
if len(uid_file_index) > 0: # uid has copies
for i in uid_file_index:
Expand All @@ -66,7 +72,7 @@ def process_hh(
fpaths = f.get_paths(mindepth, maxdepth)
if f.inode in inodes_already_summerized: # it is a hardlink
for p in fpaths:
perfolder_summaries[p].ndup_files += 1
perfolder_summaries[p].nnondup_files += 1
else:
inodes_already_summerized.append(f.inode)
if not parent in perfolder_dups:
Expand All @@ -76,13 +82,6 @@ def process_hh(
perfolder_summaries[p].ndup_files+=1
perfolder_summaries[p].dup_Bytes.append(f.calculated_size)
perfolder_summaries[p].dup_ages.append(f.mtime)
else: # we only have 1 original file
if user_owns_original:
fpaths = foldest.get_paths(mindepth, maxdepth)
for p in fpaths:
perfolder_summaries[p].nnondup_files += 1
perfolder_summaries[p].non_dup_Bytes.append(foldest.calculated_size)
perfolder_summaries[p].non_dup_ages.append(foldest.mtime)
out_index = []
out_index.append(oldest_index)
out_index.extend(uid_file_index)
Expand Down
2 changes: 1 addition & 1 deletion src/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.13.0
0.14.0

0 comments on commit 7e23327

Please sign in to comment.