Skip to content

feat(pci): allow override of pci ids filepath#4

Open
daveoy wants to merge 2 commits intohertg:mainfrom
daveoy:dy/pci-id-location-override
Open

feat(pci): allow override of pci ids filepath#4
daveoy wants to merge 2 commits intohertg:mainfrom
daveoy:dy/pci-id-location-override

Conversation

@daveoy
Copy link

@daveoy daveoy commented May 29, 2025

currently there's no way to override this filepath if your system uses a different location for the pci ids db.

@hertg
Copy link
Owner

hertg commented Jun 1, 2025

Thanks for the PR. Does your system use /usr/share/misc/pci.ids? And is the PCI_IDS_FILE environment variable something that's being used by other programs too, or did you come up with that?

I think it would make sense to hardcode and try all common paths for the pci.ids file /usr/share/misc/pci.ids and /usr/share/hwdata/pci.ids, ... (any others?).

Since this is a library, I'm not sure if doing it via environment variable makes the most sense. Maybe it would make sense to add an optional method parameter to pass a custom path, and let the consumer of the library handle edge cases.

@daveoy
Copy link
Author

daveoy commented Jun 10, 2025

Maybe it would make sense to add an optional method parameter to pass a custom path, and let the consumer of the library handle edge cases.

this makes sense to me. I went the env route since we don’t have any hooks into init(). Let me play with a few other ideas. Not married to the env idea, the var is not used anywhere else in my app that uses this library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants