- remove redundant option postpone_postinstall
- make configure-pending work!
This commit is contained in:
+18
-10
@@ -146,24 +146,17 @@ def package_graph(A, ignore_installed = False):
|
||||
B = Bp
|
||||
return G_f
|
||||
|
||||
def postpone_postinstall(package):
|
||||
try:
|
||||
import pisi.comariface as comariface
|
||||
comariface.register(package)
|
||||
except ImportError:
|
||||
raise Error(_("COMAR: comard not fully installed"))
|
||||
|
||||
def configure_pending():
|
||||
# start with pending packages
|
||||
# configure them in reverse topological order of dependency
|
||||
A = ctx.installdb.list_pending()
|
||||
G_f = pgraph.PGraph(packagedb) # construct G_f
|
||||
for x in A:
|
||||
for x in A.keys():
|
||||
G_f.add_package(x)
|
||||
B = A
|
||||
while len(B) > 0:
|
||||
Bp = set()
|
||||
for x in B:
|
||||
for x in B.keys():
|
||||
pkg = packagedb.get_package(x)
|
||||
for dep in pkg.runtimeDependencies:
|
||||
if dep.package in G_f.vertices():
|
||||
@@ -176,7 +169,22 @@ def configure_pending():
|
||||
try:
|
||||
import pisi.comariface as comariface
|
||||
for x in order:
|
||||
comariface.run_postinstall(x)
|
||||
pkginfo = A[x]
|
||||
pkgname = util.package_name(x, pkginfo.version,
|
||||
pkginfo.release,
|
||||
pkginfo.build,
|
||||
False)
|
||||
pkg_path = util.join_path(ctx.config.lib_dir(),
|
||||
pkgname)
|
||||
m = MetaData()
|
||||
metadata_path = util.join_path(pkg_path, ctx.const.metadata_xml)
|
||||
m.read(metadata_path)
|
||||
for pcomar in m.package.providesComar:
|
||||
scriptPath = util.join_path(pkg_path,
|
||||
ctx.const.comar_dir,
|
||||
pcomar.script)
|
||||
comariface.register(pcomar, x, scriptPath)
|
||||
comariface.run_postinstall(x)
|
||||
ctx.installdb.clear_pending(x)
|
||||
except ImportError:
|
||||
raise Error(_("COMAR: comard not fully installed"))
|
||||
|
||||
@@ -87,8 +87,7 @@ class Install(AtomicOperation):
|
||||
if ctx.comar:
|
||||
import pisi.comariface as comariface
|
||||
self.register_comar_scripts()
|
||||
if not ctx.config.options.postpone_postinstall:
|
||||
comariface.run_postinstall(self.pkginfo.name)
|
||||
comariface.run_postinstall(self.pkginfo.name)
|
||||
self.update_databases()
|
||||
self.update_environment()
|
||||
ctx.ui.status()
|
||||
|
||||
@@ -361,8 +361,6 @@ class PackageOp(Command):
|
||||
p = self.parser
|
||||
p.add_option("-B", "--ignore-comar", action="store_true",
|
||||
default=False, help=_("bypass comar configuration agent"))
|
||||
p.add_option("", "--postpone-postinstall", action="store_true",
|
||||
default=False, help=_("Postpone postinstall script"))
|
||||
ignoredep_opt(self)
|
||||
|
||||
def init(self):
|
||||
@@ -871,8 +869,7 @@ class ListPending(Command):
|
||||
self.init(True)
|
||||
|
||||
list = ctx.installdb.list_pending()
|
||||
list.sort()
|
||||
for p in list:
|
||||
for p in list.keys():
|
||||
print p
|
||||
|
||||
self.finalize()
|
||||
|
||||
+5
-5
@@ -113,10 +113,11 @@ class InstallDB:
|
||||
return list
|
||||
|
||||
def list_pending(self):
|
||||
list = []
|
||||
dict = {}
|
||||
for (pkg, x) in self.dp.iteritems():
|
||||
list.append(pkg)
|
||||
return list
|
||||
pkginfo = self.d[pkg]
|
||||
dict[pkg] = pkginfo
|
||||
return dict
|
||||
|
||||
def get_info(self, pkg):
|
||||
pkg = str(pkg)
|
||||
@@ -140,8 +141,7 @@ class InstallDB:
|
||||
pkg = str(pkg)
|
||||
if self.is_installed(pkg):
|
||||
raise InstallDBError(_("Already installed"))
|
||||
if ctx.config.get_option('ignore_comar') or \
|
||||
ctx.config.get_option('postpone_postinstall'):
|
||||
if ctx.config.get_option('ignore_comar'):
|
||||
state = 'ip'
|
||||
self.dp[pkg] = True
|
||||
else:
|
||||
|
||||
+3
-2
@@ -486,11 +486,12 @@ def clean_locks(top = '.'):
|
||||
# Package/Repository Related Functions #
|
||||
########################################
|
||||
|
||||
def package_name(name, version, release, build):
|
||||
def package_name(name, version, release, build, prependSuffix=True):
|
||||
fn = name + '-' + version + '-' + release
|
||||
if build:
|
||||
fn += '-' + str(build)
|
||||
fn += ctx.const.package_suffix
|
||||
if prependSuffix:
|
||||
fn += ctx.const.package_suffix
|
||||
return fn
|
||||
|
||||
def is_package_name(fn, package_name = None):
|
||||
|
||||
Reference in New Issue
Block a user