for pkg in self._preinstall_pkgs:
pkg_manager.preInstall(pkg)
+ def __check_packages(self, pkg_manager):
+ for pkg in self.check_pkgs:
+ pkg_manager.checkPackage(pkg)
+
def __attachment_packages(self, pkg_manager):
if not self.ks:
return
self.__select_groups(pkg_manager)
self.__deselect_packages(pkg_manager)
self.__localinst_packages(pkg_manager)
+ self.__check_packages(pkg_manager)
BOOT_SAFEGUARD = 256L * 1024 * 1024 # 256M
checksize = self._root_fs_avail
self.__pkgs_license = {}
self.__pkgs_content = {}
self.__pkgs_vcsinfo = {}
+ self.check_pkgs = []
self.install_debuginfo = False
# FIXME: handle pre-install package
return None
+ def checkPackage(self, pkg):
+ self.check_pkgs.append(pkg)
+
def selectPackage(self, pkg):
"""Select a given package.
Can be specified with name.arch or name*
else:
self.__pkgs_license[license] = [pkg_long_name]
+ if pkg.name in self.check_pkgs:
+ self.check_pkgs.remove(pkg.name)
+
+ if self.check_pkgs:
+ raise CreatorError('Packages absent in image: %s' % ','.join(self.check_pkgs))
+
total_count = len(dlpkgs)
cached_count = 0
download_total_size = sum(map(lambda x: int(x.packagesize), dlpkgs))
self.incpkgs = {}
self.excpkgs = {}
self.pre_pkgs = []
+ self.check_pkgs = []
self.probFilterFlags = [ rpm.RPMPROB_FILTER_OLDPACKAGE,
rpm.RPMPROB_FILTER_REPLACEPKG ]
def preInstall(self, pkg):
self.pre_pkgs.append(pkg)
+ def checkPackage(self, pkg):
+ self.check_pkgs.append(pkg)
+
def runInstall(self, checksize = 0):
os.environ["HOME"] = "/"
os.environ["LD_PRELOAD"] = ""
todo = zypp.GetResolvablesToInsDel(self.Z.pool())
installed_pkgs = todo._toInstall
dlpkgs = []
+
for pitem in installed_pkgs:
if not zypp.isKindPattern(pitem) and \
not self.inDeselectPackages(pitem):
item = zypp.asKindPackage(pitem)
dlpkgs.append(item)
+ if item.name() in self.check_pkgs:
+ self.check_pkgs.remove(item.name())
+
if not self.install_debuginfo or str(item.arch()) == "noarch":
continue
msger.warning("No debuginfo rpm found for: %s" \
% item.name())
+ if self.check_pkgs:
+ raise CreatorError('Packages absent in image: %s' % ','.join(self.check_pkgs))
+
# record all pkg and the content
localpkgs = self.localpkgs.keys()
for pkg in dlpkgs: