junaidali / pharos-linux

Allows remote printing from linux client to pharos uniprint printing system
MIT License
18 stars 10 forks source link

Fixes issues with installation on Linux distros that do not install CUPS backends to /usr/lib/cups/backends/ #5

Closed dhmeves closed 7 years ago

dhmeves commented 7 years ago

Contribution by: Nash Kaminski & Daniel Meves @nkaminski as second contributor - consult either of us for clarification of this logic

Overview: By default, certain distros such as Gentoo (kernel 4.9.0 - test platform) install CUPS backends to /usr/libexec/cups/backends/. This breaks compatibility with the pharos-linux installer. We added a simple check for the existence of the backendDIR before trying this alternate path. Unix file hierarchy standard specifies both lib and libexec as acceptable paths.

Added similar check for the existence of regular files in /home instead of the needed directories. An example is the existence of /home/.keep/. On the test platform (Gentoo 4.9.0), this path was a file but the installer required that it be a directory. The intended behavior is to skip this loop iteration should the directory not exist.

Line 73 in pharos was edited to allow the correct number of argv indexes (6 or 7). Fix allows compatibility with all currently released versions of CUPS. This bug was discovered when troubleshooting the pharos CUPS backend, following this wiki entry:

https://wiki.debian.org/Dissecting%20and%20Debugging%20the%20CUPS%20Printing%20System#Testing_a_Backend_and_a_Printer

Changed line 98 of pharos because CUPS_BACKEND_STOP unconditionally pauses the print queue. CUPS_BACKEND_FAILED allows CUPS to recover from a temporary error, as defined in the CUPS error policy.

Also fixed a spelling typo on line 119 of setup.py.

Feedback is always welcome. Please consider these changes!

nkaminski commented 7 years ago

Myself and Dan did test a clean install of the package and test of basic printing functionality post-modification as a simple regression test. l during which no unwanted behavior was observed. Are there any other specific cases that you would advise testing or that have been sources of issues in the past?

On January 18, 2017 3:56:49 PM CST, Junaid Ali notifications@github.com wrote:

junaidali approved this pull request.

Thank you for your contribution. I haven't got around to testing it myself but the code looks good, so I'll merge it.

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/junaidali/pharos-linux/pull/5#pullrequestreview-17335622

-- Sent from my Android device with K-9 Mail.

junaidali commented 7 years ago

Usually I'll check with an existing user (that existed before the package was installed) and by creating a new user to see if everything works fine. Thanks.