Make sure we are using the right inode filename
authorZygo Blaxell <zblaxell@esightcorp.com>
Thu, 13 May 2010 20:53:53 +0000 (16:53 -0400)
committerZygo Blaxell <zblaxell@esightcorp.com>
Thu, 13 May 2010 20:53:53 +0000 (16:53 -0400)
dm6

diff --git a/dm6 b/dm6
index 8b45f507058e652a4093d6c51fe8fb7c57ae0091..26546983bccc5b0b1e1b3ae97e584df831163f85 100755 (executable)
--- a/dm6
+++ b/dm6
@@ -170,7 +170,7 @@ while (<STDIN>) {
                        print STDERR "\b";
 
                        # Which file are we keeping?
-                       my $keep_file;
+                       my $keep_ino;
 
                        # If digest link exists, link it to file
                        if ($digest_st) {
@@ -180,17 +180,18 @@ while (<STDIN>) {
                                # Old, replace input with old file
                                print STDERR '-';
                                link_files($digest_link, $file);
-                               $keep_file = $digest_link;
+                               $keep_ino = $digest_st->ino;
                        } else {
                                # New, add input to digest
                                print STDERR '+';
                                link_files($file, $digest_link);
-                               $keep_file = $file;
+                               $keep_ino = $st->ino;
                        }
 
                        # A link to the inode indicates we are done, so do it last
+                       my $keep_link = prepare_parents("$link_dir/inode", $keep_ino);
                        print STDERR '_';
-                       link_files($keep_file, $inode_link);
+                       link_files($keep_link, $inode_link);
 
                }
        };