import rpm
-from mic.utils.errors import *
-from mic.utils.fs_related import *
-from mic.utils.rpmmisc import *
-from mic.utils.misc import *
+from mic.utils.errors import CreatorError
+from mic.utils.misc import get_filesystem_avail, is_statically_linked,setup_qemu_emulator, create_release
+from mic.utils.fs_related import find_binary_path, makedirs, BindChrootMount
+from mic.utils import rpmmisc
from mic import kickstart
from mic import msger
break
def set_target_arch(self, arch):
- if arch not in arches.keys():
+ if arch not in rpmmisc.arches:
return False
+
self.target_arch = arch
if self.target_arch.startswith("arm"):
for dep in self._dep_checks:
excluded_packages = []
for rpm_path in self._get_local_packages():
rpm_name = os.path.basename(rpm_path)
- package_name = splitFilename(rpm_name)[0]
+ package_name = rpmmisc.splitFilename(rpm_name)[0]
excluded_packages += [package_name]
return excluded_packages
def __save_repo_keys(self, repodata):
if not repodata:
return None
+
gpgkeydir = "/etc/pki/rpm-gpg"
makedirs(self._instroot + gpgkeydir)
for repo in repodata:
"""
ksh = self.ks.handler
+ msger.info('Applying configurations ...')
try:
kickstart.LanguageConfig(self._instroot).apply(ksh.lang)
kickstart.KeyboardConfig(self._instroot).apply(ksh.keyboard)
import mic.utils.fs_related as fs_related
import mic.utils.misc as misc
from livecd import LiveCDImageCreator
-from mic.utils.errors import *
+from mic.utils.errors import CreatorError
from mic.utils.partitionedfs import PartitionedMount
from mic import msger
import os
import subprocess
+import shutil
from baseimager import BaseImageCreator
-from mic.utils.errors import *
-from mic.utils.fs_related import *
-from mic.utils.misc import *
+from mic.utils.errors import CreatorError
from mic import kickstart
+from mic import msger
+
+from mic.utils.fs_related import ExtDiskMount, BtrfsDiskMount, SparseLoopbackDisk
FSLABEL_MAXLEN = 32
"""The maximum string length supported for LoopImageCreator.fslabel."""
import urlgrabber.progress as progress
from baseimager import BaseImageCreator
from mic.utils.partitionedfs import PartitionedMount
-from mic.utils.errors import *
+from mic.utils.errors import CreatorError, MountError
from mic import kickstart
from mic import msger
-
class RawImageCreator(BaseImageCreator):
"""Installs a system into a file containing a partitioned disk image.
class KsError(CreatorError):
pass
+
class MountError(CreatorError):
pass
+
class SnapshotError(CreatorError):
pass
+
class SquashfsError(CreatorError):
pass
def _localprint(self, msg):
if self.output:
- print msg
+ msger.info(msg)
def _makefmt(self, percent, progress = True):
l = len(str(self.total_actions))
fmt = self._makefmt(percent)
msg = fmt % ("Installing")
if msg != self.lastmsg:
- sys.stdout.write(msg)
- sys.stdout.flush()
self.lastmsg = msg
+
+ msger.info(msg)
+
if self.total_installed == self.total_actions:
- msger.verbose('\n' + '\n'.join(self.logString))
+ msger.raw('\n')
+ msger.verbose('\n'.join(self.logString))
elif what == rpm.RPMCALLBACK_UNINST_START:
pass
elif what == rpm.RPMCALLBACK_REPACKAGE_START:
pass
+
elif what == rpm.RPMCALLBACK_REPACKAGE_STOP:
pass
+
elif what == rpm.RPMCALLBACK_REPACKAGE_PROGRESS:
pass
print "%d packages to be installed, %d packages gotten from cache, %d packages to be downloaded" % (total_count, cached_count, download_count)
try:
if download_count > 0:
- print "downloading packages..."
+ print "Downloading packages..."
self.downloadPkgs(dlpkgs, download_count)
self.installPkgs(dlpkgs)