From 2613ee7dd1c3037593d1969a378251900479fdeb Mon Sep 17 00:00:00 2001 From: Philip Joseph Date: Wed, 21 Dec 2016 16:08:31 +0530 Subject: [PATCH] Bug 134 : Fix charm copy from descriptor package Signed-off-by: Philip Joseph --- .../plugins/rwlaunchpadtasklet/rift/package/package.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/rwlaunchpad/plugins/rwlaunchpadtasklet/rift/package/package.py b/rwlaunchpad/plugins/rwlaunchpadtasklet/rift/package/package.py index 355b23b3..45d8ba8a 100644 --- a/rwlaunchpad/plugins/rwlaunchpadtasklet/rift/package/package.py +++ b/rwlaunchpad/plugins/rwlaunchpadtasklet/rift/package/package.py @@ -314,7 +314,14 @@ class DescriptorPackage(object): continue # Copy the contents of the file to the correct path - dest_file_path = os.path.join(dest_root_dir, filename) + # Remove the common prefix and create the dest filename + if src_dir is not None: + fname = filename[len(src_dir):] + if fname[0] == '/': + fname = fname[1:] + else: + fname = filename + dest_file_path = os.path.join(dest_root_dir, fname) dest_dir_path = os.path.dirname(dest_file_path) if not os.path.exists(dest_dir_path): os.makedirs(dest_dir_path) -- 2.25.1