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