diff options
author | Tom Zanussi <tom.zanussi@linux.intel.com> | 2014-08-07 12:04:06 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-08-11 10:52:18 +0100 |
commit | eb77b9c11bd9b8dc90aacfbd5b5bc5568a233525 (patch) | |
tree | 4e5c77cee3be7abf65875b4725e8e4cce739fdba /scripts/lib/mic/utils/misc.py | |
parent | dfa8626700269141f8d2f5be12c8758db7ca6473 (diff) | |
download | openembedded-core-eb77b9c11bd9b8dc90aacfbd5b5bc5568a233525.tar.gz openembedded-core-eb77b9c11bd9b8dc90aacfbd5b5bc5568a233525.tar.bz2 openembedded-core-eb77b9c11bd9b8dc90aacfbd5b5bc5568a233525.zip |
wic: Remove unused conf support
Also fix up users such as imager functions.
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Diffstat (limited to 'scripts/lib/mic/utils/misc.py')
-rw-r--r-- | scripts/lib/mic/utils/misc.py | 48 |
1 files changed, 1 insertions, 47 deletions
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 |