wrap: Fix crash with file based wraps

Add unit test to avoid regressions in the future.
pull/4401/head
Xavier Claessens 6 years ago committed by Jussi Pakkanen
parent 1a2f5b3bc8
commit adb9fdef3a
  1. 6
      mesonbuild/wrap/wrap.py
  2. 1
      test cases/common/158 wrap file should not failed/meson.build
  3. 11
      test cases/common/158 wrap file should not failed/subprojects/foo.wrap
  4. BIN
      test cases/common/158 wrap file should not failed/subprojects/packagecache/foo-1.0-patch.tar.xz
  5. BIN
      test cases/common/158 wrap file should not failed/subprojects/packagecache/foo-1.0.tar.xz

@ -198,7 +198,7 @@ class Resolver:
raise WrapException(m.format(out))
def get_file(self):
path = self.get_file_internal(self.wrap, 'source')
path = self.get_file_internal('source')
extract_dir = self.subdir_root
# Some upstreams ship packages that do not have a leading directory.
# Create one for them.
@ -319,8 +319,8 @@ class Resolver:
self.download(what, cache_path)
return cache_path
def apply_patch(self, p):
path = self.get_file_internal(p, 'patch')
def apply_patch(self):
path = self.get_file_internal('patch')
try:
shutil.unpack_archive(path, self.subdir_root)
except Exception:

@ -3,6 +3,7 @@ project('mainproj', 'c',
)
subproject('zlib')
subproject('foo')
executable('grabprog', files('src/subprojects/prog.c'))
executable('grabprog2', files('src/subprojects/foo/prog2.c'))

@ -0,0 +1,11 @@
[wrap-file]
directory = foo-1.0
source_url = http://something.invalid
source_filename = foo-1.0.tar.xz
source_hash = ae5fc03185654f76b459db16ca25809703f8821aeb39a433902244bb479c4b79
lead_directory_missing = true
patch_url = https://something.invalid/patch
patch_filename = foo-1.0-patch.tar.xz
patch_hash = 8f2e286a4b190228d4e0c25ddc91195449cfb5e5c52006355838964b244037da
Loading…
Cancel
Save