depot/third_party/nixpkgs/pkgs/tools/misc/system-config-printer/detect_serverbindir.patch
Default email 8ac5e011d6 Project import generated by Copybara.
GitOrigin-RevId: 2c3273caa153ee8eb5786bc8141b85b859e7efd7
2020-04-24 19:36:52 -04:00

17 lines
533 B
Diff

diff --git a/cupshelpers/config.py.in b/cupshelpers/config.py.in
index 55abbfc..1244327 100644
--- a/cupshelpers/config.py.in
+++ b/cupshelpers/config.py.in
@@ -22,3 +22,12 @@
prefix="@prefix@"
sysconfdir="@sysconfdir@"
cupsserverbindir="@cupsserverbindir@"
+
+try:
+ with open("/etc/cups/cups-files.conf") as config:
+ for cfgline in config:
+ args = cfgline.split(" ")
+ if len(args) == 2 and args[0] == "ServerBin":
+ cupsserverbindir = args[1].strip()
+except OSError:
+ pass