Update to latest upstream 1.7.2
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
This commit is contained in:
parent
bd13ceced2
commit
6f673b5b62
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,3 +3,4 @@ lsvpd-1.6.8.tar.gz
|
||||
/lsvpd-1.6.11.tar.gz
|
||||
/lsvpd-1.6.12.tar.gz
|
||||
/lsvpd-1.7.1.tar.gz
|
||||
/lsvpd-1.7.2.tar.gz
|
||||
|
@ -1,141 +0,0 @@
|
||||
### Eclipse Workspace Patch 1.0
|
||||
#P lsvpd-new
|
||||
|
||||
Add ids file lookup to runtime.
|
||||
|
||||
Currently the pci.ids and usb.ids files are located by the Makefile
|
||||
and the location defined by the build. This presents a problem when
|
||||
the build system has the files in a different location from the host.
|
||||
This patch addresses this problem by moving the logic to locate the
|
||||
ids files into the vpdupdate code.
|
||||
|
||||
Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
|
||||
|
||||
---
|
||||
|
||||
Index: src/include/devicelookup.hpp
|
||||
===================================================================
|
||||
RCS file: /cvsroot/lsvpd/lsvpd-new/src/include/devicelookup.hpp,v
|
||||
retrieving revision 1.1
|
||||
diff -u -r1.1 devicelookup.hpp
|
||||
--- src/include/devicelookup.hpp 18 Feb 2008 19:45:54 -0000 1.1
|
||||
+++ src/include/devicelookup.hpp 16 Oct 2009 09:35:42 -0000
|
||||
@@ -58,7 +58,11 @@
|
||||
|
||||
void fillManus( ifstream& idFile );
|
||||
|
||||
+ static void findIdsPrefix( );
|
||||
+
|
||||
public:
|
||||
+ static string idsPrefix;
|
||||
+
|
||||
DeviceLookup( ifstream& idFile );
|
||||
~DeviceLookup( );
|
||||
const Manufacturer* getManufacturer( int id ) const;
|
||||
@@ -99,8 +103,8 @@
|
||||
*/
|
||||
const string& getName( int manID, int devID, int subID )const;
|
||||
|
||||
- static const string PCI_ID_FILE;
|
||||
- static const string USB_ID_FILE;
|
||||
+ static string getPciIds( );
|
||||
+ static string getUsbIds( );
|
||||
};
|
||||
}
|
||||
#endif
|
||||
Index: src/internal/sys_interface/sysfstreecollector.cpp
|
||||
===================================================================
|
||||
RCS file: /cvsroot/lsvpd/lsvpd-new/src/internal/sys_interface/sysfstreecollector.cpp,v
|
||||
retrieving revision 1.11
|
||||
diff -u -r1.11 sysfstreecollector.cpp
|
||||
--- src/internal/sys_interface/sysfstreecollector.cpp 16 Mar 2009 13:24:48 -0000 1.11
|
||||
+++ src/internal/sys_interface/sysfstreecollector.cpp 16 Oct 2009 09:35:43 -0000
|
||||
@@ -77,7 +77,7 @@
|
||||
mPciTable = NULL;
|
||||
mUsbTable = NULL;
|
||||
|
||||
- id.open( DeviceLookup::PCI_ID_FILE.c_str( ), ios::in );
|
||||
+ id.open( DeviceLookup::getPciIds( ).c_str( ), ios::in );
|
||||
if( id )
|
||||
{
|
||||
mPciTable = new DeviceLookup( id );
|
||||
@@ -91,7 +91,7 @@
|
||||
LOG_ERR );
|
||||
}
|
||||
|
||||
- id.open( DeviceLookup::USB_ID_FILE.c_str( ), ios::in );
|
||||
+ id.open( DeviceLookup::getUsbIds( ).c_str( ), ios::in );
|
||||
if( id )
|
||||
{
|
||||
mUsbTable = new DeviceLookup( id );
|
||||
Index: src/internal/devicelookup.cpp
|
||||
===================================================================
|
||||
RCS file: /cvsroot/lsvpd/lsvpd-new/src/internal/devicelookup.cpp,v
|
||||
retrieving revision 1.2
|
||||
diff -u -r1.2 devicelookup.cpp
|
||||
--- src/internal/devicelookup.cpp 18 Feb 2008 19:45:54 -0000 1.2
|
||||
+++ src/internal/devicelookup.cpp 16 Oct 2009 09:35:43 -0000
|
||||
@@ -27,6 +27,8 @@
|
||||
#include <libvpd-2/vpdexception.hpp>
|
||||
#include <libvpd-2/lsvpd.hpp>
|
||||
|
||||
+#include <sys/stat.h>
|
||||
+
|
||||
/**
|
||||
* The Manufacturer object will store the id and name of a single manufacturer
|
||||
* entry from the pci.ids file. It will also store a hash_map of devices
|
||||
@@ -34,8 +36,6 @@
|
||||
*/
|
||||
namespace lsvpd
|
||||
{
|
||||
- const string DeviceLookup::PCI_ID_FILE( PCI_IDS );
|
||||
- const string DeviceLookup::USB_ID_FILE( USB_IDS );
|
||||
|
||||
DeviceLookup::DeviceLookup( ifstream& pciID )
|
||||
{
|
||||
@@ -119,4 +119,45 @@
|
||||
const Device* d = m->getDevice( devID );
|
||||
return (d->getSubDevice( subID ))->getName( );
|
||||
}
|
||||
+
|
||||
+ void DeviceLookup::findIdsPrefix( )
|
||||
+ {
|
||||
+ // There are 6 potential locations for the ids files:
|
||||
+ // /usr/share, /usr/local/share, /usr/share/misc,
|
||||
+ // /usr/local/share/misc, /usr/share/hwdata,
|
||||
+ // and /usr/local/share/hwdata
|
||||
+
|
||||
+ struct stat buf;
|
||||
+
|
||||
+ if ( !stat( "/usr/share/pci.ids", &buf ) )
|
||||
+ DeviceLookup::idsPrefix = "/usr/share";
|
||||
+ else if ( !stat( "/usr/local/share/pci.ids", &buf ) )
|
||||
+ DeviceLookup::idsPrefix = "/usr/local/share";
|
||||
+ else if ( !stat( "/usr/share/misc/pci.ids", &buf ) )
|
||||
+ DeviceLookup::idsPrefix = "/usr/share/misc";
|
||||
+ else if ( !stat( "/usr/local/share/misc/pci.ids", &buf ) )
|
||||
+ DeviceLookup::idsPrefix = "/usr/local/share/misc";
|
||||
+ else if ( !stat( "/usr/share/hwdata/pci.ids", &buf ) )
|
||||
+ DeviceLookup::idsPrefix = "/usr/share/hwdata";
|
||||
+ else if ( !stat( "/usr/local/share/hwdata/pci.ids", &buf ) )
|
||||
+ DeviceLookup::idsPrefix = "/usr/local/share/hwdata";
|
||||
+ }
|
||||
+
|
||||
+ string DeviceLookup::getPciIds( )
|
||||
+ {
|
||||
+ if ( DeviceLookup::idsPrefix == "" )
|
||||
+ DeviceLookup::findIdsPrefix( );
|
||||
+
|
||||
+ return DeviceLookup::idsPrefix + "/pci.ids";
|
||||
+ }
|
||||
+
|
||||
+ string DeviceLookup::getUsbIds( )
|
||||
+ {
|
||||
+ if ( DeviceLookup::idsPrefix == "" )
|
||||
+ findIdsPrefix( );
|
||||
+
|
||||
+ return DeviceLookup::idsPrefix + "/usb.ids";
|
||||
+ }
|
||||
+
|
||||
+ string DeviceLookup::idsPrefix = "";
|
||||
}
|
15
lsvpd.spec
15
lsvpd.spec
@ -1,19 +1,18 @@
|
||||
%define name lsvpd
|
||||
%define version 1.7.1
|
||||
%define version 1.7.2
|
||||
|
||||
Name: %{name}
|
||||
Version: %{version}
|
||||
Release: 2%{?dist}
|
||||
Release: 1%{?dist}
|
||||
Summary: VPD/hardware inventory utilities for Linux
|
||||
|
||||
Group: Applications/System
|
||||
License: GPLv2+
|
||||
URL: http://linux-diag.sf.net/Lsvpd.html
|
||||
Source0: http://downloads.sourceforge.net/linux-diag/%{name}-%{version}.tar.gz
|
||||
Patch1: lsvpd-1.6.7-ids-lookup.patch
|
||||
# invscout command is shipped in IBMinvscout package, which
|
||||
# is not yet exist in Fedora. Hence exclude building invscout.
|
||||
Patch2: lsvpd-1.7.1-exclude_invscout.patch
|
||||
Patch1: lsvpd-1.7.1-exclude_invscout.patch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
BuildRequires: libvpd-devel >= 2.2.1
|
||||
BuildRequires: sg3_utils-devel zlib-devel automake libtool
|
||||
@ -35,8 +34,7 @@ on POWER PC based systems.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch1 -p0 -b .lookup
|
||||
%patch2 -p1 -b .exclude_invscout
|
||||
%patch1 -p1 -b .exclude_invscout
|
||||
|
||||
%build
|
||||
./bootstrap.sh
|
||||
@ -70,10 +68,13 @@ on POWER PC based systems.
|
||||
%dir %{_sysconfdir}/lsvpd
|
||||
|
||||
%changelog
|
||||
* Thu Aug 22 2013 Vasant Hegde <hegdevasant@linux.vnet.ibm.com> - 1.7.2
|
||||
- Update to latest upstream 1.7.2
|
||||
|
||||
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7.1-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
|
||||
|
||||
* Tue May 21 2013 Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
|
||||
* Tue May 21 2013 Vasant Hegde <hegdevasant@linux.vnet.ibm.com> - 1.7.1
|
||||
- Update to latest upstream 1.7.1
|
||||
- Exclude invscout command from lsvpd package
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user