summaryrefslogtreecommitdiff
path: root/repo/lshw/2b1c730b493d647bbab4854713571458e82a81e7.patch
diff options
context:
space:
mode:
Diffstat (limited to 'repo/lshw/2b1c730b493d647bbab4854713571458e82a81e7.patch')
-rw-r--r--repo/lshw/2b1c730b493d647bbab4854713571458e82a81e7.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/repo/lshw/2b1c730b493d647bbab4854713571458e82a81e7.patch b/repo/lshw/2b1c730b493d647bbab4854713571458e82a81e7.patch
new file mode 100644
index 0000000..57dccb5
--- /dev/null
+++ b/repo/lshw/2b1c730b493d647bbab4854713571458e82a81e7.patch
@@ -0,0 +1,46 @@
+From 2b1c730b493d647bbab4854713571458e82a81e7 Mon Sep 17 00:00:00 2001
+From: Lyonel Vincent <lyonel@ezix.org>
+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");