From 9699e250456fb19a5f8cff7b103198a4f4eea20c Mon Sep 17 00:00:00 2001 From: Will Woods Date: Wed, 7 Sep 2011 12:06:48 -0400 Subject: [PATCH] imgutils: make do_graft work for files too This is needed to make --icon work in mkefiboot --- src/pylorax/imgutils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pylorax/imgutils.py b/src/pylorax/imgutils.py index 08c3fb2b..04bc8696 100644 --- a/src/pylorax/imgutils.py +++ b/src/pylorax/imgutils.py @@ -22,6 +22,7 @@ logger = logging.getLogger("pylorax.imgutils") import os, tempfile from os.path import join, dirname +from pylorax.sysutils import cpfile from subprocess import * ######## Functions for making container images (cpio, squashfs) ########## @@ -127,7 +128,10 @@ def do_grafts(grafts, dest, preserve=True): targetdir = join(dest, dirname(imgpath)) if not os.path.isdir(targetdir): os.makedirs(targetdir) - copytree(filename, join(dest, imgpath), preserve) + if os.path.isdir(filename): + copytree(filename, join(dest, imgpath), preserve) + else: + cpfile(filename, join(dest, imgpath)) def round_to_blocks(size, blocksize): '''If size isn't a multiple of blocksize, round up to the next multiple'''