From 54d950468607e11eeaca40329f2ea948b1cd8e79 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Fri, 28 Sep 2018 23:43:54 -0500 Subject: [PATCH 1/4] osinfo-db: 20180903 -> 20180920 --- pkgs/data/misc/osinfo-db/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/data/misc/osinfo-db/default.nix b/pkgs/data/misc/osinfo-db/default.nix index 93ee6d38c7c..0a5f7b31306 100644 --- a/pkgs/data/misc/osinfo-db/default.nix +++ b/pkgs/data/misc/osinfo-db/default.nix @@ -1,11 +1,11 @@ { stdenv, fetchurl, osinfo-db-tools, intltool, libxml2 }: stdenv.mkDerivation rec { - name = "osinfo-db-20180903"; + name = "osinfo-db-20180920"; src = fetchurl { url = "https://releases.pagure.org/libosinfo/${name}.tar.xz"; - sha256 = "0xkxqyn2b03d4rd91f5rw3xar5vnv2n8l5pp8sm3hqm1wm5z5my9"; + sha256 = "19jbzf1g523bkckli043q21hgbfv0043b5ib4zjiz8x98h7ngiac"; }; nativeBuildInputs = [ osinfo-db-tools intltool libxml2 ]; From 4bc001e41bdb8ee53e70d4676e140cc11675229c Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Fri, 28 Sep 2018 23:44:27 -0500 Subject: [PATCH 2/4] libosinfo: 1.1.0 -> 1.2.0 --- pkgs/development/libraries/libosinfo/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/libosinfo/default.nix b/pkgs/development/libraries/libosinfo/default.nix index 111bea61eb6..d77a691ba4b 100644 --- a/pkgs/development/libraries/libosinfo/default.nix +++ b/pkgs/development/libraries/libosinfo/default.nix @@ -3,11 +3,11 @@ }: stdenv.mkDerivation rec { - name = "libosinfo-1.1.0"; + name = "libosinfo-1.2.0"; src = fetchurl { url = "https://releases.pagure.org/libosinfo/${name}.tar.gz"; - sha256 = "0diigllgni6m0sc2h8aid6hmyaq9qb54pm5305m0irfsm2j463v0"; + sha256 = "0y2skfrcg38y212qqd26vs3sg566j3qnsgvvm23pfi4j7z7ly9gf"; }; outputs = [ "out" "dev" "devdoc" ]; From dacdf8b6c7a8250aa763a471a2c6c8948ab3529e Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Sat, 29 Sep 2018 00:04:25 -0500 Subject: [PATCH 3/4] libosinfo: pick upstream patches to fix bug causing test failure --- ...pand-the-arch-s-parser-for-isodetect.patch | 40 +++++++++++++++++++ ...nchored-patterns-when-matching-regex.patch | 34 ++++++++++++++++ .../libraries/libosinfo/default.nix | 2 + 3 files changed, 76 insertions(+) create mode 100644 pkgs/development/libraries/libosinfo/0001-tests-Expand-the-arch-s-parser-for-isodetect.patch create mode 100644 pkgs/development/libraries/libosinfo/0002-db-Force-anchored-patterns-when-matching-regex.patch diff --git a/pkgs/development/libraries/libosinfo/0001-tests-Expand-the-arch-s-parser-for-isodetect.patch b/pkgs/development/libraries/libosinfo/0001-tests-Expand-the-arch-s-parser-for-isodetect.patch new file mode 100644 index 00000000000..7dcbb75df39 --- /dev/null +++ b/pkgs/development/libraries/libosinfo/0001-tests-Expand-the-arch-s-parser-for-isodetect.patch @@ -0,0 +1,40 @@ +From b9cb227842948b1b2289cdd3e9b8d925664c2ee7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= +Date: Fri, 7 Sep 2018 15:04:20 +0200 +Subject: [PATCH 1/2] tests: Expand the arch's parser for isodetect +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Some Windows ISOs isodata, as the ones added as part of commit 857f503, +uses X64 and X86 and load_iso() didn't take those into consideration. + +Signed-off-by: Fabiano Fidêncio +Reviewed-by: Cole Robinson +--- + tests/test-isodetect.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/tests/test-isodetect.c b/tests/test-isodetect.c +index 415770b..76f0c5a 100644 +--- a/tests/test-isodetect.c ++++ b/tests/test-isodetect.c +@@ -106,6 +106,7 @@ static struct ISOInfo *load_iso(GFile *file, const gchar *shortid, const gchar * + info->langs = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); + if (strstr(name, "amd64") || + strstr(name, "x64") || ++ strstr(name, "X64") || + strstr(name, "x86_64") || + strstr(name, "64bit") || + strstr(name, "64-bit")) +@@ -114,6 +115,7 @@ static struct ISOInfo *load_iso(GFile *file, const gchar *shortid, const gchar * + strstr(name, "i586") || + strstr(name, "i686") || + strstr(name, "x86") || ++ strstr(name, "X86") || + strstr(name, "32bit") || + strstr(name, "32-bit")) + arch = "i386"; +-- +2.19.0 + diff --git a/pkgs/development/libraries/libosinfo/0002-db-Force-anchored-patterns-when-matching-regex.patch b/pkgs/development/libraries/libosinfo/0002-db-Force-anchored-patterns-when-matching-regex.patch new file mode 100644 index 00000000000..b47c93f3d39 --- /dev/null +++ b/pkgs/development/libraries/libosinfo/0002-db-Force-anchored-patterns-when-matching-regex.patch @@ -0,0 +1,34 @@ +From e6168463f4fc659b9827b5c8694dc1c6d7d5239a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= +Date: Fri, 7 Sep 2018 15:53:20 +0200 +Subject: [PATCH 2/2] db: Force anchored patterns when matching regex +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Without forcing anchored patterns some matches may be completely wrong +as "(J_)?CENN?A_X64FREV" (volume-id for Windows 10) that could be taken +as a match for "HRM_CENNA_X64FREV" (volume-id of a Windows 8 ISO). + +Signed-off-by: Fabiano Fidêncio +Reviewed-by: Cole Robinson +--- + osinfo/osinfo_db.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/osinfo/osinfo_db.c b/osinfo/osinfo_db.c +index fa14c6d..f4b3a8c 100644 +--- a/osinfo/osinfo_db.c ++++ b/osinfo/osinfo_db.c +@@ -37,7 +37,7 @@ G_DEFINE_TYPE(OsinfoDb, osinfo_db, G_TYPE_OBJECT); + #define match_regex(pattern, str) \ + (((pattern) == NULL) || \ + (((str) != NULL) && \ +- g_regex_match_simple((pattern), (str), 0, 0))) ++ g_regex_match_simple((pattern), (str), 0, G_REGEX_MATCH_ANCHORED))) + + static gchar *get_raw_lang(const char *volume_id, const gchar *regex_str) + { +-- +2.19.0 + diff --git a/pkgs/development/libraries/libosinfo/default.nix b/pkgs/development/libraries/libosinfo/default.nix index d77a691ba4b..3a3dc6952a6 100644 --- a/pkgs/development/libraries/libosinfo/default.nix +++ b/pkgs/development/libraries/libosinfo/default.nix @@ -20,6 +20,8 @@ stdenv.mkDerivation rec { patches = [ ./osinfo-db-data-dir.patch + ./0001-tests-Expand-the-arch-s-parser-for-isodetect.patch + ./0002-db-Force-anchored-patterns-when-matching-regex.patch ]; postPatch = '' From 6058b979ab92f3e3d35ac6ed6a54dfcd85e83460 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Sun, 30 Sep 2018 00:23:59 -0500 Subject: [PATCH 4/4] libosinfo: externalize patches, fetch w/fetchpatch --- ...pand-the-arch-s-parser-for-isodetect.patch | 40 ------------------- ...nchored-patterns-when-matching-regex.patch | 34 ---------------- .../libraries/libosinfo/default.nix | 14 +++++-- 3 files changed, 11 insertions(+), 77 deletions(-) delete mode 100644 pkgs/development/libraries/libosinfo/0001-tests-Expand-the-arch-s-parser-for-isodetect.patch delete mode 100644 pkgs/development/libraries/libosinfo/0002-db-Force-anchored-patterns-when-matching-regex.patch diff --git a/pkgs/development/libraries/libosinfo/0001-tests-Expand-the-arch-s-parser-for-isodetect.patch b/pkgs/development/libraries/libosinfo/0001-tests-Expand-the-arch-s-parser-for-isodetect.patch deleted file mode 100644 index 7dcbb75df39..00000000000 --- a/pkgs/development/libraries/libosinfo/0001-tests-Expand-the-arch-s-parser-for-isodetect.patch +++ /dev/null @@ -1,40 +0,0 @@ -From b9cb227842948b1b2289cdd3e9b8d925664c2ee7 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= -Date: Fri, 7 Sep 2018 15:04:20 +0200 -Subject: [PATCH 1/2] tests: Expand the arch's parser for isodetect -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Some Windows ISOs isodata, as the ones added as part of commit 857f503, -uses X64 and X86 and load_iso() didn't take those into consideration. - -Signed-off-by: Fabiano Fidêncio -Reviewed-by: Cole Robinson ---- - tests/test-isodetect.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/tests/test-isodetect.c b/tests/test-isodetect.c -index 415770b..76f0c5a 100644 ---- a/tests/test-isodetect.c -+++ b/tests/test-isodetect.c -@@ -106,6 +106,7 @@ static struct ISOInfo *load_iso(GFile *file, const gchar *shortid, const gchar * - info->langs = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); - if (strstr(name, "amd64") || - strstr(name, "x64") || -+ strstr(name, "X64") || - strstr(name, "x86_64") || - strstr(name, "64bit") || - strstr(name, "64-bit")) -@@ -114,6 +115,7 @@ static struct ISOInfo *load_iso(GFile *file, const gchar *shortid, const gchar * - strstr(name, "i586") || - strstr(name, "i686") || - strstr(name, "x86") || -+ strstr(name, "X86") || - strstr(name, "32bit") || - strstr(name, "32-bit")) - arch = "i386"; --- -2.19.0 - diff --git a/pkgs/development/libraries/libosinfo/0002-db-Force-anchored-patterns-when-matching-regex.patch b/pkgs/development/libraries/libosinfo/0002-db-Force-anchored-patterns-when-matching-regex.patch deleted file mode 100644 index b47c93f3d39..00000000000 --- a/pkgs/development/libraries/libosinfo/0002-db-Force-anchored-patterns-when-matching-regex.patch +++ /dev/null @@ -1,34 +0,0 @@ -From e6168463f4fc659b9827b5c8694dc1c6d7d5239a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= -Date: Fri, 7 Sep 2018 15:53:20 +0200 -Subject: [PATCH 2/2] db: Force anchored patterns when matching regex -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Without forcing anchored patterns some matches may be completely wrong -as "(J_)?CENN?A_X64FREV" (volume-id for Windows 10) that could be taken -as a match for "HRM_CENNA_X64FREV" (volume-id of a Windows 8 ISO). - -Signed-off-by: Fabiano Fidêncio -Reviewed-by: Cole Robinson ---- - osinfo/osinfo_db.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/osinfo/osinfo_db.c b/osinfo/osinfo_db.c -index fa14c6d..f4b3a8c 100644 ---- a/osinfo/osinfo_db.c -+++ b/osinfo/osinfo_db.c -@@ -37,7 +37,7 @@ G_DEFINE_TYPE(OsinfoDb, osinfo_db, G_TYPE_OBJECT); - #define match_regex(pattern, str) \ - (((pattern) == NULL) || \ - (((str) != NULL) && \ -- g_regex_match_simple((pattern), (str), 0, 0))) -+ g_regex_match_simple((pattern), (str), 0, G_REGEX_MATCH_ANCHORED))) - - static gchar *get_raw_lang(const char *volume_id, const gchar *regex_str) - { --- -2.19.0 - diff --git a/pkgs/development/libraries/libosinfo/default.nix b/pkgs/development/libraries/libosinfo/default.nix index 3a3dc6952a6..ba267b79787 100644 --- a/pkgs/development/libraries/libosinfo/default.nix +++ b/pkgs/development/libraries/libosinfo/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, pkgconfig, intltool, gobjectIntrospection, gtk-doc, docbook_xsl +{ stdenv, fetchurl, fetchpatch, pkgconfig, intltool, gobjectIntrospection, gtk-doc, docbook_xsl , glib, libsoup, libxml2, libxslt, check, curl, perl, hwdata, osinfo-db, vala ? null }: @@ -20,8 +20,16 @@ stdenv.mkDerivation rec { patches = [ ./osinfo-db-data-dir.patch - ./0001-tests-Expand-the-arch-s-parser-for-isodetect.patch - ./0002-db-Force-anchored-patterns-when-matching-regex.patch + # Fix bug causing tests to fail (and presumably the real scenarios they're representative of) + # using upstream commits: + (fetchpatch { + url = "https://gitlab.com/libosinfo/libosinfo/commit/b9cb227842948b1b2289cdd3e9b8d925664c2ee7.patch"; + sha256 = "0nj0wmibq52j8qbzmxfzj76fpkqjs18kssbb9lmfhz16s30darbw"; + }) + (fetchpatch { + url = "https://gitlab.com/libosinfo/libosinfo/commit/e6168463f4fc659b9827b5c8694dc1c6d7d5239a.patch"; + sha256 = "135yfhjm2wxip5dnng3r9k9igfhdi1083ys4a4f3ipjxfskcs9rv"; + }) ]; postPatch = ''