projects
/
dupemerge
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
9d0ffbc
)
Fold the inode and digest trees into a single structure that shares the non-leaf...
author
Zygo Blaxell
<zblaxell@esightcorp.com>
Thu, 13 May 2010 21:13:59 +0000
(17:13 -0400)
committer
Zygo Blaxell
<zblaxell@esightcorp.com>
Thu, 13 May 2010 21:13:59 +0000
(17:13 -0400)
dm6
patch
|
blob
|
history
diff --git
a/dm6
b/dm6
index 2d554e3a9924cbf3810171cf924e1763d6cbda4c..9b614cdc1107d1285160f85e7c83d116aa52b01b 100755
(executable)
--- a/
dm6
+++ b/
dm6
@@
-125,7
+125,7
@@
while (<STDIN>) {
next if ($st->nlink > $link_count_max);
# Check link to inode
next if ($st->nlink > $link_count_max);
# Check link to inode
- my $inode_link = prepare_parents(
"$link_dir/inode", $st->ino
);
+ my $inode_link = prepare_parents(
$link_dir, $st->ino . 'I'
);
print STDERR 'I';
my $inode_st = lstat($inode_link);
my $update_links;
print STDERR 'I';
my $inode_st = lstat($inode_link);
my $update_links;
@@
-156,7
+156,7
@@
while (<STDIN>) {
$digest =~ y:/:_:;
# Check link to digest
$digest =~ y:/:_:;
# Check link to digest
- my $digest_link = prepare_parents(
"$link_dir/digest", $digest
);
+ my $digest_link = prepare_parents(
$link_dir, "${digest}D"
);
print STDERR 'D';
my $digest_st = lstat($digest_link);
if ($digest_st) {
print STDERR 'D';
my $digest_st = lstat($digest_link);
if ($digest_st) {
@@
-189,7
+189,7
@@
while (<STDIN>) {
}
# A link to the inode indicates we are done, so do it last
}
# A link to the inode indicates we are done, so do it last
- $inode_link = prepare_parents(
"$link_dir/inode", $keep_ino
);
+ $inode_link = prepare_parents(
$link_dir, "${keep_ino}I"
);
print STDERR ' ';
link_files($digest_link, $inode_link);
print STDERR ' ';
link_files($digest_link, $inode_link);
@@
-202,9
+202,9
@@
while (<STDIN>) {
print STDERR "\nGarbage collection in '$link_dir'...";
chdir($link_dir) || die "chdir: $link_dir: $!";
print STDERR "\nRemoving files with link count < 3...";
print STDERR "\nGarbage collection in '$link_dir'...";
chdir($link_dir) || die "chdir: $link_dir: $!";
print STDERR "\nRemoving files with link count < 3...";
-system("find
digest inode
-type f -links -3 -print0 | xargs -0 rm -f") and die "system: exit status $?";
+system("find
.
-type f -links -3 -print0 | xargs -0 rm -f") and die "system: exit status $?";
print STDERR "\nRemoving empty directories...";
print STDERR "\nRemoving empty directories...";
-system("find
digest inode
-type d -empty -print0 | xargs -0r rmdir -p --ignore-fail-on-non-empty") and die "system: exit status $?";
+system("find
.
-type d -empty -print0 | xargs -0r rmdir -p --ignore-fail-on-non-empty") and die "system: exit status $?";
print STDERR "\nDone.\n";
exit(0);
print STDERR "\nDone.\n";
exit(0);