diff -Nru lshw-02.18.85/debian/changelog lshw-02.18.85/debian/changelog --- lshw-02.18.85/debian/changelog 2020-03-21 13:28:51.000000000 +0100 +++ lshw-02.18.85/debian/changelog 2020-11-02 12:07:29.000000000 +0100 @@ -1,3 +1,31 @@ +lshw (02.18.85-0.5ubuntu1) hirsute; urgency=low + + [ Ubuntu Merge-o-Matic ] + * Merge from Debian unstable. Remaining changes: (LP: #1902515) + - Switch to debhelper-compat (=10) + - Apply & Revert JSON output fix from: + https://ezix.org/src/pkg/lshw/pulls/26 (rejected upstream) + [ Lukas Märdian ] + * Replace d/p/82393aa9b59307a443677df7340a1dd38847a5ef.patch by the two + commits accepted upstream (https://ezix.org/src/pkg/lshw/pulls/28): + 2b1c730b493d647bbab4854713571458e82a81e7.patch + 15565229509455527de9ce7cbb9530e2b31d043b.patch + + -- Lukas Märdian Mon, 02 Nov 2020 12:07:29 +0100 + +lshw (02.18.85-0.5) unstable; urgency=medium + + * Desactivate revert-Fix_JSON_output_format.patch: it's making things worse. + + -- Thomas Goirand Sun, 26 Apr 2020 13:43:52 +0200 + +lshw (02.18.85-0.4) unstable; urgency=medium + + * Switch to debhelper-compat (= 10). + * Add revert-Fix_JSON_output_format.patch (Closes: #929206). + + -- Thomas Goirand Tue, 14 Apr 2020 22:07:20 +0200 + lshw (02.18.85-0.3ubuntu2) focal; urgency=medium * No-change rebuild for libgcc-s1 package name change. @@ -366,3 +394,4 @@ * Initial release, closes: #181106. -- Ola Lundqvist Sat, 15 Feb 2003 13:23:56 +0100 + diff -Nru lshw-02.18.85/debian/compat lshw-02.18.85/debian/compat --- lshw-02.18.85/debian/compat 2019-07-03 11:15:12.000000000 +0200 +++ lshw-02.18.85/debian/compat 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -10 \ Kein Zeilenumbruch am Dateiende. diff -Nru lshw-02.18.85/debian/control lshw-02.18.85/debian/control --- lshw-02.18.85/debian/control 2020-01-30 17:24:24.000000000 +0100 +++ lshw-02.18.85/debian/control 2020-04-26 16:43:36.000000000 +0200 @@ -4,7 +4,7 @@ Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Ghe Rivero Build-Depends: - debhelper (>= 10), + debhelper-compat (= 10), libgtk2.0-dev, libsqlite3-dev, Standards-Version: 3.9.4 diff -Nru lshw-02.18.85/debian/patches/15565229509455527de9ce7cbb9530e2b31d043b.patch lshw-02.18.85/debian/patches/15565229509455527de9ce7cbb9530e2b31d043b.patch --- lshw-02.18.85/debian/patches/15565229509455527de9ce7cbb9530e2b31d043b.patch 1970-01-01 01:00:00.000000000 +0100 +++ lshw-02.18.85/debian/patches/15565229509455527de9ce7cbb9530e2b31d043b.patch 2020-11-02 12:07:29.000000000 +0100 @@ -0,0 +1,59 @@ +From 15565229509455527de9ce7cbb9530e2b31d043b Mon Sep 17 00:00:00 2001 +From: Lyonel Vincent +Date: Wed, 27 May 2020 01:07:16 +0200 +Subject: [PATCH] clean-up JSON output + +--- + src/core/hw.cc | 29 +++++++++++++++++++++++++---- + 1 file changed, 25 insertions(+), 4 deletions(-) + +diff --git a/src/core/hw.cc b/src/core/hw.cc +index ab345fe..6aea7cf 100644 +--- a/src/core/hw.cc ++++ b/src/core/hw.cc +@@ -1650,13 +1650,20 @@ string hwNode::asJSON(unsigned level) + resources.clear(); + } + +- for (unsigned int i = 0; i < countChildren(); i++) ++ if(!::enabled("output:list") && countChildren()>0) + { +- out << getChild(i)->asJSON(visible(getClassName()) ? level + 2 : 1); +- if (visible(getChild(i)->getClassName())) ++ out << "," << endl; ++ out << spaces(2*level+2); ++ out << "\"children\" : ["; ++ for (unsigned int i = 0; i < countChildren(); i++) + { +- out << "," << endl; ++ out << getChild(i)->asJSON(visible(getClassName()) ? level + 2 : 1); ++ if (visible(getChild(i)->getClassName()) && i0) ++ { ++ bool needcomma = visible(getClassName()); ++ for (unsigned int i = 0; i < countChildren(); i++) ++ { ++ string json = getChild(i)->asJSON(visible(getClassName()) ? level + 2 : 1); ++ ++ if(needcomma && strip(json)!="") ++ out << "," << endl; ++ out << getChild(i)->asJSON(visible(getClassName()) ? level + 2 : 1); ++ needcomma |= strip(json)!=""; ++ } ++ } ++ + if (::enabled("output:list") && level == 0) + { + out << endl << "]" << endl; diff -Nru lshw-02.18.85/debian/patches/2b1c730b493d647bbab4854713571458e82a81e7.patch lshw-02.18.85/debian/patches/2b1c730b493d647bbab4854713571458e82a81e7.patch --- lshw-02.18.85/debian/patches/2b1c730b493d647bbab4854713571458e82a81e7.patch 1970-01-01 01:00:00.000000000 +0100 +++ lshw-02.18.85/debian/patches/2b1c730b493d647bbab4854713571458e82a81e7.patch 2020-11-02 12:07:29.000000000 +0100 @@ -0,0 +1,46 @@ +From 2b1c730b493d647bbab4854713571458e82a81e7 Mon Sep 17 00:00:00 2001 +From: Lyonel Vincent +Date: Tue, 26 May 2020 01:00:37 +0200 +Subject: [PATCH] JSON output clean-up (list/object) + +--- + src/core/hw.cc | 5 ++--- + src/lshw.cc | 1 + + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/core/hw.cc b/src/core/hw.cc +index aca424c..ab345fe 100644 +--- a/src/core/hw.cc ++++ b/src/core/hw.cc +@@ -1400,7 +1400,7 @@ string hwNode::asJSON(unsigned level) + config = getConfigKeys(); + resources = getResources("\" value=\""); + +- if (level == 0) ++ if (::enabled("output:list") && level == 0) + { + out << "[" << endl; + } +@@ -1665,9 +1665,8 @@ string hwNode::asJSON(unsigned level) + out << "}"; + } + +- if (level == 0) ++ if (::enabled("output:list") && level == 0) + { +- out.seekp(-2, std::ios_base::end); + out << endl << "]" << endl; + } + +diff --git a/src/lshw.cc b/src/lshw.cc +index 219a008..571b1c3 100644 +--- a/src/lshw.cc ++++ b/src/lshw.cc +@@ -84,6 +84,7 @@ char **argv) + + disable("isapnp"); + ++ disable("output:list"); + disable("output:json"); + disable("output:db"); + disable("output:xml"); diff -Nru lshw-02.18.85/debian/patches/82393aa9b59307a443677df7340a1dd38847a5ef.patch lshw-02.18.85/debian/patches/82393aa9b59307a443677df7340a1dd38847a5ef.patch --- lshw-02.18.85/debian/patches/82393aa9b59307a443677df7340a1dd38847a5ef.patch 2020-01-30 17:24:18.000000000 +0100 +++ lshw-02.18.85/debian/patches/82393aa9b59307a443677df7340a1dd38847a5ef.patch 1970-01-01 01:00:00.000000000 +0100 @@ -1,58 +0,0 @@ -From 82393aa9b59307a443677df7340a1dd38847a5ef Mon Sep 17 00:00:00 2001 -From: Yuan-Chen Cheng -Date: Fri, 25 Oct 2019 11:15:24 -0400 -Subject: [PATCH] correct "JSON output format" without/with all class. - -test pass on my machine. - -Signed-off-by: Yuan-Chen Cheng ---- - src/core/hw.cc | 25 ++++++++++++++++++++----- - 1 file changed, 20 insertions(+), 5 deletions(-) - -diff --git a/src/core/hw.cc b/src/core/hw.cc -index 4522c1a..8232337 100644 ---- a/src/core/hw.cc -+++ b/src/core/hw.cc -@@ -1650,13 +1650,29 @@ string hwNode::asJSON(unsigned level) - resources.clear(); - } - -- for (unsigned int i = 0; i < countChildren(); i++) -+ if(countChildren()>0) - { -- out << getChild(i)->asJSON(visible(getClassName()) ? level + 2 : 1); -- if (visible(getChild(i)->getClassName())) -+ bool childOutputed = false; -+ for (unsigned int i = 0; i < countChildren(); i++) - { -- out << "," << endl; -+ string childJSON = getChild(i)->asJSON(visible(getClassName()) ? level + 2 : 1); -+ string childJSONstrip = strip(childJSON); -+ if (childJSONstrip.length() > 0) -+ { -+ if (!childOutputed) -+ { -+ if(visible(getClassName())) -+ out << "," << endl << spaces(2*level+2) << "\"children\" : [" << endl; -+ } -+ else -+ out << "," << endl; -+ childOutputed = true; -+ out << childJSON; -+ } - } -+ -+ if(visible(getClassName()) && childOutputed) -+ out << endl << spaces(2*level+2) << "]"; - } - - if(visible(getClassName())) -@@ -1667,7 +1683,6 @@ string hwNode::asJSON(unsigned level) - - if (level == 0) - { -- out.seekp(-2, std::ios_base::end); - out << endl << "]" << endl; - } - diff -Nru lshw-02.18.85/debian/patches/revert-Fix_JSON_output_format.patch lshw-02.18.85/debian/patches/revert-Fix_JSON_output_format.patch --- lshw-02.18.85/debian/patches/revert-Fix_JSON_output_format.patch 1970-01-01 01:00:00.000000000 +0100 +++ lshw-02.18.85/debian/patches/revert-Fix_JSON_output_format.patch 2020-04-26 13:43:52.000000000 +0200 @@ -0,0 +1,62 @@ +Description: Revert upstream patch: Fix JSON output format. #28 +Author: Thomas Goirand +Bug-Debian: https://bugs.debian.org/929206 +Forwarded: no +Last-Update: 2020-04-14 + +--- lshw-02.18.85.orig/src/core/hw.cc ++++ lshw-02.18.85/src/core/hw.cc +@@ -1403,14 +1403,9 @@ string hwNode::asJSON(unsigned level) + config = getConfigKeys(); + resources = getResources("\" value=\""); + +- if (level == 0) +- { +- out << "[" << endl; +- } +- + if(visible(getClassName())) + { +- out << spaces(2*level) << "{" << endl; ++ out << "{" << endl; + out << spaces(2*level+2) << "\"id\" : \"" << getId() << "\"," << endl; + out << spaces(2*level+2) << "\"class\" : \"" << getClassName() << "\""; + +@@ -1653,13 +1648,20 @@ string hwNode::asJSON(unsigned level) + resources.clear(); + } + +- for (unsigned int i = 0; i < countChildren(); i++) ++ ++ if(countChildren()>0) + { +- out << getChild(i)->asJSON(visible(getClassName()) ? level + 2 : 1); +- if (visible(getChild(i)->getClassName())) ++ if(visible(getClassName())) ++ out << "," << endl << spaces(2*level+2) << "\"children\" : [" << endl; ++ ++ for (unsigned int i = 0; i < countChildren(); i++) + { +- out << "," << endl; ++ out << spaces(2*level+4) << getChild(i)->asJSON(visible(getClassName()) ? level + 2 : 1); ++ if(visible(getChild(i)->getClassName()) && (i < countChildren()-1)) out << "," << endl; + } ++ ++ if(visible(getClassName())) ++ out << endl << spaces(2*level+2) << "]"; + } + + if(visible(getClassName())) +@@ -1668,12 +1670,6 @@ string hwNode::asJSON(unsigned level) + out << "}"; + } + +- if (level == 0) +- { +- out.seekp(-2, std::ios_base::end); +- out << endl << "]" << endl; +- } +- + return out.str(); + } + diff -Nru lshw-02.18.85/debian/patches/series lshw-02.18.85/debian/patches/series --- lshw-02.18.85/debian/patches/series 2020-01-30 17:24:18.000000000 +0100 +++ lshw-02.18.85/debian/patches/series 2020-11-02 12:07:29.000000000 +0100 @@ -9,4 +9,6 @@ spelling-error.patch add-missing-ethlink-standards.patch cross.patch -82393aa9b59307a443677df7340a1dd38847a5ef.patch +#revert-Fix_JSON_output_format.patch +2b1c730b493d647bbab4854713571458e82a81e7.patch +15565229509455527de9ce7cbb9530e2b31d043b.patch