summary refs log blame commit diff
path: root/pkgs/tools/misc/system-config-printer/detect_serverbindir.patch
blob: 2cd3058f233063a7d4ea002a06cfd60dc8758776 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
















                                                                
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