$OpenBSD: patch-installer_pluginhandler_py,v 1.7 2021/05/15 17:06:01 ajacoutot Exp $

Index: installer/pluginhandler.py
--- installer/pluginhandler.py.orig
+++ installer/pluginhandler.py
@@ -42,7 +42,7 @@ except ImportError:
         return sha.new(s).hexdigest()
 
 
-PLUGIN_STATE_FILE = '/var/lib/hp/hplip.state'
+PLUGIN_STATE_FILE = '/var/db/hp/hplip.state'
 PLUGIN_FALLBACK_LOCATION = 'https://developers.hp.com/sites/default/files/'
 
 
@@ -97,11 +97,11 @@ class PluginHandle(object):
             ARCH = 'x86_%d' % BITNESS
 
         if BITNESS == 64:
-            SANELIBDIR = '/usr/lib64/sane'
-            LIBDIR = '/usr/lib64'
+            SANELIBDIR = '${LOCALBASE}/lib/sane'
+            LIBDIR = '${LOCALBASE}/lib'
         else:
-            SANELIBDIR = '/usr/lib/sane'
-            LIBDIR = '/usr/lib'
+            SANELIBDIR = '${LOCALBASE}/lib/sane'
+            LIBDIR = '${LOCALBASE}/lib'
 
         copies = []
 
@@ -239,8 +239,8 @@ class PluginHandle(object):
     def __setPluginConfFile(self):
         home = sys_conf.get('dirs', 'home')
 
-        if os.path.exists('/etc/hp/plugin.conf'):
-            self.__plugin_conf_file = "file:///etc/hp/plugin.conf"
+        if os.path.exists('${SYSCONFDIR}/hp/plugin.conf'):
+            self.__plugin_conf_file = "file://${SYSCONFDIR}/hp/plugin.conf"
 
         elif os.path.exists(os.path.join(home, 'plugin.conf')):
             self.__plugin_conf_file = "file://" + os.path.join(home, 'plugin.conf')
