aboutsummaryrefslogtreecommitdiffstats
path: root/community
diff options
context:
space:
mode:
authorJ0WI <J0WI@users.noreply.github.com>2018-09-28 23:19:25 +0200
committerFrancesco Colista <fcolista@alpinelinux.org>2018-10-03 11:49:35 +0000
commita838e377b39d575ea816934e31c6b4d88eb0ecad (patch)
tree8a46ad8501143336d6602b3ddb5c1537d27a531e /community
parent3018a6b879c51d7823b4dcf6f5ffe7f9d3b34412 (diff)
downloadaports-a838e377b39d575ea816934e31c6b4d88eb0ecad.tar.bz2
aports-a838e377b39d575ea816934e31c6b4d88eb0ecad.tar.xz
community/lshw: upgrade to 02.18
Diffstat (limited to 'community')
-rw-r--r--community/lshw/APKBUILD14
-rw-r--r--community/lshw/basename-limits-long-bits.patch56
-rw-r--r--community/lshw/lshw-gcc43.patch23
-rw-r--r--community/lshw/no-private-uint.patch123
-rw-r--r--community/lshw/wrapper-for-basename.patch130
5 files changed, 150 insertions, 196 deletions
diff --git a/community/lshw/APKBUILD b/community/lshw/APKBUILD
index 6ae2b7b29d..cbe2150a70 100644
--- a/community/lshw/APKBUILD
+++ b/community/lshw/APKBUILD
@@ -1,17 +1,16 @@
# Contributor: Paul Kilar <pkilar@gmail.com>
# Maintainer: Paul Kilar <pkilar@gmail.com>
pkgname=lshw
-pkgver='02.17'
-pkgrel=2
+pkgver='02.18'
+pkgrel=0
pkgdesc="Hardware Lister"
url="https://ezix.org/project/wiki/HardwareLiSter"
arch="all"
license="GPL-3.0-or-later"
makedepends="sqlite-dev linux-headers"
subpackages="$pkgname-doc $pkgname-lang"
-source="http://ezix.org/software/files/lshw-B.$pkgver.tar.gz
- no-private-uint.patch
- basename-limits-long-bits.patch
+source="https://ezix.org/software/files/lshw-B.$pkgver.tar.gz
+ wrapper-for-basename.patch
"
builddir="$srcdir"/$pkgname-B.$pkgver
@@ -26,6 +25,5 @@ package() {
make -j1 DESTDIR="$pkgdir" install
}
-sha512sums="868899dce98e786a08a2134d6e132c388d71ab0f03fa6e10881e14d7a882c1882b46bbc6bd6ddb021cfab87ad6c9fd369453c3916f0b3353027eb2d470e55d9b lshw-B.02.17.tar.gz
-6cd1e4e1e5972bfff2dd159ffc4a1a38157598f993ad927afc70f067496e461c2a25d9721c4773bda6465750b9125f9eb3d89e0b83b1842fafcf552262276da8 no-private-uint.patch
-50005efd1f9a77495f5acb36e4d6bbec0a2e22cf8ce3b17f28e6be738bfc1d6943fb9adf38a2414a719df0b8ccb4be2b0f4313e441d77e3e3043b73d30566190 basename-limits-long-bits.patch"
+sha512sums="4385db86101178b8bd33a80e991718e14f83277c66b3d63ae97cb4339196873b6e9b31a174024bf43d16fe66e1d7f8cf5cea56076697878087880c8821b11e47 lshw-B.02.18.tar.gz
+bad7910af7ac3d8bc59e1f8e178a9d29851cfe4048473e5036a661b4650c5144693e6bf83f4c03304a7afb5c3003e2e732518a57d304bcc084bd78f109722da0 wrapper-for-basename.patch"
diff --git a/community/lshw/basename-limits-long-bits.patch b/community/lshw/basename-limits-long-bits.patch
index 68c9cf983f..cd5db0c7b1 100644
--- a/community/lshw/basename-limits-long-bits.patch
+++ b/community/lshw/basename-limits-long-bits.patch
@@ -3,66 +3,38 @@ Author: Isaac Dunham <ibid.ag@gmail.com>
Date: Fri Sep 12 21:45:32 2014 -0700
Numerous less obvious fixes
-
- -sysconf(_SC_LONG_BIT) is 8*sizeof(long)
+
-POSIX basename() requires a char *, not const char*
- -limits.h is necessary for PATH_MAX
-diff --git a/src/core/abi.cc b/src/core/abi.cc
-index 5fdd8e3..7f78d4b 100644
---- a/src/core/abi.cc
-+++ b/src/core/abi.cc
-@@ -19,7 +19,7 @@ __ID("@(#) $Id: mem.cc 1352 2006-05-27 23:54:13Z ezix $");
- bool scan_abi(hwNode & system)
- {
- // are we compiled as 32- or 64-bit process ?
-- system.setWidth(sysconf(_SC_LONG_BIT));
-+ system.setWidth(8*sizeof(long));
-
- pushd(PROC_SYS);
-
-diff --git a/src/core/cpufreq.cc b/src/core/cpufreq.cc
-index da3960f..aa0df00 100644
---- a/src/core/cpufreq.cc
-+++ b/src/core/cpufreq.cc
-@@ -17,6 +17,7 @@
- #include <stdio.h>
- #include <unistd.h>
- #include <dirent.h>
-+#include <limits.h>
-
- __ID("@(#) $Id: cpufreq.cc 2470 2012-01-19 12:04:26Z lyonel $");
-
diff --git a/src/core/pci.cc b/src/core/pci.cc
index aaa257c..b8a7917 100644
--- a/src/core/pci.cc
+++ b/src/core/pci.cc
-@@ -12,6 +12,8 @@
+@@ -13,6 +13,7 @@
#include <string.h>
#include <stdlib.h>
#include <dirent.h>
-+#include <libgen.h>
+#include <limits.h>
-
- __ID("@(#) $Id: pci.cc 2496 2012-05-15 08:00:13Z lyonel $");
-
+
+ __ID("@(#) $Id$");
+
@@ -1127,10 +1129,16 @@ bool scan_pci(hwNode & n)
{
string drivername = readlink(string(devices[i]->d_name)+"/driver");
string modulename = readlink(string(devices[i]->d_name)+"/driver/module");
-
-- device->setConfig("driver", basename(drivername.c_str()));
-+ char driver_c[PATH_MAX];
-+ char module_c[PATH_MAX];
-+ bzero(driver_c,PATH_MAX);
-+ bzero(module_c,PATH_MAX);
-+ strncpy(driver_c, drivername.c_str(),PATH_MAX);
-+ strncpy(module_c, modulename.c_str(),PATH_MAX);
+- device->setConfig("driver", basename(const_cast<char *>(drivername.c_str())));
++ char driver_c[PATH_MAX];
++ char module_c[PATH_MAX];
++ bzero(driver_c,PATH_MAX);
++ bzero(module_c,PATH_MAX);
++ strncpy(driver_c, drivername.c_str(),PATH_MAX);
++ strncpy(module_c, modulename.c_str(),PATH_MAX);
+
+ device->setConfig("driver", basename(driver_c));
if(exists(modulename))
-- device->setConfig("module", basename(modulename.c_str()));
+- device->setConfig("module", basename(const_cast<char *>(modulename.c_str())));
+ device->setConfig("module", basename(module_c));
-
+
if(exists(string(devices[i]->d_name)+"/rom"))
{
diff --git a/community/lshw/lshw-gcc43.patch b/community/lshw/lshw-gcc43.patch
deleted file mode 100644
index c56b03890b..0000000000
--- a/community/lshw/lshw-gcc43.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- src/core/abi.cc.orig 2010-03-15 21:26:20.000000000 +0100
-+++ src/core/abi.cc 2013-08-06 21:05:08.693772583 +0200
-@@ -11,6 +11,7 @@
- #include <unistd.h>
- #include <stdlib.h>
- #include <dirent.h>
-+#include <cstdlib>
-
- __ID("@(#) $Id: mem.cc 1352 2006-05-27 23:54:13Z ezix $");
-
-@@ -38,10 +39,10 @@
- for(i=0; i<n; i++)
- {
- system.addCapability(namelist[i]->d_name);
-- free(namelist[i]);
-+ std::free(namelist[i]);
- }
- if(namelist)
-- free(namelist);
-+ std::free(namelist);
- }
-
- popd();
diff --git a/community/lshw/no-private-uint.patch b/community/lshw/no-private-uint.patch
deleted file mode 100644
index 1c67d574fd..0000000000
--- a/community/lshw/no-private-uint.patch
+++ /dev/null
@@ -1,123 +0,0 @@
-commit 4928bab9086d6e9610413f15675babdf5566c5ce
-Author: Isaac Dunham <ibid.ag@gmail.com>
-Date: Fri Sep 12 21:19:19 2014 -0700
-
- Uncruftify: remove __ from uint*_t
-
-diff --git a/src/core/device-tree.cc b/src/core/device-tree.cc
-index 5c3d654..fd38b2f 100644
---- a/src/core/device-tree.cc
-+++ b/src/core/device-tree.cc
-@@ -24,13 +24,13 @@
- __ID("@(#) $Id: device-tree.cc 2521 2013-05-08 13:43:30Z lyonel $");
-
- #define DIMMINFOSIZE 0x80
--typedef __uint8_t dimminfo_buf[DIMMINFOSIZE];
-+typedef uint8_t dimminfo_buf[DIMMINFOSIZE];
-
- struct dimminfo
- {
-- __uint8_t version3;
-+ uint8_t version3;
- char serial[16];
-- __uint16_t version1, version2;
-+ uint16_t version1, version2;
- };
-
- #define DEVICETREE "/proc/device-tree"
-diff --git a/src/core/network.cc b/src/core/network.cc
-index 134c887..a298d35 100644
---- a/src/core/network.cc
-+++ b/src/core/network.cc
-@@ -49,9 +49,9 @@ __ID("@(#) $Id: network.cc 2516 2013-02-03 16:43:25Z lyonel $");
- #define SIOCETHTOOL 0x8946
- #endif
- typedef unsigned long long u64;
--typedef __uint32_t u32;
--typedef __uint16_t u16;
--typedef __uint8_t u8;
-+typedef uint32_t u32;
-+typedef uint16_t u16;
-+typedef uint8_t u8;
-
- struct ethtool_cmd
- {
-diff --git a/src/core/osutils.cc b/src/core/osutils.cc
-index fd19288..f9ce76c 100644
---- a/src/core/osutils.cc
-+++ b/src/core/osutils.cc
-@@ -496,48 +496,48 @@ string escapecomment(const string & s)
-
- unsigned short be_short(const void * from)
- {
-- __uint8_t *p = (__uint8_t*)from;
-+ uint8_t *p = (uint8_t*)from;
-
-- return ((__uint16_t)(p[0]) << 8) +
-- (__uint16_t)p[1];
-+ return ((uint16_t)(p[0]) << 8) +
-+ (uint16_t)p[1];
- }
-
-
- unsigned short le_short(const void * from)
- {
-- __uint8_t *p = (__uint8_t*)from;
-+ uint8_t *p = (uint8_t*)from;
-
-- return ((__uint16_t)(p[1]) << 8) +
-- (__uint16_t)p[0];
-+ return ((uint16_t)(p[1]) << 8) +
-+ (uint16_t)p[0];
- }
-
-
- unsigned long be_long(const void * from)
- {
-- __uint8_t *p = (__uint8_t*)from;
-+ uint8_t *p = (uint8_t*)from;
-
-- return ((__uint32_t)(p[0]) << 24) +
-- ((__uint32_t)(p[1]) << 16) +
-- ((__uint32_t)(p[2]) << 8) +
-- (__uint32_t)p[3];
-+ return ((uint32_t)(p[0]) << 24) +
-+ ((uint32_t)(p[1]) << 16) +
-+ ((uint32_t)(p[2]) << 8) +
-+ (uint32_t)p[3];
- }
-
-
- unsigned long le_long(const void * from)
- {
-- __uint8_t *p = (__uint8_t*)from;
-+ uint8_t *p = (uint8_t*)from;
-
-- return ((__uint32_t)(p[3]) << 24) +
-- ((__uint32_t)(p[2]) << 16) +
-- ((__uint32_t)(p[1]) << 8) +
-- (__uint32_t)p[0];
-+ return ((uint32_t)(p[3]) << 24) +
-+ ((uint32_t)(p[2]) << 16) +
-+ ((uint32_t)(p[1]) << 8) +
-+ (uint32_t)p[0];
-
- }
-
-
- unsigned long long be_longlong(const void * from)
- {
-- __uint8_t *p = (__uint8_t*)from;
-+ uint8_t *p = (uint8_t*)from;
-
- return ((unsigned long long)(p[0]) << 56) +
- ((unsigned long long)(p[1]) << 48) +
-@@ -552,7 +552,7 @@ unsigned long long be_longlong(const void * from)
-
- unsigned long long le_longlong(const void * from)
- {
-- __uint8_t *p = (__uint8_t*)from;
-+ uint8_t *p = (uint8_t*)from;
-
- return ((unsigned long long)(p[7]) << 56) +
- ((unsigned long long)(p[6]) << 48) +
diff --git a/community/lshw/wrapper-for-basename.patch b/community/lshw/wrapper-for-basename.patch
new file mode 100644
index 0000000000..ff0172bd1b
--- /dev/null
+++ b/community/lshw/wrapper-for-basename.patch
@@ -0,0 +1,130 @@
+From 49a2c103c7d1127045ced8e8c887279a36a3f357 Mon Sep 17 00:00:00 2001
+From: Felix Janda <felix.janda@posteo.de>
+Date: Wed, 12 Apr 2017 21:29:11 -0400
+Subject: [PATCH 1/2] Add wrapper for basename
+
+basename comes in two variants. A GNU and a POSIX version. Currently,
+the GNU version is mostly used, but this breaks compilation on systems
+without glibc.
+
+Switch to the portable version. Because this variant modifies its
+argument, similarly to dirname, a wrapper is needed.
+---
+ src/core/dasd.cc | 4 ++--
+ src/core/osutils.cc | 10 ++++++++++
+ src/core/osutils.h | 1 +
+ src/core/pci.cc | 4 ++--
+ src/core/sysfs.cc | 8 ++++----
+ 5 files changed, 19 insertions(+), 8 deletions(-)
+
+diff --git a/src/core/dasd.cc b/src/core/dasd.cc
+index b62a7ee..3a716ac 100644
+--- a/src/core/dasd.cc
++++ b/src/core/dasd.cc
+@@ -19,7 +19,7 @@ using namespace std;
+ bool scan_dasd(hwNode & n)
+ {
+ size_t dev_num;
+- char *dev_name;
++ std::string dev_name;
+ glob_t devices;
+ uint64_t capacity;
+
+@@ -42,7 +42,7 @@ bool scan_dasd(hwNode & n)
+ {
+ for(dev_num=0;dev_num<devices.gl_pathc;dev_num++)
+ {
+- dev_name = basename(devices.gl_pathv[dev_num]);
++ dev_name = basename(std::string(devices.gl_pathv[dev_num]));
+ for (std::vector<std::string>::iterator it = sysfs_attribs.begin(); it != sysfs_attribs.end(); ++it)
+ {
+ std::string attrib_fname = std::string(SYSFS_PREFIX) + dev_name + "/device/" + *it;
+diff --git a/src/core/osutils.cc b/src/core/osutils.cc
+index e93b79e..1624ab1 100644
+--- a/src/core/osutils.cc
++++ b/src/core/osutils.cc
+@@ -426,6 +426,16 @@ string dirname(const string & path)
+ return result;
+ }
+
++string basename(const string & path)
++{
++ size_t len = path.length();
++ char *buffer = new char[len + 1];
++ path.copy(buffer, len);
++ buffer[len] = '\0';
++ string result = basename(buffer);
++ delete[] buffer;
++ return result;
++}
+
+ string spaces(unsigned int count, const string & space)
+ {
+diff --git a/src/core/osutils.h b/src/core/osutils.h
+index 549258e..55f5548 100644
+--- a/src/core/osutils.h
++++ b/src/core/osutils.h
+@@ -15,6 +15,7 @@ bool samefile(const std::string & path1, const std::string & path2);
+ std::string readlink(const std::string & path);
+ std::string realpath(const std::string & path);
+ std::string dirname(const std::string & path);
++std::string basename(const std::string & path);
+ bool loadfile(const std::string & file, std::vector < std::string > &lines);
+
+ size_t splitlines(const std::string & s,
+diff --git a/src/core/pci.cc b/src/core/pci.cc
+index d1625cf..1163ad2 100644
+--- a/src/core/pci.cc
++++ b/src/core/pci.cc
+@@ -1131,9 +1131,9 @@ bool scan_pci(hwNode & n)
+ string drivername = readlink(string(devices[i]->d_name)+"/driver");
+ string modulename = readlink(string(devices[i]->d_name)+"/driver/module");
+
+- device->setConfig("driver", basename(const_cast<char *>(drivername.c_str())));
++ device->setConfig("driver", basename(drivername));
+ if(exists(modulename))
+- device->setConfig("module", basename(const_cast<char *>(modulename.c_str())));
++ device->setConfig("module", basename(modulename));
+
+ if(exists(string(devices[i]->d_name)+"/rom"))
+ {
+diff --git a/src/core/sysfs.cc b/src/core/sysfs.cc
+index 97dbab5..0fc4855 100644
+--- a/src/core/sysfs.cc
++++ b/src/core/sysfs.cc
+@@ -99,7 +99,7 @@ static string sysfs_getbustype(const string & path)
+ {
+ devname =
+ string(fs.path + "/bus/") + string(namelist[i]->d_name) +
+- "/devices/" + basename(path.c_str());
++ "/devices/" + basename(path);
+
+ if (samefile(devname, path))
+ return string(namelist[i]->d_name);
+@@ -139,7 +139,7 @@ static string sysfstobusinfo(const string & path)
+
+ if (bustype == "virtio")
+ {
+- string name = basename(path.c_str());
++ string name = basename(path);
+ if (name.compare(0, 6, "virtio") == 0)
+ return "virtio@" + name.substr(6);
+ else
+@@ -207,7 +207,7 @@ string entry::driver() const
+ string driverlink = This->devpath + "/driver";
+ if (!exists(driverlink))
+ return "";
+- return basename(readlink(driverlink).c_str());
++ return basename(readlink(driverlink));
+ }
+
+
+@@ -288,7 +288,7 @@ string entry::name_in_class(const string & classname) const
+
+ string entry::name() const
+ {
+- return basename(This->devpath.c_str());
++ return basename(This->devpath);
+ }
+
+