From 5798f02f861ca399b5bc7a8876a45bdc67e46742e065ed45a9df97683d96e0fe Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Thu, 2 May 2019 09:58:51 +0000 Subject: [PATCH 1/2] - Fix displaying proper logical name of network device bsc#1133923 * lswh-logical-name-iface.patch OBS-URL: https://build.opensuse.org/package/show/hardware/lshw?expand=0&rev=26 --- lshw.changes | 6 +++++ lshw.spec | 3 +++ lswh-logical-name-iface.patch | 46 +++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 lswh-logical-name-iface.patch diff --git a/lshw.changes b/lshw.changes index 5035788..e7e5ff2 100644 --- a/lshw.changes +++ b/lshw.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu May 2 09:56:21 UTC 2019 - Martin Pluskal + +- Fix displaying proper logical name of network device bsc#1133923 + * lswh-logical-name-iface.patch + ------------------------------------------------------------------- Thu Mar 28 09:34:43 UTC 2019 - Martin Pluskal diff --git a/lshw.spec b/lshw.spec index e95e42c..faf7676 100644 --- a/lshw.spec +++ b/lshw.spec @@ -27,6 +27,8 @@ URL: https://www.ezix.org/project/wiki/HardwareLiSter Source: lshw-%{version}.tar.xz Source1: lshw.desktop.in Source2: lshw.png +# PATCH-FIX-UPSTREAM lswh-logical-name-iface.patch bsc#1133923 +Patch0: lswh-logical-name-iface.patch BuildRequires: gcc-c++ BuildRequires: hicolor-icon-theme BuildRequires: libpng-devel @@ -76,6 +78,7 @@ http://www.ezix.org/software/lshw.html %prep %setup -q +%patch0 -p1 %build make \ diff --git a/lswh-logical-name-iface.patch b/lswh-logical-name-iface.patch new file mode 100644 index 0000000..ad38644 --- /dev/null +++ b/lswh-logical-name-iface.patch @@ -0,0 +1,46 @@ +From 85edb6a1a5734078a58bad21a5e6918e07f360bc Mon Sep 17 00:00:00 2001 +From: Mamatha Inamdar +Date: Tue, 30 Apr 2019 17:24:50 +0530 +Subject: [PATCH] Display proper logical name of network device + +This patch adds support to display proper logical name of +network devices. + +Test results: + + *-l-lan + description: Ethernet interface + physical id: 2 + bus info: vio@30000002 + logical name: /proc/device-tree/vdevice/l-lan@30000002 + +With patch: + + *-l-lan + description: Ethernet interface + physical id: 2 + bus info: vio@30000002 + logical name: /proc/device-tree/vdevice/l-lan@30000002 + logical name: eth0 + +Signed-off-by: Mamatha Inamdar +Signed-off-by: Shivaprasad G Bhat +--- + src/core/hw.cc | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/core/hw.cc b/src/core/hw.cc +index f136383..4522c1a 100644 +--- a/src/core/hw.cc ++++ b/src/core/hw.cc +@@ -1284,8 +1284,8 @@ void hwNode::merge(const hwNode & node) + This->handle = node.getHandle(); + if (This->description == "") + This->description = node.getDescription(); +- if (This->logicalnames.size() == 0) +- This->logicalnames = node.getLogicalNames(); ++ for (unsigned int i = 0; i < node.This->logicalnames.size(); i++) ++ setLogicalName(node.This->logicalnames[i]); + if (This->businfo == "") + This->businfo = node.getBusInfo(); + if (This->physid == "") From cfe9690692f836a0780b35d576228e36b59694b9b9bef27fb48e96de4befad28 Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Thu, 2 May 2019 10:17:11 +0000 Subject: [PATCH 2/2] - Fix displaying correct version bsc##1130818 * lshw-display-latest-version.patch * lshw-help-man.patch * lshw-modified-time.patch OBS-URL: https://build.opensuse.org/package/show/hardware/lshw?expand=0&rev=27 --- lshw-display-latest-version.patch | 29 +++++++++++++++++++++ lshw-help-man.patch | 43 +++++++++++++++++++++++++++++++ lshw-modified-time.patch | 39 ++++++++++++++++++++++++++++ lshw.changes | 4 +++ lshw.spec | 7 +++++ 5 files changed, 122 insertions(+) create mode 100644 lshw-display-latest-version.patch create mode 100644 lshw-help-man.patch create mode 100644 lshw-modified-time.patch diff --git a/lshw-display-latest-version.patch b/lshw-display-latest-version.patch new file mode 100644 index 0000000..4c181ea --- /dev/null +++ b/lshw-display-latest-version.patch @@ -0,0 +1,29 @@ +From 5e58d66598908249f44d349d22efdc4524f0cfcb Mon Sep 17 00:00:00 2001 +From: Vasant Hegde +Date: Mon, 29 Apr 2019 22:39:08 +0530 +Subject: [PATCH] Fix version output + +Display latest version only when its greater than current version. + +"lshw -version" tries to get current version from upstream repository. +If it contains old version then output becomes confusing (as running +version > latest version). + +Signed-off-by: Vasant Hegde +--- + src/lshw.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/lshw.cc b/src/lshw.cc +index 219a008..be233eb 100644 +--- a/src/lshw.cc ++++ b/src/lshw.cc +@@ -121,7 +121,7 @@ char **argv) + printf("%s\n", getpackageversion()); + if(latest) + { +- if(strcmp(latest, getpackageversion()) != 0) ++ if(strcmp(latest, getpackageversion()) >= 0) + fprintf(stderr, _("the latest version is %s\n"), latest); + } + exit(0); diff --git a/lshw-help-man.patch b/lshw-help-man.patch new file mode 100644 index 0000000..302a7d1 --- /dev/null +++ b/lshw-help-man.patch @@ -0,0 +1,43 @@ +From 33951733bb800321780444a178b969c212c65875 Mon Sep 17 00:00:00 2001 +From: Seeteena Thoufeek +Date: Wed, 12 Jul 2017 11:00:43 +0530 +Subject: [PATCH] Update help message and man page + +lshw -dump option displays output on stdout as well as stores SQLite +format data into a file. Lets update man page and help message to +reflect this. + +Signed-off-by: Seeteena Thoufeek +[Updated description - Vasant] +Signed-off-by: Vasant Hegde +--- + src/lshw.1 | 2 +- + src/lshw.cc | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/lshw.1 b/src/lshw.1 +index 43239da..79c3619 100644 +--- a/src/lshw.1 ++++ b/src/lshw.1 +@@ -53,7 +53,7 @@ Outputs the device tree showing hardware paths, very much like the output of HP- + Outputs the device list showing bus information, detailing SCSI, USB, IDE and PCI addresses. + .TP + \fB-dump \fIfilename\fB\fR +-Dump collected information into a file (SQLite database). ++Display output and dump collected information into a file (SQLite database). + .TP + \fB-class \fIclass\fB\fR + Only show the given class of hardware. \fIclass\fR can be found using \fBlshw -short\fR or \fBlshw -businfo\fR\&. +diff --git a/src/lshw.cc b/src/lshw.cc +index 5fc8ade..219a008 100644 +--- a/src/lshw.cc ++++ b/src/lshw.cc +@@ -35,7 +35,7 @@ void usage(const char *progname) + fprintf(stderr, _("\t-X use graphical interface\n")); + fprintf(stderr, _("\noptions can be\n")); + #ifdef SQLITE +- fprintf(stderr, _("\t-dump OUTFILE save hardware tree to a file\n")); ++ fprintf(stderr, _("\t-dump filename displays output and dump collected information into a file (SQLite database)\n")); + #endif + fprintf(stderr, _("\t-class CLASS only show a certain class of hardware\n")); + fprintf(stderr, _("\t-C CLASS same as '-class CLASS'\n")); diff --git a/lshw-modified-time.patch b/lshw-modified-time.patch new file mode 100644 index 0000000..f79be6f --- /dev/null +++ b/lshw-modified-time.patch @@ -0,0 +1,39 @@ +From d76f5c6bcb68ef1c5fabd84df9f6025ea1053b90 Mon Sep 17 00:00:00 2001 +From: Seeteena Thoufeek +Date: Thu, 13 Jul 2017 14:18:08 +0530 +Subject: [PATCH] Do not show modified time with -notime option + +Exclude volatile attributes (timestamps) from lshw -notime output. + +Signed-off-by: Seeteena Thoufeek +[Updated description and fixed detect_hfsx() - Vasant] +Signed-off-by: Vasant Hegde +--- + src/core/volumes.cc | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/src/core/volumes.cc b/src/core/volumes.cc +index 07a253b..456809a 100644 +--- a/src/core/volumes.cc ++++ b/src/core/volumes.cc +@@ -651,8 +651,10 @@ static bool detect_hfsx(hwNode & n, source & s) + wtime = (time_t)(be_long(&vol->modifyDate) - HFSTIMEOFFSET); + n.setConfig("created", datetime(mkfstime, false)); // creation time uses local time + if (enabled("output:time")) ++ { + n.setConfig("checked", datetime(fscktime)); +- n.setConfig("modified", datetime(wtime)); ++ n.setConfig("modified", datetime(wtime)); ++ } + + return true; + } +@@ -742,7 +744,7 @@ static bool detect_hfs(hwNode & n, source & s) + n.setConfig("created", datetime(mkfstime - HFSTIMEOFFSET, false)); // all dates use local time + if(dumptime) + n.setConfig("backup", datetime(dumptime - HFSTIMEOFFSET, false)); +- if(wtime) ++ if(wtime && enabled("output:time")) + n.setConfig("modified", datetime(wtime - HFSTIMEOFFSET, false)); + + return true; diff --git a/lshw.changes b/lshw.changes index e7e5ff2..178bed4 100644 --- a/lshw.changes +++ b/lshw.changes @@ -3,6 +3,10 @@ Thu May 2 09:56:21 UTC 2019 - Martin Pluskal - Fix displaying proper logical name of network device bsc#1133923 * lswh-logical-name-iface.patch +- Fix displaying correct version bsc##1130818 + * lshw-display-latest-version.patch + * lshw-help-man.patch + * lshw-modified-time.patch ------------------------------------------------------------------- Thu Mar 28 09:34:43 UTC 2019 - Martin Pluskal diff --git a/lshw.spec b/lshw.spec index faf7676..047de5c 100644 --- a/lshw.spec +++ b/lshw.spec @@ -29,6 +29,10 @@ Source1: lshw.desktop.in Source2: lshw.png # PATCH-FIX-UPSTREAM lswh-logical-name-iface.patch bsc#1133923 Patch0: lswh-logical-name-iface.patch +# PATCH-FIX-UPSTREAM lshw-display-latest-version.patch lshw-help-man.patch lshw-modified-time.patch bsc##1130818 +Patch1: lshw-display-latest-version.patch +Patch2: lshw-help-man.patch +Patch3: lshw-modified-time.patch BuildRequires: gcc-c++ BuildRequires: hicolor-icon-theme BuildRequires: libpng-devel @@ -79,6 +83,9 @@ http://www.ezix.org/software/lshw.html %prep %setup -q %patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 %build make \