cupshelpers: let PPDs with a blank MFG match their device - #448
Open
codewiz wants to merge 1 commit into
Open
Conversation
Some printers report an empty MFG in their IEEE 1284 device ID. Index those PPDs under the empty make instead of dropping them, so the exact match becomes symmetric with the lookup side. MDL is still required. Fixes OpenPrinting#445 Assisted-by: Claude:claude-fable-5 [Claude Code]
Author
|
Is this ok to merge? |
Member
|
Tbh it looks to me more like firmware issue of the printer, but I don't have any standard at hand as evidence, but logically any device usually has to report its manufacturer and model name via device id. My concern here is that it would match with different model as well (meaning the model name would be the same), but probably this is really narrow corner case. |
zdohnal
requested changes
Aug 3, 2026
zdohnal
left a comment
Member
There was a problem hiding this comment.
There is one small concern about hitting a corner case of the same model name of different mfg which has empty mfg as well, but IMO it is acceptable.
It would be great to at least log that mfg is empty.
| lmdl = id_dict['MDL'].lower () | ||
|
|
||
| bad = False | ||
| if len (lmfg) == 0: |
Member
There was a problem hiding this comment.
Would you mind adding at least debugprint call if the MFG is empty? Just to be sure.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #445.
_init_ids()drops every PPD whose device ID has an empty MFG, whilegetPPDNamesFromDeviceID()looks the device's (also empty) MFG up inthat same table, so a printer reporting a blank MFG can never match its
PPD - it ends up on textonly.ppd. This indexes such PPDs under the empty
make instead; a non-empty MDL is still required.
Tested on Fedora 45 with a Phomemo PM-241-BT
(
MFG: ;CMD:XPP,XL;MDL:PM-241-BT;...): with the patch,system-config-printer, KDE printer settings and GetBestDrivers all pick
the right PPD with fit
exact-cmd.Assisted-by: Claude:claude-fable-5 [Claude Code]