Cannot set temp queue as default destination if there is no permanent queue installed
CUPS 2.4.7, Fedora 38
$ lpstat -a $ lpstat -e test_linux $ lpoptions -d test_linux device-uri=ipps://test%20%40%20linux._ipps._tcp.local/cups printer-info='test @ linux' printer-make-and-model='PostScript Printer' printer-type=25178190 $ lpstat -d no system default destination
It happens because because we use _cupsGetDests() in cupsSetDests2() for getting printers, but IPP_OP_GET_PRINTERS returns only permanent queues, thus cupsSetDests2() ends because it hits IPP_ERROR_NOT_FOUND. I'm on the way with fix - I was able to set the default destination when I use cupsGetDests2() instead of _cupsGetDests(), but I was not able to remove the settings with lpoptions -x test_linux - I will look into it further.
This is likely a timing issue, but I'd be interested in seeing what "lpstat -p" shows after running the lpoptions command. IPP_OP_CUPS_GET_PRINTERS (CUPS-Get-Printers) returns temporary queues that have been created with CUPS-Create-Local-Printer but haven't "expired"...
@zdohnal Ping, just trying to close the loop on this...
I'm sorry for being late:
[root@default-0 tree]# lpstat -a
lpstat: No destinations added.
root@default-0 tree]# lpstat -e
test_default_0
[root@default-0 tree]# lpoptions -d test_default_0
device-uri=ipps://test%20%40%20default-0._ipps._tcp.local/cups printer-info='test @ default-0' printer-location printer-make-and-model='PostScript Printer' printer-type=25178190
[root@default-0 tree]# lpstat -d
no system default destination
[root@default-0 tree]# lpstat -p
lpstat: No destinations added.
CUPS 2.4.10