From: Philip Joseph Date: Wed, 21 Dec 2016 10:38:31 +0000 (+0530) Subject: Bug 134 : Fix charm copy from descriptor package X-Git-Tag: v1.1.0~42 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F21%2F821%2F1;p=osm%2FSO.git Bug 134 : Fix charm copy from descriptor package Signed-off-by: Philip Joseph --- 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)