From 08627e99f7c4452b077bbdfabdb7094fff9e79ca Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 12 Mar 2012 17:41:30 +0000 Subject: Make --no-act work for hardlinks too --- dupfiles | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dupfiles b/dupfiles index 4696c4a..b40acf5 100755 --- a/dupfiles +++ b/dupfiles @@ -249,8 +249,11 @@ class Dupfiles(cliapp.Application): same = [x for x, y in dups if y == meta] dups = [(x,y) for x, y in dups if y != meta] for pathname in same: - os.remove(pathname) - os.link(canonical, pathname) + if self.settings['no-act']: + self.output.write('hardlink %s\n' % pathname) + else: + os.remove(pathname) + os.link(canonical, pathname) def remove_all_but_one(self, duplicates, last_dir): if not last_dir.endswith(os.sep): -- cgit v1.2.1