* fix: import config bug
- changing ref of a singleton: not a good idea after all!
This commit is contained in:
@@ -66,7 +66,7 @@ class Command(object):
|
||||
self.args = args[1:]
|
||||
|
||||
# initialize PiSi
|
||||
print '**** running cmd'
|
||||
#print '**** running cmd'
|
||||
pisi.config.config = pisi.config.Config(self.options)
|
||||
cli = pisi.ui.CLI(self.options.debug)
|
||||
pisi.ui.ui = cli
|
||||
@@ -200,7 +200,6 @@ repositories (with add-repo).
|
||||
"""
|
||||
def __init__(self):
|
||||
super(Install, self).__init__()
|
||||
print pisi.config.config.options
|
||||
|
||||
def run(self):
|
||||
if not self.args:
|
||||
|
||||
@@ -23,8 +23,6 @@ class Config(object):
|
||||
"""Config Singleton"""
|
||||
|
||||
def __init__(self, options = None):
|
||||
if options:
|
||||
print 'wohoo', options
|
||||
self.options = options
|
||||
self.values = ConfigurationFile("/etc/pisi/pisi.conf")
|
||||
self.destdir = self.values.general.destinationdirectory
|
||||
|
||||
+3
-1
@@ -153,12 +153,14 @@ class Installer:
|
||||
def update_databases(self):
|
||||
"update databases"
|
||||
|
||||
print "INSTALL", config.options, config.options.ignore_comar
|
||||
#print "INSTALL", config.options, config.options.ignore_comar
|
||||
|
||||
# installdb
|
||||
installdb.install(self.metadata.package.name,
|
||||
self.metadata.package.version,
|
||||
self.metadata.package.release)
|
||||
|
||||
#print "INSTALL2", config.options, config.options.ignore_comar
|
||||
|
||||
# installed packages
|
||||
inst_packagedb.add_package(self.pkginfo)
|
||||
|
||||
+8
-4
@@ -14,11 +14,12 @@
|
||||
#
|
||||
# Author: Eray Ozkural <eray@uludag.org.tr>
|
||||
|
||||
# System
|
||||
import os
|
||||
import fcntl
|
||||
|
||||
import os, fcntl
|
||||
# PiSi
|
||||
import lockeddbshelve as shelve
|
||||
|
||||
from config import config
|
||||
from constants import const
|
||||
from files import Files
|
||||
import util
|
||||
@@ -32,10 +33,12 @@ class InstallDB:
|
||||
from os.path import join
|
||||
self.d = shelve.LockedDBShelf('install')
|
||||
self.dp = shelve.LockedDBShelf('configpending')
|
||||
from config import config
|
||||
self.files_dir = os.path.join(config.db_dir(), 'files')
|
||||
|
||||
def files_name(self, pkg, version, release):
|
||||
from os.path import join
|
||||
from config import config
|
||||
pkg_dir = join(config.lib_dir(), pkg + '-' + version + '-' + release)
|
||||
return join(pkg_dir, const.files_xml)
|
||||
|
||||
@@ -87,7 +90,8 @@ class InstallDB:
|
||||
def install(self, pkg, version, release):
|
||||
"""install package with specific version and release"""
|
||||
pkg = str(pkg)
|
||||
print "INSTALLDB", config.options, config.options.ignore_comar
|
||||
from config import config
|
||||
#print "INSTALLDB", config.options#, config.options.ignore_comar
|
||||
if self.is_installed(pkg):
|
||||
raise InstallDBError("already installed")
|
||||
if config.options.ignore_comar:
|
||||
|
||||
Reference in New Issue
Block a user