diff -u lshw-02.18/debian/changelog lshw-02.18/debian/changelog --- lshw-02.18/debian/changelog +++ lshw-02.18/debian/changelog @@ -1,3 +1,15 @@ +lshw (02.18-0.1ubuntu7) cosmic; urgency=medium + + * d/patches/lshw-add-json-option-in-help-output.patch, + * d/patches/lshw-fix-unknown-version-issue.patch: + Cherry pick from upstream. (LP: #1752523) + * d/rules: pass uver as VERSION when building the core module as + the lshw-fix-unknown-version-issue.patch expects that variable + to be set, otherwise lshw's version will be set to an empty + string. + + -- Tiago Stürmer Daitx Mon, 09 Jul 2018 20:13:29 +0000 + lshw (02.18-0.1ubuntu6) bionic; urgency=medium * AArch64: cpuinfo: Remove redundant cpu caps loop (LP: #1582181) diff -u lshw-02.18/debian/patches/series lshw-02.18/debian/patches/series --- lshw-02.18/debian/patches/series +++ lshw-02.18/debian/patches/series @@ -39,0 +40,2 @@ +lshw-add-json-option-in-help-output.patch +lshw-fix-unknown-version-issue.patch diff -u lshw-02.18/debian/rules lshw-02.18/debian/rules --- lshw-02.18/debian/rules +++ lshw-02.18/debian/rules @@ -43,7 +43,7 @@ dh_testdir # Add here commands to compile the package. - $(MAKE) -C $(srcdir) core + $(MAKE) -C $(srcdir) VERSION=$(uver) core $(MAKE) -C $(srcdir) gui #/usr/bin/docbook-to-man debian/lshw.sgml > lshw.1 touch build-stamp only in patch2: unchanged: --- lshw-02.18.orig/debian/patches/lshw-add-json-option-in-help-output.patch +++ lshw-02.18/debian/patches/lshw-add-json-option-in-help-output.patch @@ -0,0 +1,25 @@ +From 503c76a35a9e97a098af7c1ac793a7e13c07ce70 Mon Sep 17 00:00:00 2001 +From: Chandni Verma +Date: Thu, 8 Sep 2016 14:29:08 +0530 +Subject: [PATCH] Adding -json option in -help output + +-json works perfectly and is a recognized lshw option already. +It was only missed in printing. Nothing more needs to be done. + +Signed-off-by: Chandni Verma +--- + lshw-B.02.18/src/lshw.cc | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/lshw-B.02.18/src/lshw.cc b/lshw-B.02.18/src/lshw.cc +index 77a5932..5fc8ade 100644 +--- a/lshw-B.02.18/src/lshw.cc ++++ b/lshw-B.02.18/src/lshw.cc +@@ -29,6 +29,7 @@ void usage(const char *progname) + fprintf(stderr, _("\nformat can be\n")); + fprintf(stderr, _("\t-html output hardware tree as HTML\n")); + fprintf(stderr, _("\t-xml output hardware tree as XML\n")); ++ fprintf(stderr, _("\t-json output hardware tree as a JSON object\n")); + fprintf(stderr, _("\t-short output hardware paths\n")); + fprintf(stderr, _("\t-businfo output bus information\n")); + if(getenv("DISPLAY") && exists(SBINDIR"/lshw-gtk")) only in patch2: unchanged: --- lshw-02.18.orig/debian/patches/lshw-fix-unknown-version-issue.patch +++ lshw-02.18/debian/patches/lshw-fix-unknown-version-issue.patch @@ -0,0 +1,79 @@ +From 18edc98f9d08883f340087cfefbdf05c585d56f7 Mon Sep 17 00:00:00 2001 +From: Vasant Hegde +Date: Wed, 23 Aug 2017 14:01:21 +0530 +Subject: [PATCH] Fix version issue + +Commit 2d0296cc changed the way to get version number. Now it uses git +describe command to get version number. Also B.02.18 release missed to +expand 'versiontag' variable in version.cc file. Hence lshw -version +is showing version as "unknown". + +This patch passes VERSION macro during compilatio and uses it to show +version number. + +I've verified this with `make release` command as well. It works fine. +As long as user is working on git tree or uses `make release` command +it works fine. + +Signed-off-by: Vasant Hegde +--- + lshw-B.02.18/src/Makefile | 2 +- + lshw-B.02.18/src/core/version.cc | 29 +++-------------------------- + 2 files changed, 4 insertions(+), 27 deletions(-) + +diff --git a/lshw-B.02.18/src/Makefile b/lshw-B.02.18/src/Makefile +index acbdbfa..d3fc3c5 100644 +--- a/lshw-B.02.18/src/Makefile ++++ b/lshw-B.02.18/src/Makefile +@@ -20,7 +20,7 @@ export SQLITE + + CXX?=c++ + INCLUDES=-I./core/ +-DEFINES=-DPREFIX=\"$(PREFIX)\" -DSBINDIR=\"$(SBINDIR)\" -DMANDIR=\"$(MANDIR)\" -DDATADIR=\"$(DATADIR)\" ++DEFINES=-DPREFIX=\"$(PREFIX)\" -DSBINDIR=\"$(SBINDIR)\" -DMANDIR=\"$(MANDIR)\" -DDATADIR=\"$(DATADIR)\" -DVERSION=\"$(VERSION)\" + #CXXFLAGS=-g -Wall -g $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS) + CXXFLAGS=$(CXX_DEB_FLAGS) $(INCLUDES) $(DEFINES) + ifeq ($(SQLITE), 1) +diff --git a/lshw-B.02.18/src/core/version.cc b/lshw-B.02.18/src/core/version.cc +index c9dc899..1f64b3a 100644 +--- a/lshw-B.02.18/src/core/version.cc ++++ b/lshw-B.02.18/src/core/version.cc +@@ -23,35 +23,12 @@ + #endif + + +-static char versiontag[] = "@(#) $URL$ >"; +- + const char *getpackageversion() + { +- static char * result = NULL; +- char * lastslash = NULL; +- +- if(result) +- return result; +- +- lastslash = strrchr(versiontag, '/'); +- if(lastslash) +- *lastslash = '\0'; // cut the basename off +- +- lastslash = strrchr(versiontag, '/'); +- if(lastslash) +- *lastslash = '\0'; // cut the basename off +- +- lastslash = strrchr(versiontag, '/'); +- if(lastslash) +- *lastslash = '\0'; // cut the basename off +- +- lastslash = strrchr(versiontag, '/'); +- if(lastslash) +- result = lastslash+1; +- else +- return "unknown"; ++ if (VERSION) ++ return VERSION; + +- return result; ++ return "unknown"; + } + + static char *txtquery(const char *name, const char *domain, unsigned int *ttl)