diff options
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r-- | gnu/packages/patches/binutils-ld-new-dtags.patch | 16 | ||||
-rw-r--r-- | gnu/packages/patches/glib-respect-datadir.patch | 21 | ||||
-rw-r--r-- | gnu/packages/patches/graphite2-ffloat-store.patch | 34 | ||||
-rw-r--r-- | gnu/packages/patches/lcms-CVE-2016-10165.patch | 36 | ||||
-rw-r--r-- | gnu/packages/patches/libtasn1-CVE-2017-10790.patch | 63 | ||||
-rw-r--r-- | gnu/packages/patches/libtasn1-CVE-2018-6003.patch | 73 | ||||
-rw-r--r-- | gnu/packages/patches/libxcb-python-3.5-compat.patch | 64 | ||||
-rw-r--r-- | gnu/packages/patches/patch-hurd-path-max.patch | 15 | ||||
-rw-r--r-- | gnu/packages/patches/pcre2-CVE-2017-7186.patch | 68 | ||||
-rw-r--r-- | gnu/packages/patches/pcre2-CVE-2017-8786.patch | 155 | ||||
-rw-r--r-- | gnu/packages/patches/python-3-search-paths.patch | 13 | ||||
-rw-r--r-- | gnu/packages/patches/tar-CVE-2016-6321.patch | 51 | ||||
-rw-r--r-- | gnu/packages/patches/tar-remove-wholesparse-check.patch | 68 | ||||
-rw-r--r-- | gnu/packages/patches/xcb-proto-python3-print.patch | 75 | ||||
-rw-r--r-- | gnu/packages/patches/xcb-proto-python3-whitespace.patch | 217 |
15 files changed, 81 insertions, 888 deletions
diff --git a/gnu/packages/patches/binutils-ld-new-dtags.patch b/gnu/packages/patches/binutils-ld-new-dtags.patch deleted file mode 100644 index 5f7a03fc38..0000000000 --- a/gnu/packages/patches/binutils-ld-new-dtags.patch +++ /dev/null @@ -1,16 +0,0 @@ -Turn on --enable-new-dtags by default to make the linker set RUNPATH -instead of RPATH on binaries. This is important because RUNPATH can -be overriden using LD_LIBRARY_PATH at runtime. - -Patch from Nixpkgs by Eelco Dolstra <eelco.dolstra@logicblox.com>. - ---- binutils/ld/ldmain.c -+++ binutils/ld/ldmain.c -@@ -296,6 +296,7 @@ main (int argc, char **argv) - - link_info.allow_undefined_version = TRUE; - link_info.keep_memory = TRUE; -+ link_info.new_dtags = TRUE; - link_info.combreloc = TRUE; - link_info.strip_discarded = TRUE; - link_info.callbacks = &link_callbacks; diff --git a/gnu/packages/patches/glib-respect-datadir.patch b/gnu/packages/patches/glib-respect-datadir.patch deleted file mode 100644 index 309ce9fc0b..0000000000 --- a/gnu/packages/patches/glib-respect-datadir.patch +++ /dev/null @@ -1,21 +0,0 @@ -On Guix, Python modules are in a different output from the executables, -so searching "../share/glib-2.0" will not work. - -This patch restores behaviour prior to this commit: -<https://git.gnome.org/browse/glib/commit/?id=fe2a9887a8ccb14f2386e01b14834e97a33bc2d7> - ---- a/gio/gdbus-2.0/codegen/gdbus-codegen.in -+++ b/gio/gdbus-2.0/codegen/gdbus-codegen.in -@@ -25,9 +25,12 @@ - - srcdir = os.getenv('UNINSTALLED_GLIB_SRCDIR', None) - filedir = os.path.dirname(__file__) -+datadir = os.path.join('@datadir@', 'glib-2.0') - - if srcdir is not None: - path = os.path.join(srcdir, 'gio', 'gdbus-2.0') -+elif os.path.exists(os.path.join(datadir, 'codegen')): -+ path = datadir - elif os.path.basename(filedir) == 'bin': - # Make the prefix containing gdbus-codegen 'relocatable' at runtime by - # adding /some/prefix/bin/../share/glib-2.0 to the python path diff --git a/gnu/packages/patches/graphite2-ffloat-store.patch b/gnu/packages/patches/graphite2-ffloat-store.patch deleted file mode 100644 index f6ee56973e..0000000000 --- a/gnu/packages/patches/graphite2-ffloat-store.patch +++ /dev/null @@ -1,34 +0,0 @@ -Fix test failures of awamicmp1 and awamicmp2. - -Debian bug report: - -https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=855814 - -Patch adapted from upstream source repository: - -https://github.com/silnrsi/graphite/commit/f7bbdd87d510d587c872e314d6458160c0069c65 - -From f7bbdd87d510d587c872e314d6458160c0069c65 Mon Sep 17 00:00:00 2001 -From: Martin Hosken <martin_hosken@sil.org> -Date: Tue, 14 Feb 2017 17:00:03 +0000 -Subject: [PATCH] try -ffloat-store for fp stability. Remove nested const to - work around VS bug - ---- - src/CMakeLists.txt | 2 +- - src/inc/locale2lcid.h | 4 ++-- - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 4f1e7e5..5b61b5c 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -108,7 +108,7 @@ set_target_properties(graphite2 PROPERTIES PUBLIC_HEADER "${GRAPHITE_HEADERS}" - - if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") - set_target_properties(graphite2 PROPERTIES -- COMPILE_FLAGS "-Wall -Wextra -Wno-unknown-pragmas -Wendif-labels -Wshadow -Wctor-dtor-privacy -Wnon-virtual-dtor -fno-rtti -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden -fno-stack-protector" -+ COMPILE_FLAGS "-Wall -Wextra -Wno-unknown-pragmas -Wendif-labels -Wshadow -Wctor-dtor-privacy -Wnon-virtual-dtor -fno-rtti -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden -fno-stack-protector -ffloat-store" - LINK_FLAGS "-nodefaultlibs ${GRAPHITE_LINK_FLAGS}" - LINKER_LANGUAGE C) - if (CMAKE_COMPILER_IS_GNUCXX) diff --git a/gnu/packages/patches/lcms-CVE-2016-10165.patch b/gnu/packages/patches/lcms-CVE-2016-10165.patch deleted file mode 100644 index fa4d75c9ee..0000000000 --- a/gnu/packages/patches/lcms-CVE-2016-10165.patch +++ /dev/null @@ -1,36 +0,0 @@ -Fix CVE-2016-10165, an out-of-bounds heap read in Type_MLU_Read(): - -https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-10165 -http://seclists.org/oss-sec/2016/q3/288 -https://bugzilla.redhat.com/show_bug.cgi?id=1367357 -https://security-tracker.debian.org/tracker/CVE-2016-10165 - -Patch copied from upstream source repository: - -https://github.com/mm2/Little-CMS/commit/5ca71a7bc18b6897ab21d815d15e218e204581e2 - -From 5ca71a7bc18b6897ab21d815d15e218e204581e2 Mon Sep 17 00:00:00 2001 -From: Marti <marti.maria@tktbrainpower.com> -Date: Mon, 15 Aug 2016 23:31:39 +0200 -Subject: [PATCH] Added an extra check to MLU bounds - -Thanks to Ibrahim el-sayed for spotting the bug ---- - src/cmstypes.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/cmstypes.c b/src/cmstypes.c -index cb61860..c7328b9 100644 ---- a/src/cmstypes.c -+++ b/src/cmstypes.c -@@ -1460,6 +1460,7 @@ void *Type_MLU_Read(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, cmsU - - // Check for overflow - if (Offset < (SizeOfHeader + 8)) goto Error; -+ if ((Offset + Len) > SizeOfTag + 8) goto Error; - - // True begin of the string - BeginOfThisString = Offset - SizeOfHeader - 8; --- -2.11.0 - diff --git a/gnu/packages/patches/libtasn1-CVE-2017-10790.patch b/gnu/packages/patches/libtasn1-CVE-2017-10790.patch deleted file mode 100644 index 6cec0c8030..0000000000 --- a/gnu/packages/patches/libtasn1-CVE-2017-10790.patch +++ /dev/null @@ -1,63 +0,0 @@ -Fix CVE-2017-10790: - -https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-10790 - -Patch copied from upstream source repository: - -https://git.savannah.nongnu.org/cgit/libtasn1.git/commit/?id=d8d805e1f2e6799bb2dff4871a8598dc83088a39 - -From d8d805e1f2e6799bb2dff4871a8598dc83088a39 Mon Sep 17 00:00:00 2001 -From: Nikos Mavrogiannopoulos <nmav@redhat.com> -Date: Thu, 22 Jun 2017 16:31:37 +0200 -Subject: [PATCH] _asn1_check_identifier: safer access to values read - -Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com> ---- - lib/parser_aux.c | 17 ++++++++++++----- - 1 file changed, 12 insertions(+), 5 deletions(-) - -diff --git a/lib/parser_aux.c b/lib/parser_aux.c -index 976ab38..786ea64 100644 ---- a/lib/parser_aux.c -+++ b/lib/parser_aux.c -@@ -955,7 +955,7 @@ _asn1_check_identifier (asn1_node node) - if (p2 == NULL) - { - if (p->value) -- _asn1_strcpy (_asn1_identifierMissing, p->value); -+ _asn1_str_cpy (_asn1_identifierMissing, sizeof(_asn1_identifierMissing), (char*)p->value); - else - _asn1_strcpy (_asn1_identifierMissing, "(null)"); - return ASN1_IDENTIFIER_NOT_FOUND; -@@ -968,9 +968,15 @@ _asn1_check_identifier (asn1_node node) - if (p2 && (type_field (p2->type) == ASN1_ETYPE_DEFAULT)) - { - _asn1_str_cpy (name2, sizeof (name2), node->name); -- _asn1_str_cat (name2, sizeof (name2), "."); -- _asn1_str_cat (name2, sizeof (name2), (char *) p2->value); -- _asn1_strcpy (_asn1_identifierMissing, p2->value); -+ if (p2->value) -+ { -+ _asn1_str_cat (name2, sizeof (name2), "."); -+ _asn1_str_cat (name2, sizeof (name2), (char *) p2->value); -+ _asn1_str_cpy (_asn1_identifierMissing, sizeof(_asn1_identifierMissing), (char*)p2->value); -+ } -+ else -+ _asn1_strcpy (_asn1_identifierMissing, "(null)"); -+ - p2 = asn1_find_node (node, name2); - if (!p2 || (type_field (p2->type) != ASN1_ETYPE_OBJECT_ID) || - !(p2->type & CONST_ASSIGN)) -@@ -990,7 +996,8 @@ _asn1_check_identifier (asn1_node node) - _asn1_str_cpy (name2, sizeof (name2), node->name); - _asn1_str_cat (name2, sizeof (name2), "."); - _asn1_str_cat (name2, sizeof (name2), (char *) p2->value); -- _asn1_strcpy (_asn1_identifierMissing, p2->value); -+ _asn1_str_cpy (_asn1_identifierMissing, sizeof(_asn1_identifierMissing), (char*)p2->value); -+ - p2 = asn1_find_node (node, name2); - if (!p2 || (type_field (p2->type) != ASN1_ETYPE_OBJECT_ID) - || !(p2->type & CONST_ASSIGN)) --- -2.13.3 - diff --git a/gnu/packages/patches/libtasn1-CVE-2018-6003.patch b/gnu/packages/patches/libtasn1-CVE-2018-6003.patch deleted file mode 100644 index 3e6140518d..0000000000 --- a/gnu/packages/patches/libtasn1-CVE-2018-6003.patch +++ /dev/null @@ -1,73 +0,0 @@ -Fix CVE-2018-6003: - -https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-6003 -https://lists.gnu.org/archive/html/help-libtasn1/2018-01/msg00000.html - -Patch copied from upstream source repository: - -https://gitlab.com/gnutls/libtasn1/commit/c593ae84cfcde8fea45787e53950e0ac71e9ca97 - -From c593ae84cfcde8fea45787e53950e0ac71e9ca97 Mon Sep 17 00:00:00 2001 -From: Nikos Mavrogiannopoulos <nmav@redhat.com> -Date: Thu, 4 Jan 2018 10:52:05 +0100 -Subject: [PATCH] _asn1_decode_simple_ber: restrict the levels of recursion to 3 - -On indefinite string decoding, setting a maximum level of recursions -protects the BER decoder from a stack exhaustion due to large amounts -of recursion. - -Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com> ---- - lib/decoding.c | 21 +++++++++++++++++++-- - 1 file changed, 19 insertions(+), 2 deletions(-) - -diff --git a/lib/decoding.c b/lib/decoding.c -index 2240b09..0ee35d3 100644 ---- a/lib/decoding.c -+++ b/lib/decoding.c -@@ -45,6 +45,13 @@ - - #define DECODE_FLAG_HAVE_TAG 1 - #define DECODE_FLAG_INDEFINITE (1<<1) -+/* On indefinite string decoding, allow this maximum levels -+ * of recursion. Allowing infinite recursion, makes the BER -+ * decoder susceptible to stack exhaustion due to that recursion. -+ */ -+#define DECODE_FLAG_LEVEL1 (1<<2) -+#define DECODE_FLAG_LEVEL2 (1<<3) -+#define DECODE_FLAG_LEVEL3 (1<<4) - - #define DECR_LEN(l, s) do { \ - l -= s; \ -@@ -2216,7 +2223,8 @@ _asn1_decode_simple_ber (unsigned int etype, const unsigned char *der, - } - - /* indefinite constructed */ -- if (((dflags & DECODE_FLAG_INDEFINITE) || class == ASN1_CLASS_STRUCTURED) && ETYPE_IS_STRING(etype)) -+ if ((((dflags & DECODE_FLAG_INDEFINITE) || class == ASN1_CLASS_STRUCTURED) && ETYPE_IS_STRING(etype)) && -+ !(dflags & DECODE_FLAG_LEVEL3)) - { - len_len = 1; - -@@ -2236,8 +2244,17 @@ _asn1_decode_simple_ber (unsigned int etype, const unsigned char *der, - do - { - unsigned tmp_len; -+ unsigned flags = DECODE_FLAG_HAVE_TAG; -+ -+ if (dflags & DECODE_FLAG_LEVEL1) -+ flags |= DECODE_FLAG_LEVEL2; -+ else if (dflags & DECODE_FLAG_LEVEL2) -+ flags |= DECODE_FLAG_LEVEL3; -+ else -+ flags |= DECODE_FLAG_LEVEL1; - -- result = asn1_decode_simple_ber(etype, p, der_len, &out, &out_len, &tmp_len); -+ result = _asn1_decode_simple_ber(etype, p, der_len, &out, &out_len, &tmp_len, -+ flags); - if (result != ASN1_SUCCESS) - { - warn(); --- -libgit2 0.26.0 - diff --git a/gnu/packages/patches/libxcb-python-3.5-compat.patch b/gnu/packages/patches/libxcb-python-3.5-compat.patch deleted file mode 100644 index f652498aad..0000000000 --- a/gnu/packages/patches/libxcb-python-3.5-compat.patch +++ /dev/null @@ -1,64 +0,0 @@ -Fix compatibility issue with Python 3.5. - -Patch copied from upstream source repository: - -https://cgit.freedesktop.org/xcb/libxcb/commit/?id=8740a288ca468433141341347aa115b9544891d3 - -From 8740a288ca468433141341347aa115b9544891d3 Mon Sep 17 00:00:00 2001 -From: Thomas Klausner <wiz@NetBSD.org> -Date: Thu, 19 May 2016 17:31:18 +0200 -Subject: [PATCH] Fix inconsistent use of tabs vs. space. - -Needed for at least python-3.5.x. - -Signed-off-by: Thomas Klausner <wiz@NetBSD.org> -Signed-off-by: Uli Schlachter <psychon@znc.in> ---- - src/c_client.py | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/src/c_client.py b/src/c_client.py -index 57de3fb..043338d 100644 ---- a/src/c_client.py -+++ b/src/c_client.py -@@ -1364,7 +1364,7 @@ def _c_serialize(context, self): - _c(' unsigned int xcb_align_to = 0;') - if self.is_switch: - _c(' unsigned int xcb_padding_offset = %d;', -- self.get_align_offset() ) -+ self.get_align_offset() ) - prefix = [('_aux', '->', self)] - aux_ptr = 'xcb_out' - -@@ -1390,7 +1390,7 @@ def _c_serialize(context, self): - _c(' unsigned int xcb_align_to = 0;') - if self.is_switch: - _c(' unsigned int xcb_padding_offset = %d;', -- self.get_align_offset() ) -+ self.get_align_offset() ) - - elif 'sizeof' == context: - param_names = [p[2] for p in params] -@@ -1930,14 +1930,14 @@ def _c_accessors_list(self, field): - # from the request size and divide that by the member size - return '(((R->length * 4) - sizeof('+ self.c_type + '))/'+'sizeof('+field.type.member.c_wiretype+'))' - else: -- # use the accessor to get the start of the list, then -- # compute the length of it by subtracting it from -+ # use the accessor to get the start of the list, then -+ # compute the length of it by subtracting it from - # the adress of the first byte after the end of the - # request -- after_end_of_request = '(((char*)R) + R->length * 4)' -- start_of_list = '%s(R)' % (field.c_accessor_name) -+ after_end_of_request = '(((char*)R) + R->length * 4)' -+ start_of_list = '%s(R)' % (field.c_accessor_name) - bytesize_of_list = '%s - (char*)(%s)' % (after_end_of_request, start_of_list) -- return '(%s) / sizeof(%s)' % (bytesize_of_list, field.type.member.c_wiretype) -+ return '(%s) / sizeof(%s)' % (bytesize_of_list, field.type.member.c_wiretype) - else: - raise Exception( - "lengthless lists with varsized members are not supported. Fieldname '%s'" --- -2.11.1 - diff --git a/gnu/packages/patches/patch-hurd-path-max.patch b/gnu/packages/patches/patch-hurd-path-max.patch index 81e37930c2..1845a5803b 100644 --- a/gnu/packages/patches/patch-hurd-path-max.patch +++ b/gnu/packages/patches/patch-hurd-path-max.patch @@ -13,7 +13,7 @@ Subject: [PATCH] Do not rely on PATH_MAX when reading a symlink target. 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/util.c b/src/util.c -index 82a7e37..c4c0f9d 100644 +index 1cc08ba..67dbd3a 100644 --- a/src/util.c +++ b/src/util.c @@ -460,12 +460,12 @@ move_file (char const *from, bool *from_needs_removal, @@ -31,18 +31,19 @@ index 82a7e37..c4c0f9d 100644 size += i; if (i != 0 || close (fd) != 0) read_fatal (); -@@ -610,9 +610,9 @@ copy_file (char const *from, char const *to, struct stat *tost, +@@ -610,10 +610,10 @@ copy_file (char const *from, char const *to, struct stat *tost, if (S_ISLNK (mode)) { -- char *buffer = xmalloc (PATH_MAX); +- char *buffer = xmalloc (PATH_MAX + 1); + char *buffer = xmalloc (tost->st_size + 1); + ssize_t r; -- if (safe_readlink (from, buffer, PATH_MAX) < 0) -+ if (safe_readlink (from, buffer, tost->st_size) < 0) +- if ((r = safe_readlink (from, buffer, PATH_MAX)) < 0) ++ if ((r = safe_readlink (from, buffer, tost->st_size)) < 0) pfatal ("Can't read %s %s", "symbolic link", from); + buffer[r] = '\0'; if (safe_symlink (buffer, to) != 0) - pfatal ("Can't create %s %s", "symbolic link", to); -- -2.4.2 +2.16.2 diff --git a/gnu/packages/patches/pcre2-CVE-2017-7186.patch b/gnu/packages/patches/pcre2-CVE-2017-7186.patch deleted file mode 100644 index 5c16955aaa..0000000000 --- a/gnu/packages/patches/pcre2-CVE-2017-7186.patch +++ /dev/null @@ -1,68 +0,0 @@ -Patch for <https://nvd.nist.gov/vuln/detail?vulnId=CVE-2017-7186> -taken from <https://vcs.pcre.org/pcre2?view=revision&revision=670>. - ---- trunk/src/pcre2_internal.h 2016/11/19 12:46:24 600 -+++ trunk/src/pcre2_internal.h 2017/02/24 18:25:32 670 -@@ -1774,10 +1774,17 @@ - /* UCD access macros */ - - #define UCD_BLOCK_SIZE 128 --#define GET_UCD(ch) (PRIV(ucd_records) + \ -+#define REAL_GET_UCD(ch) (PRIV(ucd_records) + \ - PRIV(ucd_stage2)[PRIV(ucd_stage1)[(int)(ch) / UCD_BLOCK_SIZE] * \ - UCD_BLOCK_SIZE + (int)(ch) % UCD_BLOCK_SIZE]) - -+#if PCRE2_CODE_UNIT_WIDTH == 32 -+#define GET_UCD(ch) ((ch > MAX_UTF_CODE_POINT)? \ -+ PRIV(dummy_ucd_record) : REAL_GET_UCD(ch)) -+#else -+#define GET_UCD(ch) REAL_GET_UCD(ch) -+#endif -+ - #define UCD_CHARTYPE(ch) GET_UCD(ch)->chartype - #define UCD_SCRIPT(ch) GET_UCD(ch)->script - #define UCD_CATEGORY(ch) PRIV(ucp_gentype)[UCD_CHARTYPE(ch)] -@@ -1834,6 +1841,9 @@ - #define _pcre2_default_compile_context PCRE2_SUFFIX(_pcre2_default_compile_context_) - #define _pcre2_default_match_context PCRE2_SUFFIX(_pcre2_default_match_context_) - #define _pcre2_default_tables PCRE2_SUFFIX(_pcre2_default_tables_) -+#if PCRE2_CODE_UNIT_WIDTH == 32 -+#define _pcre2_dummy_ucd_record PCRE2_SUFFIX(_pcre2_dummy_ucd_record_) -+#endif - #define _pcre2_hspace_list PCRE2_SUFFIX(_pcre2_hspace_list_) - #define _pcre2_vspace_list PCRE2_SUFFIX(_pcre2_vspace_list_) - #define _pcre2_ucd_caseless_sets PCRE2_SUFFIX(_pcre2_ucd_caseless_sets_) -@@ -1858,6 +1868,9 @@ - extern const uint32_t PRIV(vspace_list)[]; - extern const uint32_t PRIV(ucd_caseless_sets)[]; - extern const ucd_record PRIV(ucd_records)[]; -+#if PCRE2_CODE_UNIT_WIDTH == 32 -+extern const ucd_record PRIV(dummy_ucd_record)[]; -+#endif - extern const uint8_t PRIV(ucd_stage1)[]; - extern const uint16_t PRIV(ucd_stage2)[]; - extern const uint32_t PRIV(ucp_gbtable)[]; - ---- trunk/src/pcre2_ucd.c 2015/07/17 15:44:51 316 -+++ trunk/src/pcre2_ucd.c 2017/02/24 18:25:32 670 -@@ -41,6 +41,20 @@ - - const char *PRIV(unicode_version) = "8.0.0"; - -+/* If the 32-bit library is run in non-32-bit mode, character values -+greater than 0x10ffff may be encountered. For these we set up a -+special record. */ -+ -+#if PCRE2_CODE_UNIT_WIDTH == 32 -+const ucd_record PRIV(dummy_ucd_record)[] = {{ -+ ucp_Common, /* script */ -+ ucp_Cn, /* type unassigned */ -+ ucp_gbOther, /* grapheme break property */ -+ 0, /* case set */ -+ 0, /* other case */ -+ }}; -+#endif -+ - /* When recompiling tables with a new Unicode version, please check the - types in this structure definition from pcre2_internal.h (the actual - field names will be different): diff --git a/gnu/packages/patches/pcre2-CVE-2017-8786.patch b/gnu/packages/patches/pcre2-CVE-2017-8786.patch deleted file mode 100644 index 6071d58f07..0000000000 --- a/gnu/packages/patches/pcre2-CVE-2017-8786.patch +++ /dev/null @@ -1,155 +0,0 @@ -Fix CVE-2017-8786: - -https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-8786 -https://bugs.exim.org/show_bug.cgi?id=2079 -https://blogs.gentoo.org/ago/2017/04/29/libpcre-heap-based-buffer-overflow-write-in-pcre2test-c/ - -Patch copied from upstream source repository: - -https://vcs.pcre.org/pcre2?view=revision&revision=696 -https://vcs.pcre.org/pcre2?view=revision&revision=697 - ---- trunk/doc/pcre2api.3 2017/03/21 16:48:40 695 -+++ trunk/doc/pcre2api.3 2017/03/21 17:46:21 696 -@@ -1,4 +1,4 @@ --.TH PCRE2API 3 "24 December 2016" "PCRE2 10.23" -+.TH PCRE2API 3 "21 March 2017" "PCRE2 10.30" - .SH NAME - PCRE2 - Perl-compatible regular expressions (revised API) - .sp -@@ -2633,8 +2633,8 @@ - A text message for an error code from any PCRE2 function (compile, match, or - auxiliary) can be obtained by calling \fBpcre2_get_error_message()\fP. The code - is passed as the first argument, with the remaining two arguments specifying a --code unit buffer and its length, into which the text message is placed. Note --that the message is returned in code units of the appropriate width for the -+code unit buffer and its length in code units, into which the text message is -+placed. The message is returned in code units of the appropriate width for the - library that is being used. - .P - The returned message is terminated with a trailing zero, and the function -@@ -3321,6 +3321,6 @@ - .rs - .sp - .nf --Last updated: 23 December 2016 --Copyright (c) 1997-2016 University of Cambridge. -+Last updated: 21 March 2017 -+Copyright (c) 1997-2017 University of Cambridge. - .fi ---- trunk/src/pcre2_error.c 2017/03/21 16:48:40 695 -+++ trunk/src/pcre2_error.c 2017/03/21 17:46:21 696 -@@ -271,7 +271,7 @@ - Arguments: - enumber error number - buffer where to put the message (zero terminated) -- size size of the buffer -+ size size of the buffer in code units - - Returns: length of message if all is well - negative on error ---- trunk/src/pcre2test.c 2017/03/21 17:46:21 696 -+++ trunk/src/pcre2test.c 2017/03/21 18:36:13 697 -@@ -1017,9 +1017,9 @@ - if (test_mode == PCRE8_MODE) \ - r = pcre2_get_error_message_8(a,G(b,8),G(G(b,8),_size)); \ - else if (test_mode == PCRE16_MODE) \ -- r = pcre2_get_error_message_16(a,G(b,16),G(G(b,16),_size)); \ -+ r = pcre2_get_error_message_16(a,G(b,16),G(G(b,16),_size/2)); \ - else \ -- r = pcre2_get_error_message_32(a,G(b,32),G(G(b,32),_size)) -+ r = pcre2_get_error_message_32(a,G(b,32),G(G(b,32),_size/4)) - - #define PCRE2_GET_OVECTOR_COUNT(a,b) \ - if (test_mode == PCRE8_MODE) \ -@@ -1399,6 +1399,9 @@ - - /* ----- Common macros for two-mode cases ----- */ - -+#define BYTEONE (BITONE/8) -+#define BYTETWO (BITTWO/8) -+ - #define CASTFLD(t,a,b) \ - ((test_mode == G(G(PCRE,BITONE),_MODE))? (t)(G(a,BITONE)->b) : \ - (t)(G(a,BITTWO)->b)) -@@ -1481,9 +1484,9 @@ - - #define PCRE2_GET_ERROR_MESSAGE(r,a,b) \ - if (test_mode == G(G(PCRE,BITONE),_MODE)) \ -- r = G(pcre2_get_error_message_,BITONE)(a,G(b,BITONE),G(G(b,BITONE),_size)); \ -+ r = G(pcre2_get_error_message_,BITONE)(a,G(b,BITONE),G(G(b,BITONE),_size/BYTEONE)); \ - else \ -- r = G(pcre2_get_error_message_,BITTWO)(a,G(b,BITTWO),G(G(b,BITTWO),_size)) -+ r = G(pcre2_get_error_message_,BITTWO)(a,G(b,BITTWO),G(G(b,BITTWO),_size/BYTETWO)) - - #define PCRE2_GET_OVECTOR_COUNT(a,b) \ - if (test_mode == G(G(PCRE,BITONE),_MODE)) \ -@@ -1904,7 +1907,7 @@ - #define PCRE2_DFA_MATCH(a,b,c,d,e,f,g,h,i,j) \ - a = pcre2_dfa_match_16(G(b,16),(PCRE2_SPTR16)c,d,e,f,G(g,16),h,i,j) - #define PCRE2_GET_ERROR_MESSAGE(r,a,b) \ -- r = pcre2_get_error_message_16(a,G(b,16),G(G(b,16),_size)) -+ r = pcre2_get_error_message_16(a,G(b,16),G(G(b,16),_size/2)) - #define PCRE2_GET_OVECTOR_COUNT(a,b) a = pcre2_get_ovector_count_16(G(b,16)) - #define PCRE2_GET_STARTCHAR(a,b) a = pcre2_get_startchar_16(G(b,16)) - #define PCRE2_JIT_COMPILE(r,a,b) r = pcre2_jit_compile_16(G(a,16),b) -@@ -2000,7 +2003,7 @@ - #define PCRE2_DFA_MATCH(a,b,c,d,e,f,g,h,i,j) \ - a = pcre2_dfa_match_32(G(b,32),(PCRE2_SPTR32)c,d,e,f,G(g,32),h,i,j) - #define PCRE2_GET_ERROR_MESSAGE(r,a,b) \ -- r = pcre2_get_error_message_32(a,G(b,32),G(G(b,32),_size)) -+ r = pcre2_get_error_message_32(a,G(b,32),G(G(b,32),_size/4)) - #define PCRE2_GET_OVECTOR_COUNT(a,b) a = pcre2_get_ovector_count_32(G(b,32)) - #define PCRE2_GET_STARTCHAR(a,b) a = pcre2_get_startchar_32(G(b,32)) - #define PCRE2_JIT_COMPILE(r,a,b) r = pcre2_jit_compile_32(G(a,32),b) ---- trunk/src/pcre2test.c 2017/03/21 16:48:40 695 -+++ trunk/src/pcre2test.c 2017/03/21 17:46:21 696 -@@ -2889,7 +2889,7 @@ - { - if (pbuffer32 != NULL) free(pbuffer32); - pbuffer32_size = 4*len + 4; -- if (pbuffer32_size < 256) pbuffer32_size = 256; -+ if (pbuffer32_size < 512) pbuffer32_size = 512; - pbuffer32 = (uint32_t *)malloc(pbuffer32_size); - if (pbuffer32 == NULL) - { -@@ -7600,7 +7600,8 @@ - int errcode; - char *endptr; - --/* Ensure the relevant non-8-bit buffer is available. */ -+/* Ensure the relevant non-8-bit buffer is available. Ensure that it is at -+least 128 code units, because it is used for retrieving error messages. */ - - #ifdef SUPPORT_PCRE2_16 - if (test_mode == PCRE16_MODE) -@@ -7620,7 +7621,7 @@ - #ifdef SUPPORT_PCRE2_32 - if (test_mode == PCRE32_MODE) - { -- pbuffer32_size = 256; -+ pbuffer32_size = 512; - pbuffer32 = (uint32_t *)malloc(pbuffer32_size); - if (pbuffer32 == NULL) - { ---- trunk/testdata/testinput2 2017/03/21 16:48:40 695 -+++ trunk/testdata/testinput2 2017/03/21 17:46:21 696 -@@ -5017,4 +5017,6 @@ - - /(?<!\1((?U)1((?U))))(*F)/never_backslash_c,alt_bsux,anchored,extended - -+/\g{3/ -+ - # End of testinput2 ---- trunk/testdata/testoutput2 2017/03/21 16:48:40 695 -+++ trunk/testdata/testoutput2 2017/03/21 17:46:21 696 -@@ -15570,6 +15570,9 @@ - - /(?<!\1((?U)1((?U))))(*F)/never_backslash_c,alt_bsux,anchored,extended - -+/\g{3/ -+Failed: error 157 at offset 2: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number -+ - # End of testinput2 - Error -63: PCRE2_ERROR_BADDATA (unknown error number) - Error -62: bad serialized data diff --git a/gnu/packages/patches/python-3-search-paths.patch b/gnu/packages/patches/python-3-search-paths.patch index 7feddb8e30..73e3f4ccf5 100644 --- a/gnu/packages/patches/python-3-search-paths.patch +++ b/gnu/packages/patches/python-3-search-paths.patch @@ -3,17 +3,14 @@ looking for headers and libraries. --- setup.py 2015-10-07 23:32:58.891329173 +0200 +++ setup.py 2015-10-07 23:46:29.653349924 +0200 -@@ -507,11 +507,8 @@ class PyBuildExt(build_ext): +@@ -575,8 +575,8 @@ # if a file is found in one of those directories, it can # be assumed that no additional -I,-L directives are needed. if not cross_compiling: -- lib_dirs = self.compiler.library_dirs + [ -- '/lib64', '/usr/lib64', -- '/lib', '/usr/lib', -- ] -- inc_dirs = self.compiler.include_dirs + ['/usr/include'] +- lib_dirs = self.compiler.library_dirs + system_lib_dirs +- inc_dirs = self.compiler.include_dirs + system_include_dirs + lib_dirs = os.getenv('LIBRARY_PATH', '').split(os.pathsep) + inc_dirs = os.getenv('C_INCLUDE_PATH', '').split(os.pathsep) else: - lib_dirs = self.compiler.library_dirs[:] - inc_dirs = self.compiler.include_dirs[:] + # Add the sysroot paths. 'sysroot' is a compiler option used to + # set the logical path of the standard system headers and diff --git a/gnu/packages/patches/tar-CVE-2016-6321.patch b/gnu/packages/patches/tar-CVE-2016-6321.patch deleted file mode 100644 index b79be9bc94..0000000000 --- a/gnu/packages/patches/tar-CVE-2016-6321.patch +++ /dev/null @@ -1,51 +0,0 @@ -Fix CVE-2016-6321: - -https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-6321 -https://security-tracker.debian.org/tracker/CVE-2016-6321 - -Patch adapted from upstream source repository (the changes to 'NEWS' -don't apply to the Tar 1.29 release tarball). - -http://git.savannah.gnu.org/cgit/tar.git/commit/?id=7340f67b9860ea0531c1450e5aa261c50f67165d - -From 7340f67b9860ea0531c1450e5aa261c50f67165d Mon Sep 17 00:00:00 2001 -From: Paul Eggert <eggert@Penguin.CS.UCLA.EDU> -Date: Sat, 29 Oct 2016 21:04:40 -0700 -Subject: [PATCH] When extracting, skip ".." members - -* NEWS: Document this. -* src/extract.c (extract_archive): Skip members whose names -contain "..". ---- - NEWS | 8 +++++++- - src/extract.c | 8 ++++++++ - 2 files changed, 15 insertions(+), 1 deletion(-) - -diff --git a/src/extract.c b/src/extract.c -index f982433..7904148 100644 ---- a/src/extract.c -+++ b/src/extract.c -@@ -1629,12 +1629,20 @@ extract_archive (void) - { - char typeflag; - tar_extractor_t fun; -+ bool skip_dotdot_name; - - fatal_exit_hook = extract_finish; - - set_next_block_after (current_header); - -+ skip_dotdot_name = (!absolute_names_option -+ && contains_dot_dot (current_stat_info.orig_file_name)); -+ if (skip_dotdot_name) -+ ERROR ((0, 0, _("%s: Member name contains '..'"), -+ quotearg_colon (current_stat_info.orig_file_name))); -+ - if (!current_stat_info.file_name[0] -+ || skip_dotdot_name - || (interactive_option - && !confirm ("extract", current_stat_info.file_name))) - { --- -2.11.0 - diff --git a/gnu/packages/patches/tar-remove-wholesparse-check.patch b/gnu/packages/patches/tar-remove-wholesparse-check.patch new file mode 100644 index 0000000000..41f53e86aa --- /dev/null +++ b/gnu/packages/patches/tar-remove-wholesparse-check.patch @@ -0,0 +1,68 @@ +This patch is needed in order to build Guix on a Btrfs file system. + + +From da922703282b0d3b8837a99a9c7fdd32f1d20d49 Mon Sep 17 00:00:00 2001 +From: Mark H Weaver <mhw@netris.org> +Date: Tue, 9 Jan 2018 20:16:14 -0500 +Subject: [PATCH] Remove nonportable check for files containing only zeroes. + +This check benefitted only one unlikely case (large files containing +only zeroes, on systems that do not support SEEK_HOLE) and was based +on an assumption about file system behavior that is not mandated by +POSIX and no longer holds in practice, namely that for sufficiently +large files, (st_blocks == 0) implies that the file contains only +zeroes. Examples of file systems that violate this assumption include +Linux's /proc file system and Btrfs. + +* src/sparse.c (sparse_scan_file_wholesparse): Remove this function. +(sparse_scan_file_seek): Remove the initial check for files containing +only zeroes. +--- + src/sparse.c | 24 ------------------------ + 1 file changed, 24 deletions(-) + +diff --git a/src/sparse.c b/src/sparse.c +index d41c0ea..3de6560 100644 +--- a/src/sparse.c ++++ b/src/sparse.c +@@ -261,26 +261,6 @@ sparse_scan_file_raw (struct tar_sparse_file *file) + return tar_sparse_scan (file, scan_end, NULL); + } + +-static bool +-sparse_scan_file_wholesparse (struct tar_sparse_file *file) +-{ +- struct tar_stat_info *st = file->stat_info; +- struct sp_array sp = {0, 0}; +- +- /* Note that this function is called only for truly sparse files of size >= 1 +- block size (checked via ST_IS_SPARSE before). See the thread +- http://www.mail-archive.com/bug-tar@gnu.org/msg04209.html for more info */ +- if (ST_NBLOCKS (st->stat) == 0) +- { +- st->archive_file_size = 0; +- sp.offset = st->stat.st_size; +- sparse_add_map (st, &sp); +- return true; +- } +- +- return false; +-} +- + #ifdef SEEK_HOLE + /* Try to engage SEEK_HOLE/SEEK_DATA feature. */ + static bool +@@ -343,10 +323,6 @@ sparse_scan_file_seek (struct tar_sparse_file *file) + static bool + sparse_scan_file (struct tar_sparse_file *file) + { +- /* always check for completely sparse files */ +- if (sparse_scan_file_wholesparse (file)) +- return true; +- + switch (hole_detection) + { + case HOLE_DETECTION_DEFAULT: +-- +2.15.1 + diff --git a/gnu/packages/patches/xcb-proto-python3-print.patch b/gnu/packages/patches/xcb-proto-python3-print.patch deleted file mode 100644 index 7d5dc9bc27..0000000000 --- a/gnu/packages/patches/xcb-proto-python3-print.patch +++ /dev/null @@ -1,75 +0,0 @@ -Patch copied from upstream source repository: - -https://cgit.freedesktop.org/xcb/proto/commit/?id=bea5e1c85bdc0950913790364e18228f20395a3d - -From bea5e1c85bdc0950913790364e18228f20395a3d Mon Sep 17 00:00:00 2001 -From: Thomas Klausner <wiz@NetBSD.org> -Date: Thu, 19 May 2016 17:30:05 +0200 -Subject: [PATCH] print() is a function and needs parentheses. - -Fixes build with python-3.x. - -Signed-off-by: Thomas Klausner <wiz@NetBSD.org> -Signed-off-by: Uli Schlachter <psychon@znc.in> ---- - xcbgen/xtypes.py | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - -diff --git a/xcbgen/xtypes.py b/xcbgen/xtypes.py -index c3b5758..b83b119 100644 ---- a/xcbgen/xtypes.py -+++ b/xcbgen/xtypes.py -@@ -501,7 +501,7 @@ class ComplexType(Type): - int(required_start_align_element.get('align', "4"), 0), - int(required_start_align_element.get('offset', "0"), 0)) - if verbose_align_log: -- print "Explicit start-align for %s: %s\n" % (self, self.required_start_align) -+ print ("Explicit start-align for %s: %s\n" % (self, self.required_start_align)) - - def resolve(self, module): - if self.resolved: -@@ -592,7 +592,7 @@ class ComplexType(Type): - if verbose_align_log: - print ("calc_required_start_align: %s has start-align %s" - % (str(self), str(self.required_start_align))) -- print "Details:\n" + str(log) -+ print ("Details:\n" + str(log)) - if self.required_start_align.offset != 0: - print (("WARNING: %s\n\thas start-align with non-zero offset: %s" - + "\n\tsuggest to add explicit definition with:" -@@ -619,12 +619,12 @@ class ComplexType(Type): - for offset in range(0,align): - align_candidate = Alignment(align, offset) - if verbose_align_log: -- print "trying %s for %s" % (str(align_candidate), str(self)) -+ print ("trying %s for %s" % (str(align_candidate), str(self))) - my_log = AlignmentLog() - if self.is_possible_start_align(align_candidate, callstack, my_log): - log.append(my_log) - if verbose_align_log: -- print "found start-align %s for %s" % (str(align_candidate), str(self)) -+ print ("found start-align %s for %s" % (str(align_candidate), str(self))) - return align_candidate - else: - my_ok_count = my_log.ok_count() -@@ -641,7 +641,7 @@ class ComplexType(Type): - # none of the candidates applies - # this type has illegal internal aligns for all possible start_aligns - if verbose_align_log: -- print "didn't find start-align for %s" % str(self) -+ print ("didn't find start-align for %s" % str(self)) - log.append(best_log) - return None - -@@ -900,7 +900,7 @@ class SwitchType(ComplexType): - # aux function for unchecked_get_alignment_after - def get_align_for_selected_case_field(self, case_field, start_align, callstack, log): - if verbose_align_log: -- print "get_align_for_selected_case_field: %s, case_field = %s" % (str(self), str(case_field)) -+ print ("get_align_for_selected_case_field: %s, case_field = %s" % (str(self), str(case_field))) - total_align = start_align - for field in self.bitcases: - my_callstack = callstack[:] --- -2.11.1 - diff --git a/gnu/packages/patches/xcb-proto-python3-whitespace.patch b/gnu/packages/patches/xcb-proto-python3-whitespace.patch deleted file mode 100644 index f0509138b2..0000000000 --- a/gnu/packages/patches/xcb-proto-python3-whitespace.patch +++ /dev/null @@ -1,217 +0,0 @@ -Fixes compatibility issue with python > 3.5. - -Patch copied from upstream source repository: - -https://cgit.freedesktop.org/xcb/proto/commit/?id=ea7a3ac6c658164690e0febb55f4467cb9e0bcac - -From ea7a3ac6c658164690e0febb55f4467cb9e0bcac Mon Sep 17 00:00:00 2001 -From: Thomas Klausner <wiz@NetBSD.org> -Date: Thu, 19 May 2016 17:30:04 +0200 -Subject: [PATCH] Make whitespace use consistent. - -At least python-3.5.x complains about this forcefully. - -Signed-off-by: Thomas Klausner <wiz@NetBSD.org> -Signed-off-by: Uli Schlachter <psychon@znc.in> ---- - xcbgen/align.py | 96 ++++++++++++++++++++++++++++----------------------------- - 1 file changed, 48 insertions(+), 48 deletions(-) - -diff --git a/xcbgen/align.py b/xcbgen/align.py -index 5e31838..d4c12ee 100644 ---- a/xcbgen/align.py -+++ b/xcbgen/align.py -@@ -16,12 +16,12 @@ class Alignment(object): - return self.align == other.align and self.offset == other.offset - - def __str__(self): -- return "(align=%d, offset=%d)" % (self.align, self.offset) -+ return "(align=%d, offset=%d)" % (self.align, self.offset) - - @staticmethod - def for_primitive_type(size): -- # compute the required start_alignment based on the size of the type -- if size % 8 == 0: -+ # compute the required start_alignment based on the size of the type -+ if size % 8 == 0: - # do 8-byte primitives require 8-byte alignment in X11? - return Alignment(8,0) - elif size % 4 == 0: -@@ -33,7 +33,7 @@ class Alignment(object): - - - def align_after_fixed_size(self, size): -- new_offset = (self.offset + size) % self.align -+ new_offset = (self.offset + size) % self.align - return Alignment(self.align, new_offset) - - -@@ -41,7 +41,7 @@ class Alignment(object): - ''' - Assuming the given external_align, checks whether - self is fulfilled for all cases. -- Returns True if yes, False otherwise. -+ Returns True if yes, False otherwise. - ''' - if self.align == 1 and self.offset == 0: - # alignment 1 with offset 0 is always fulfilled -@@ -55,9 +55,9 @@ class Alignment(object): - # the external align guarantees less alignment -> not guaranteed - return False - -- if external_align.align % self.align != 0: -+ if external_align.align % self.align != 0: - # the external align cannot be divided by our align -- # -> not guaranteed -+ # -> not guaranteed - # (this can only happen if there are alignments that are not - # a power of 2, which is highly discouraged. But better be - # safe and check for it) -@@ -72,7 +72,7 @@ class Alignment(object): - - def combine_with(self, other): - # returns the alignment that is guaranteed when -- # both, self or other, can happen -+ # both, self or other, can happen - new_align = gcd(self.align, other.align) - new_offset_candidate1 = self.offset % new_align - new_offset_candidate2 = other.offset % new_align -@@ -83,8 +83,8 @@ class Alignment(object): - new_align = gcd(new_align, offset_diff) - new_offset_candidate1 = self.offset % new_align - new_offset_candidate2 = other.offset % new_align -- assert new_offset_candidate1 == new_offset_candidate2 -- new_offset = new_offset_candidate1 -+ assert new_offset_candidate1 == new_offset_candidate2 -+ new_offset = new_offset_candidate1 - # return the result - return Alignment(new_align, new_offset) - -@@ -92,44 +92,44 @@ class Alignment(object): - class AlignmentLog(object): - - def __init__(self): -- self.ok_list = [] -- self.fail_list = [] -- self.verbosity = 1 -+ self.ok_list = [] -+ self.fail_list = [] -+ self.verbosity = 1 - - def __str__(self): -- result = "" -+ result = "" - -- # output the OK-list -- for (align_before, field_name, type_obj, callstack, align_after) in self.ok_list: -- stacksize = len(callstack) -+ # output the OK-list -+ for (align_before, field_name, type_obj, callstack, align_after) in self.ok_list: -+ stacksize = len(callstack) - indent = ' ' * stacksize -- if self.ok_callstack_is_relevant(callstack): -+ if self.ok_callstack_is_relevant(callstack): - if field_name is None or field_name == "": -- result += (" %sok: %s:\n\t%sbefore: %s, after: %s\n" -- % (indent, str(type_obj), indent, str(align_before), str(align_after))) -- else: -- result += (" %sok: field \"%s\" in %s:\n\t%sbefore: %s, after: %s\n" -- % (indent, str(field_name), str(type_obj), -- indent, str(align_before), str(align_after))) -+ result += (" %sok: %s:\n\t%sbefore: %s, after: %s\n" -+ % (indent, str(type_obj), indent, str(align_before), str(align_after))) -+ else: -+ result += (" %sok: field \"%s\" in %s:\n\t%sbefore: %s, after: %s\n" -+ % (indent, str(field_name), str(type_obj), -+ indent, str(align_before), str(align_after))) - if self.verbosity >= 1: -- result += self.callstack_to_str(indent, callstack) -+ result += self.callstack_to_str(indent, callstack) - -- # output the fail-list -- for (align_before, field_name, type_obj, callstack, reason) in self.fail_list: -- stacksize = len(callstack) -+ # output the fail-list -+ for (align_before, field_name, type_obj, callstack, reason) in self.fail_list: -+ stacksize = len(callstack) - indent = ' ' * stacksize -- if field_name is None or field_name == "": -- result += (" %sfail: align %s is incompatible with\n\t%s%s\n\t%sReason: %s\n" -- % (indent, str(align_before), indent, str(type_obj), indent, reason)) -- else: -- result += (" %sfail: align %s is incompatible with\n\t%sfield \"%s\" in %s\n\t%sReason: %s\n" -- % (indent, str(align_before), indent, str(field_name), str(type_obj), indent, reason)) -+ if field_name is None or field_name == "": -+ result += (" %sfail: align %s is incompatible with\n\t%s%s\n\t%sReason: %s\n" -+ % (indent, str(align_before), indent, str(type_obj), indent, reason)) -+ else: -+ result += (" %sfail: align %s is incompatible with\n\t%sfield \"%s\" in %s\n\t%sReason: %s\n" -+ % (indent, str(align_before), indent, str(field_name), str(type_obj), indent, reason)) - - if self.verbosity >= 1: -- result += self.callstack_to_str(indent, callstack) -+ result += self.callstack_to_str(indent, callstack) - - -- return result -+ return result - - - def callstack_to_str(self, indent, callstack): -@@ -137,41 +137,41 @@ class AlignmentLog(object): - for stack_elem in callstack: - result += "\t %s%s\n" % (indent, str(stack_elem)) - result += "\t%s]\n" % indent -- return result -+ return result - - - def ok_callstack_is_relevant(self, ok_callstack): - # determine whether an ok callstack is relevant for logging -- if self.verbosity >= 2: -- return True -+ if self.verbosity >= 2: -+ return True - - # empty callstacks are always relevant -- if len(ok_callstack) == 0: -+ if len(ok_callstack) == 0: - return True - -- # check whether the ok_callstack is a subset or equal to a fail_callstack -+ # check whether the ok_callstack is a subset or equal to a fail_callstack - for (align_before, field_name, type_obj, fail_callstack, reason) in self.fail_list: - if len(ok_callstack) <= len(fail_callstack): - zipped = zip(ok_callstack, fail_callstack[:len(ok_callstack)]) -- is_subset = all([i == j for i, j in zipped]) -- if is_subset: -+ is_subset = all([i == j for i, j in zipped]) -+ if is_subset: - return True - - return False - - - def ok(self, align_before, field_name, type_obj, callstack, align_after): -- self.ok_list.append((align_before, field_name, type_obj, callstack, align_after)) -+ self.ok_list.append((align_before, field_name, type_obj, callstack, align_after)) - - def fail(self, align_before, field_name, type_obj, callstack, reason): -- self.fail_list.append((align_before, field_name, type_obj, callstack, reason)) -+ self.fail_list.append((align_before, field_name, type_obj, callstack, reason)) - - def append(self, other): -- self.ok_list.extend(other.ok_list) -- self.fail_list.extend(other.fail_list) -+ self.ok_list.extend(other.ok_list) -+ self.fail_list.extend(other.fail_list) - - def ok_count(self): -- return len(self.ok_list) -+ return len(self.ok_list) - - - --- -2.11.1 - |