Skip to content

cupshelpers: let PPDs with a blank MFG match their device - #448

Open
codewiz wants to merge 1 commit into
OpenPrinting:masterfrom
codewiz:blank-mfg-match
Open

cupshelpers: let PPDs with a blank MFG match their device#448
codewiz wants to merge 1 commit into
OpenPrinting:masterfrom
codewiz:blank-mfg-match

Conversation

@codewiz

@codewiz codewiz commented Jul 14, 2026

Copy link
Copy Markdown

Fixes #445.

_init_ids() drops every PPD whose device ID has an empty MFG, while
getPPDNamesFromDeviceID() looks the device's (also empty) MFG up in
that 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]

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]
@codewiz

codewiz commented Aug 2, 2026

Copy link
Copy Markdown
Author

Is this ok to merge?

@zdohnal

zdohnal commented Aug 3, 2026

Copy link
Copy Markdown
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 zdohnal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread cupshelpers/ppds.py
lmdl = id_dict['MDL'].lower ()

bad = False
if len (lmfg) == 0:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind adding at least debugprint call if the MFG is empty? Just to be sure.

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.

cupshelpers: devices with an empty MFG in their IEEE 1284 device ID can never match any PPD

2 participants