From 890d4a2853ee03749932ff900f4248bcd4393a3a Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Wed, 13 Sep 2017 17:03:38 +0300 Subject: [PATCH] diffoscope: Revive hard links patch --- pkgs/tools/misc/diffoscope/default.nix | 3 +- pkgs/tools/misc/diffoscope/ignore_links.patch | 49 ++++++++++++------- 2 files changed, 32 insertions(+), 20 deletions(-) diff --git a/pkgs/tools/misc/diffoscope/default.nix b/pkgs/tools/misc/diffoscope/default.nix index 1ef49ab0b225..0d2bdf1ffc7d 100644 --- a/pkgs/tools/misc/diffoscope/default.nix +++ b/pkgs/tools/misc/diffoscope/default.nix @@ -16,8 +16,7 @@ python3Packages.buildPythonApplication rec { }; patches = [ - # Ignore different link counts - doesn't work with 85 - # ./ignore_links.patch + ./ignore_links.patch ]; postPatch = '' diff --git a/pkgs/tools/misc/diffoscope/ignore_links.patch b/pkgs/tools/misc/diffoscope/ignore_links.patch index ceea0dc94d4e..b0841ce0bb57 100644 --- a/pkgs/tools/misc/diffoscope/ignore_links.patch +++ b/pkgs/tools/misc/diffoscope/ignore_links.patch @@ -1,19 +1,32 @@ -diff -ru -x '*~' diffoscope-orig/diffoscope/comparators/directory.py diffoscope/diffoscope/comparators/directory.py ---- diffoscope-orig/diffoscope/comparators/directory.py 1970-01-01 01:00:01.000000000 +0100 -+++ diffoscope/diffoscope/comparators/directory.py 2016-12-08 17:37:55.000315157 +0100 -@@ -49,6 +49,7 @@ - FILE_RE = re.compile(r'^\s*File:.*$') - DEVICE_RE = re.compile(r'Device: [0-9a-f]+h/[0-9]+d\s+') - INODE_RE = re.compile(r'Inode: [0-9]+\s+') -+ LINKS_RE = re.compile(r'Links: [0-9]+\s+') - ACCESS_TIME_RE = re.compile(r'^Access: [0-9]{4}-[0-9]{2}-[0-9]{2}.*$') - CHANGE_TIME_RE = re.compile(r'^Change: [0-9]{4}-[0-9]{2}-[0-9]{2}.*$') +From a33e8018092e4a91dbc45e15bbeff760b3418512 Mon Sep 17 00:00:00 2001 +From: Tuomas Tynkkynen +Date: Wed, 13 Sep 2017 16:53:38 +0300 +Subject: [PATCH] Ignore hard link counts + +--- + diffoscope/comparators/directory.py | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/diffoscope/comparators/directory.py b/diffoscope/comparators/directory.py +index 3b195bc..9071bb3 100644 +--- a/diffoscope/comparators/directory.py ++++ b/diffoscope/comparators/directory.py +@@ -66,6 +66,7 @@ else: + FILE_RE = re.compile(r'^\s*File:.*$') + DEVICE_RE = re.compile(r'Device: [0-9a-f]+h/[0-9]+d\s+') + INODE_RE = re.compile(r'Inode: [0-9]+\s+') ++ LINKS_RE = re.compile(r'Links: [0-9]+\s+') + ACCESS_TIME_RE = re.compile(r'^Access: [0-9]{4}-[0-9]{2}-[0-9]{2}.*$') + CHANGE_TIME_RE = re.compile(r'^Change: [0-9]{4}-[0-9]{2}-[0-9]{2}.*$') -@@ -57,6 +58,7 @@ - line = Stat.FILE_RE.sub('', line) - line = Stat.DEVICE_RE.sub('', line) - line = Stat.INODE_RE.sub('', line) -+ line = Stat.LINKS_RE.sub('', line) - line = Stat.ACCESS_TIME_RE.sub('', line) - line = Stat.CHANGE_TIME_RE.sub('', line) - return line.encode('utf-8') +@@ -74,6 +75,7 @@ else: + line = Stat.FILE_RE.sub('', line) + line = Stat.DEVICE_RE.sub('', line) + line = Stat.INODE_RE.sub('', line) ++ line = Stat.LINKS_RE.sub('', line) + line = Stat.ACCESS_TIME_RE.sub('', line) + line = Stat.CHANGE_TIME_RE.sub('', line) + return line.encode('utf-8') +-- +2.13.0 +