def writeConfigFile(self):
        util.mkdirChain(os.path.dirname(self.configFile))
        acls = self.getAcls()
        # Determine libdir
        from distutils import sysconfig
        libdir = sysconfig.get_config_vars()['LIBDIR']

        for name in ('basic_ncsa_auth', 'ncsa_auth'):
            authprog = os.path.join(libdir, 'squid', name)
            if os.path.exists(authprog):
                break
        else:
            raise RuntimeError("Couldn't find basic_ncsa_auth for squid")

        opts = dict(port = self.port, authPort = self.authPort,
                    cacheDir = self.cacheDir,
                    accessLog = self.accessLog, storeLog = self.storeLog,
                    cacheLog = self.cacheLog, pidFile = self.pidFile,
                    passwdFile = self.authPasswdFile,
                    acls = "\n".join(acls),
                    libdir = libdir,
                    user = os_utils.effectiveUser,
                    group = os_utils.effectiveGroup,
                    authprog = authprog,
                    )
        open(self.configFile, "w+").write(opts % self.configTemplate)

        # Write password file too
        open(self.authPasswdFile, "w").write("rpath:IOiVc37UsPIV2\n")
dataset/ETHPy150Open sassoftware/conary/conary_test/rephelp.py/HTTPProxy.writeConfigFile/swapped operands of `%`