Skip to contentSkip to conversation

pmdinfo: check for pci.ids in /usr/share/misc

PATCH Applied [email protected] 2 participants 3 messages Mar 12, 2020 – Apr 25, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pmdinfo: check for pci.ids in /usr/share/misc

From: Luca Boccassi <[email protected]>

Debian and Ubuntu switched years ago from /usr/share/hwdata to /usr/share/misc, and the former is just a compat symlink now.
We are starting to get bug reports to nudge us into changing.
So check the new path first, and the old one as a fallback.

---
 usertools/dpdk-pmdinfo.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
usertools/dpdk-pmdinfo.py +4 -1
index 9d5c6369a0..12f20735e0 100755
@@ -561,7 +561,10 @@ def main(stream=None):
 
     pcifile_default = "./pci.ids"  # For unknown OS's assume local file
     if platform.system() == 'Linux':
-        pcifile_default = "/usr/share/hwdata/pci.ids"
+        # hwdata is the legacy location, misc is supported going forward
+        pcifile_default = "/usr/share/misc/pci.ids"
+        if not os.path.exists(pcifile_default):
+            pcifile_default = "/usr/share/hwdata/pci.ids"
     elif platform.system() == 'FreeBSD':
         pcifile_default = "/usr/local/share/pciids/pci.ids"
         if not os.path.exists(pcifile_default):
Signature · 1 line
2.20.1
Acked-by on v1 1/1
#1 lore raw
Quoted 32 lines · On Thu, Mar 12, 2020 at 5:30 PM <[email protected]> wrote:

From: Luca Boccassi <[email protected]>

Debian and Ubuntu switched years ago from /usr/share/hwdata to /usr/share/misc, and the former is just a compat symlink now.
We are starting to get bug reports to nudge us into changing.
So check the new path first, and the old one as a fallback.

---
 usertools/dpdk-pmdinfo.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
usertools/dpdk-pmdinfo.py +4 -2
index 9d5c6369a0..12f20735e0 100755
@@ -561,7 +561,10 @@ def main(stream=None):
 
     pcifile_default = "./pci.ids"  # For unknown OS's assume local file
     if platform.system() == 'Linux':
-        pcifile_default = "/usr/share/hwdata/pci.ids"
+        # hwdata is the legacy location, misc is supported going forward
+        pcifile_default = "/usr/share/misc/pci.ids"
+        if not os.path.exists(pcifile_default):
+            pcifile_default = "/usr/share/hwdata/pci.ids"
     elif platform.system() == 'FreeBSD':
         pcifile_default = "/usr/local/share/pciids/pci.ids"
         if not os.path.exists(pcifile_default):
--
Quoted 2 lines

2.20.1

LGTM.

Signature · 1 line
David Marchand
Acked-by on v1 1/1 Applied
#2 lore raw
In reply to [email protected]
Quoted 11 lines · On Thu, Mar 12, 2020 at 5:30 PM <[email protected]> wrote:

From: Luca Boccassi <[email protected]>

Debian and Ubuntu switched years ago from /usr/share/hwdata to /usr/share/misc, and the former is just a compat symlink now.
We are starting to get bug reports to nudge us into changing.
So check the new path first, and the old one as a fallback.

Applied, thanks.

Signature · 1 line
David Marchand