* factor comar stuff back into comariface
* implement configure pending
This commit is contained in:
+3
-3
@@ -35,7 +35,7 @@ import pisi.repodb
|
||||
import pisi.installdb
|
||||
from pisi.index import Index
|
||||
import pisi.cli
|
||||
|
||||
import pisi.comariface as comariface
|
||||
|
||||
class Error(pisi.Error):
|
||||
pass
|
||||
@@ -469,8 +469,8 @@ def configure_pending():
|
||||
order = G_f.topological_sort()
|
||||
order.reverse()
|
||||
print order
|
||||
#for x in order:
|
||||
|
||||
for x in order:
|
||||
comariface.run_postinstall(x)
|
||||
|
||||
def info(package):
|
||||
if package.endswith(ctx.const.package_prefix):
|
||||
|
||||
@@ -291,14 +291,8 @@ class PackageOp(Command):
|
||||
|
||||
def finalize(self):
|
||||
#self.finalize_db()
|
||||
if not self.options.ignore_comar:
|
||||
pass
|
||||
#try:
|
||||
# pisi.comariface.finalize()
|
||||
#except pisi.comariface.ComarError:
|
||||
# ui.error('Comar error encountered\n')
|
||||
pass
|
||||
|
||||
|
||||
class Install(PackageOp):
|
||||
"""Install PISI packages
|
||||
|
||||
|
||||
+6
-5
@@ -9,13 +9,14 @@
|
||||
#
|
||||
# Please read the COPYING file.
|
||||
#
|
||||
|
||||
# PISI Configuration module is used for gathering and providing
|
||||
# regular PISI configurations.
|
||||
|
||||
# Authors: Baris Metin <baris@uludag.org.tr
|
||||
# Authors: Baris Metin <baris@uludag.org.tr>
|
||||
# Eray Ozkural <eray@uludag.org.tr>
|
||||
|
||||
"""
|
||||
PISI Configuration module is used for gathering and providing
|
||||
regular PISI configurations.
|
||||
"""
|
||||
|
||||
import gettext
|
||||
__trans = gettext.translation('pisi', fallback=True)
|
||||
_ = __trans.ugettext
|
||||
|
||||
+3
-22
@@ -29,6 +29,7 @@ import pisi.operations as operations
|
||||
from pisi.specfile import *
|
||||
from pisi.package import Package
|
||||
from pisi.metadata import MetaData
|
||||
import pisi.comariface as comariface
|
||||
#import conflicts
|
||||
|
||||
class InstallError(pisi.Error):
|
||||
@@ -58,7 +59,7 @@ class Installer:
|
||||
self.store_pisi_files()
|
||||
if ctx.comard:
|
||||
self.register_comar_scripts()
|
||||
self.comar_run_postinstall()
|
||||
comariface.run_postinstall(self.pkginfo.name)
|
||||
self.update_databases()
|
||||
|
||||
def check_requirements(self):
|
||||
@@ -165,7 +166,7 @@ class Installer:
|
||||
ctx.ui.info(_('Storing %s, ') % ctx.const.files_xml)
|
||||
self.package.extract_file(ctx.const.files_xml, self.package.pkg_dir())
|
||||
|
||||
ctx.ui.info(_('%s.') % ctx.const.metadata_xml)
|
||||
ctx.ui.info(_('Storing %s.') % ctx.const.metadata_xml)
|
||||
self.package.extract_file(ctx.const.metadata_xml, self.package.pkg_dir())
|
||||
|
||||
for pcomar in self.metadata.package.providesComar:
|
||||
@@ -195,26 +196,6 @@ class Installer:
|
||||
raise InstallError, _("COMAR.register ERROR!")
|
||||
|
||||
|
||||
def comar_run_postinstall(self):
|
||||
"run postinstall scripts trough COMAR"
|
||||
|
||||
com = ctx.comard
|
||||
ctx.ui.info(_("Running postinstall script for %s") % self.metadata.package.name)
|
||||
com.call_package("System.Package.postInstall", self.metadata.package.name)
|
||||
while 1:
|
||||
reply = com.read_cmd()
|
||||
if reply[0] == com.RESULT:
|
||||
break
|
||||
elif reply[0] == com.NONE: # package has no postInstall script
|
||||
break
|
||||
elif reply[0] == com.FAIL:
|
||||
e = _("COMAR.call_package(System.Pakcage.postInstall, %s) failed!: %s") % (
|
||||
self.metadata.package.name, reply[2])
|
||||
raise InstallError, e
|
||||
else:
|
||||
raise InstallError, _("COMAR.call_package ERROR: %d") % reply[0]
|
||||
|
||||
|
||||
def update_databases(self):
|
||||
"update databases"
|
||||
|
||||
|
||||
+3
-12
@@ -18,6 +18,7 @@ import pisi.context as ctx
|
||||
import pisi.util as util
|
||||
import pisi.packagedb as packagedb
|
||||
from pisi.uri import URI
|
||||
import pisi.comariface as comariface
|
||||
|
||||
# single package operations
|
||||
|
||||
@@ -42,22 +43,12 @@ def remove_file(fileinfo):
|
||||
ctx.ui.warning('Not removing non-file, non-link %d' % fpath)
|
||||
|
||||
def run_preremove(package_name):
|
||||
|
||||
if ctx.comard:
|
||||
com = ctx.comard
|
||||
|
||||
# TODO: run preremove scripts...
|
||||
# com.call("System.Package", "preremove")
|
||||
com.remove(package_name)
|
||||
while 1:
|
||||
reply = com.read_cmd()
|
||||
if reply[0] == com.RESULT:
|
||||
break
|
||||
elif reply[1] == com.ERROR:
|
||||
raise Error, "COMAR.remove failed!"
|
||||
comariface.run_preremove(package_name)
|
||||
else:
|
||||
# TODO: store this somewhere
|
||||
pass
|
||||
|
||||
def remove_db(package_name):
|
||||
ctx.installdb.remove(package_name)
|
||||
packagedb.remove_package(package_name) #FIXME: this looks like a mistake!
|
||||
|
||||
Reference in New Issue
Block a user