Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 16.09 25 lines 1.1 kB view raw
1From: Eelco Dolstra <eelco.dolstra@logicblox.com> 2 3Nix deduplicates by hard-linking identical files, so it's normal for 4the the number of links to a file to differ. 5--- 6diff --git a/diffoscope/comparators/directory.py b/diffoscope/comparators/directory.py 7index 7d1cd75..bd91eb0 100644 8--- a/diffoscope/comparators/directory.py 9+++ b/diffoscope/comparators/directory.py 10@@ -47,6 +47,7 @@ class Stat(Command): 11 FILE_RE = re.compile(r'^\s*File:.*$') 12 DEVICE_RE = re.compile(r'Device: [0-9a-f]+h/[0-9]+d') 13 INODE_RE = re.compile(r'Inode: [0-9]+') 14+ LINKS_RE = re.compile(r'Links: [0-9]+') 15 ACCESS_TIME_RE = re.compile(r'^Access: [0-9]{4}-[0-9]{2}-[0-9]{2}.*$') 16 CHANGE_TIME_RE = re.compile(r'^Change: [0-9]{4}-[0-9]{2}-[0-9]{2}.*$') 17 18@@ -55,6 +56,7 @@ class Stat(Command): 19 line = Stat.FILE_RE.sub('', line) 20 line = Stat.DEVICE_RE.sub('', line) 21 line = Stat.INODE_RE.sub('', line) 22+ line = Stat.LINKS_RE.sub('', line) 23 line = Stat.ACCESS_TIME_RE.sub('', line) 24 line = Stat.CHANGE_TIME_RE.sub('', line) 25 return line.encode('utf-8')