Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accuracy calculation of bytes if hard links exist. #106

Merged
merged 3 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading