Bug 134 : Fix charm copy from descriptor package

Signed-off-by: Philip Joseph <philip.joseph@riftio.com>
diff --git a/rwlaunchpad/plugins/rwlaunchpadtasklet/rift/package/package.py b/rwlaunchpad/plugins/rwlaunchpadtasklet/rift/package/package.py
index 355b23b..45d8ba8 100644
--- a/rwlaunchpad/plugins/rwlaunchpadtasklet/rift/package/package.py
+++ b/rwlaunchpad/plugins/rwlaunchpadtasklet/rift/package/package.py
@@ -314,7 +314,14 @@
                 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)