From 8e37f7619d824eef3d5f76a7255812364d689e2a Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 27 Oct 2026 15:25:41 -0400 Subject: [PATCH] Add error message to a build failure --- imgutil/imgutil | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/imgutil/imgutil b/imgutil/imgutil index 4ea3029e..98231046 100644 --- a/imgutil/imgutil +++ b/imgutil/imgutil @@ -776,7 +776,11 @@ class DebHandler(OsHandler): mydir = get_mydir(self.oscategory) srcdir = os.path.join(mydir, 'initramfs-tools') targdir = os.path.join(self.targpath, 'etc/initramfs-tools') - shutil.copytree(srcdir, targdir) + try: + shutil.copytree(srcdir, targdir) + except Exception: + sys.stderr.write('Target directory already exists, cannot build\n') + raise os.chmod(os.path.join(targdir, 'hooks/confluent'), 0o755) #cmd = ['debootstrap', '--include={0}'.format(','.join(self.includepkgs)), self.codename, self.targpath] if self.arch != os.uname().machine: