From d74e7d3fa693eb7037a57dfbd0c47bc53255316f Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Thu, 7 Aug 2014 12:04:06 -0500 Subject: wic: Remove unused conf support Also fix up users such as imager functions. (From OE-Core rev: eb77b9c11bd9b8dc90aacfbd5b5bc5568a233525) Signed-off-by: Tom Zanussi Signed-off-by: Richard Purdie --- scripts/lib/mic/utils/misc.py | 48 +------------------------------------------ 1 file changed, 1 insertion(+), 47 deletions(-) (limited to 'scripts/lib/mic/utils/misc.py') diff --git a/scripts/lib/mic/utils/misc.py b/scripts/lib/mic/utils/misc.py index 010b16ca49..194b88f691 100644 --- a/scripts/lib/mic/utils/misc.py +++ b/scripts/lib/mic/utils/misc.py @@ -19,11 +19,6 @@ import os import sys import time -from mic import msger -from mic.utils.errors import CreatorError -from mic.utils.fs_related import find_binary_path, makedirs -from mic.utils import runner - def build_name(kscfg, release=None, prefix = None, suffix = None): """Construct and return an image name string. @@ -60,46 +55,5 @@ def build_name(kscfg, release=None, prefix = None, suffix = None): suffix = "-%s" % suffix if suffix else "" ret = prefix + name + suffix - return ret - -def normalize_ksfile(ksconf, release, arch): - ''' - Return the name of a normalized ks file in which macro variables - @BUILD_ID@ and @ARCH@ are replace with real values. - - The original ks file is returned if no special macro is used, otherwise - a temp file is created and returned, which will be deleted when program - exits normally. - ''' - - if not release: - release = "latest" - if not arch or re.match(r'i.86', arch): - arch = "ia32" - - with open(ksconf) as f: - ksc = f.read() - - if "@ARCH@" not in ksc and "@BUILD_ID@" not in ksc: - return ksconf - msger.info("Substitute macro variable @BUILD_ID@/@ARCH@ in ks: %s" % ksconf) - ksc = ksc.replace("@ARCH@", arch) - ksc = ksc.replace("@BUILD_ID@", release) - - fd, ksconf = tempfile.mkstemp(prefix=os.path.basename(ksconf)) - os.write(fd, ksc) - os.close(fd) - - msger.debug('normalized ks file:%s' % ksconf) - - def remove_temp_ks(): - try: - os.unlink(ksconf) - except OSError, err: - msger.warning('Failed to remove temp ks file:%s:%s' % (ksconf, err)) - - import atexit - atexit.register(remove_temp_ks) - - return ksconf + return ret -- cgit v1.2.3-54-g00ecf