Can create a subdirectory for projects whose zip files do not have one.

pull/139/head
Jussi Pakkanen 10 years ago
parent b896af9c5f
commit 63d101674d
  1. 14
      wrap.py

@ -132,8 +132,18 @@ class Resolver:
pass
except ImportError:
pass
if os.path.isdir(os.path.join(self.subdir_root, package.get('directory'))):
target_dir = os.path.join(self.subdir_root, package.get('directory'))
if os.path.isdir(target_dir):
return
shutil.unpack_archive(os.path.join(self.cachedir, package.get('source_filename')), self.subdir_root)
extract_dir = self.subdir_root
# Some upstreams ship packages that do not have a leading directory.
# Create one for them.
try:
package.get('lead_directory_missing')
os.mkdir(target_dir)
extract_dir = target_dir
except KeyError:
pass
shutil.unpack_archive(os.path.join(self.cachedir, package.get('source_filename')), extract_dir)
if package.has_patch():
shutil.unpack_archive(os.path.join(self.cachedir, package.get('patch_filename')), self.subdir_root)

Loading…
Cancel
Save