* fix: set install pending only if there is indeed a Package.py
script
This commit is contained in:
@@ -81,10 +81,16 @@ class Install(AtomicOperation):
|
|||||||
if self.metadata.package.providesComar and ctx.comar:
|
if self.metadata.package.providesComar and ctx.comar:
|
||||||
import pisi.comariface as comariface
|
import pisi.comariface as comariface
|
||||||
self.register_comar_scripts()
|
self.register_comar_scripts()
|
||||||
ctx.ui.notify(pisi.ui.configuring, package = self.pkginfo, files = self.files)
|
|
||||||
comariface.run_postinstall(self.pkginfo.name)
|
|
||||||
ctx.ui.notify(pisi.ui.configured, package = self.pkginfo, files = self.files)
|
|
||||||
|
|
||||||
|
self.config_later = False
|
||||||
|
if 'Comar' in self.metadata.package.providesComar:
|
||||||
|
if ctx.comar:
|
||||||
|
ctx.ui.notify(pisi.ui.configuring, package = self.pkginfo, files = self.files)
|
||||||
|
comariface.run_postinstall(self.pkginfo.name)
|
||||||
|
ctx.ui.notify(pisi.ui.configured, package = self.pkginfo, files = self.files)
|
||||||
|
else:
|
||||||
|
self.config_later = True
|
||||||
|
|
||||||
txn = ctx.dbenv.txn_begin()
|
txn = ctx.dbenv.txn_begin()
|
||||||
try:
|
try:
|
||||||
self.update_databases(txn)
|
self.update_databases(txn)
|
||||||
@@ -243,6 +249,7 @@ class Install(AtomicOperation):
|
|||||||
self.metadata.package.release,
|
self.metadata.package.release,
|
||||||
self.metadata.package.build,
|
self.metadata.package.build,
|
||||||
self.metadata.package.distribution,
|
self.metadata.package.distribution,
|
||||||
|
self.config_later,
|
||||||
False,
|
False,
|
||||||
txn)
|
txn)
|
||||||
|
|
||||||
@@ -430,12 +437,13 @@ def virtual_install(metadata, files, txn):
|
|||||||
|
|
||||||
# installdb
|
# installdb
|
||||||
ctx.installdb.install(metadata.package.name,
|
ctx.installdb.install(metadata.package.name,
|
||||||
metadata.package.version,
|
metadata.package.version,
|
||||||
metadata.package.release,
|
metadata.package.release,
|
||||||
metadata.package.build,
|
metadata.package.build,
|
||||||
metadata.package.distribution,
|
metadata.package.distribution,
|
||||||
True,
|
False,
|
||||||
txn)
|
True,
|
||||||
|
txn)
|
||||||
|
|
||||||
# filesdb
|
# filesdb
|
||||||
ctx.filesdb.add_files(metadata.package.name, files, txn)
|
ctx.filesdb.add_files(metadata.package.name, files, txn)
|
||||||
|
|||||||
+6
-2
@@ -145,18 +145,22 @@ class InstallDB:
|
|||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def install(self, pkg, version, release, build, distro = "", rebuild=False, txn = None):
|
def install(self, pkg, version, release, build, distro = "",
|
||||||
|
config_later = False, rebuild=False, txn = None):
|
||||||
"""install package with specific version, release, build"""
|
"""install package with specific version, release, build"""
|
||||||
pkg = str(pkg)
|
pkg = str(pkg)
|
||||||
def proc(txn):
|
def proc(txn):
|
||||||
if self.is_installed(pkg, txn):
|
if self.is_installed(pkg, txn):
|
||||||
raise InstallDBError(_("Already installed"))
|
raise InstallDBError(_("Already installed"))
|
||||||
if ctx.config.get_option('ignore_comar'):
|
if config_later:
|
||||||
state = 'ip'
|
state = 'ip'
|
||||||
self.dp.put(pkg, True, txn)
|
self.dp.put(pkg, True, txn)
|
||||||
else:
|
else:
|
||||||
state = 'i'
|
state = 'i'
|
||||||
|
|
||||||
|
# FIXME: it might be more appropriate to pass date
|
||||||
|
# as an argument, or installation data afterwards
|
||||||
|
# to do this -- exa
|
||||||
if not rebuild:
|
if not rebuild:
|
||||||
import time
|
import time
|
||||||
ctime = time.localtime()
|
ctime = time.localtime()
|
||||||
|
|||||||
Reference in New Issue
Block a user