rpms/lsvpd/devel lsvpd-1.6.7-ids-lookup.patch, NONE, 1.1 .cvsignore, 1.4, 1.5 import.log, 1.1, 1.2 lsvpd.spec, 1.10, 1.11 sources, 1.4, 1.5
Eric Munson
emunson at fedoraproject.org
Wed Dec 2 12:23:02 UTC 2009
Author: emunson
Update of /cvs/pkgs/rpms/lsvpd/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv17965/devel
Modified Files:
.cvsignore import.log lsvpd.spec sources
Added Files:
lsvpd-1.6.7-ids-lookup.patch
Log Message:
Updating to lsvpd-1.6.7
lsvpd-1.6.7-ids-lookup.patch:
include/devicelookup.hpp | 8 +++-
internal/devicelookup.cpp | 45 ++++++++++++++++++++++++--
internal/sys_interface/sysfstreecollector.cpp | 4 +-
3 files changed, 51 insertions(+), 6 deletions(-)
--- NEW FILE lsvpd-1.6.7-ids-lookup.patch ---
### 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 at 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 = "";
}
Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/lsvpd/devel/.cvsignore,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- .cvsignore 16 Mar 2009 13:19:13 -0000 1.4
+++ .cvsignore 2 Dec 2009 12:23:01 -0000 1.5
@@ -1 +1 @@
-lsvpd-1.6.5.tar.gz
+lsvpd-1.6.7.tar.gz
Index: import.log
===================================================================
RCS file: /cvs/pkgs/rpms/lsvpd/devel/import.log,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- import.log 16 Mar 2009 13:19:13 -0000 1.1
+++ import.log 2 Dec 2009 12:23:01 -0000 1.2
@@ -1 +1,2 @@
lsvpd-1_6_5-1_fc10:HEAD:lsvpd-1.6.5-1.src.rpm:1237209622
+lsvpd-1_6_7-1_fc12:HEAD:lsvpd-1.6.7-1.src.rpm:1259756539
Index: lsvpd.spec
===================================================================
RCS file: /cvs/pkgs/rpms/lsvpd/devel/lsvpd.spec,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -p -r1.10 -r1.11
--- lsvpd.spec 25 Jul 2009 11:22:20 -0000 1.10
+++ lsvpd.spec 2 Dec 2009 12:23:01 -0000 1.11
@@ -1,9 +1,9 @@
%define name lsvpd
-%define version 1.6.5
+%define version 1.6.7
Name: %{name}
Version: %{version}
-Release: 3%{?dist}
+Release: 1%{?dist}
Summary: VPD/hardware inventory utilities for Linux
Group: Applications/System
@@ -11,12 +11,16 @@ License: GPLv2+
URL: http://linux-diag.sf.net/Lsvpd.html
Source: http://downloads.sourceforge.net/linux-diag/%{name}-%{version}.tar.gz
Patch0: lsvpd-1.6.4-sg3_utils-1.26.patch
+Patch1: lsvpd-1.6.7-ids-lookup.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: sg3_utils-devel libvpd-devel zlib-devel
Requires(post): /usr/sbin/vpdupdate
# By default, build without librtas because it does not yet exist in Fedora
-%{!?_with_librtas: %{!?_without_librtas: %define _without_librtas --without-librtas }}
+
+# librtas is now part of Fedora, lsvpd provides much more information with
+# librtas on POWER
+#%{!?_with_librtas: %{!?_without_librtas: %define _without_librtas --without-librtas }}
%ifarch ppc
%{?_with_librtas:BuildRequires: librtas-devel }
@@ -39,6 +43,7 @@ on POWER PC based systems.
%prep
%setup -q
%patch0 -p1
+%patch1 -p0
%build
%configure
@@ -71,6 +76,11 @@ on POWER PC based systems.
%dir %{_sysconfdir}/lsvpd
%changelog
+* Wed Dec 02 2009 Eric Munson <ebmunson at us.ibm.com> - 1.6.7-1
+- Update to latest lsvpd release
+- Add librtas support to build on POWERPC
+- Add patch to lookup *.ids file location at runtime
+
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.6.5-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/lsvpd/devel/sources,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- sources 16 Mar 2009 13:19:13 -0000 1.4
+++ sources 2 Dec 2009 12:23:02 -0000 1.5
@@ -1 +1 @@
-cdc0e247fd31bec97989d128d61efd3e lsvpd-1.6.5.tar.gz
+97e6363177ee6c5dbf0cb198f5554af8 lsvpd-1.6.7.tar.gz
More information about the fedora-extras-commits
mailing list