diffoscope: Revive hard links patch

This commit is contained in:
Tuomas Tynkkynen 2017-09-13 17:03:38 +03:00
parent 4b28da6fd8
commit 890d4a2853
2 changed files with 32 additions and 20 deletions

View file

@ -16,8 +16,7 @@ python3Packages.buildPythonApplication rec {
};
patches = [
# Ignore different link counts - doesn't work with 85
# ./ignore_links.patch
./ignore_links.patch
];
postPatch = ''

View file

@ -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 <tuomas.tynkkynen@iki.fi>
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