summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2020-01-21 02:15:24 +0530
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2020-02-04 21:49:45 +0000
commit2ad7a9437f384cd3a6287bbc86edc576ed91c812 (patch)
tree19768fa67afe8b9bed821aee7f86fa3ab7bb04fb
parentbd24cb0205984ec14dd0fba9fb78f15ccdaba7cd (diff)
cerbero/filesprovider: Be stricter when finding plugin DLLs
Do not look for a `libfoo.dll` plugin when the recipe has been built with MSVC. This avoids incorrect packaging when the prefix is dirty due to user error.
-rw-r--r--cerbero/build/filesprovider.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/cerbero/build/filesprovider.py b/cerbero/build/filesprovider.py
index 5affa36a..9c6a9325 100644
--- a/cerbero/build/filesprovider.py
+++ b/cerbero/build/filesprovider.py
@@ -301,11 +301,15 @@ class FilesProvider(object):
# Plugin template is always libfoo%(mext)s
if not f.startswith('lib'):
raise AssertionError('Plugin files must start with "lib": {!r}'.format(f))
- # Plugin DLLs are required to be libfoo.dll (mingw) or foo.dll (msvc)
- if (Path(self.config.prefix) / f).is_file():
- # libfoo.dll
- return [f]
- if self.using_msvc():
+ # The actual filenames we select are stricter to avoid picking up the
+ # wrong DLLs in case the prefix is dirty.
+ if not self.using_msvc():
+ # Plugin DLLs are required to be libfoo.dll when the recipe uses MinGW
+ if (Path(self.config.prefix) / f).is_file():
+ # libfoo.dll
+ return [f]
+ else:
+ # Plugin DLLs are required to be foo.dll when the recipe uses MSVC
fdir, fname = os.path.split(f)
fmsvc = '{}/{}'.format(fdir, fname[3:])
if (Path(self.config.prefix) / fmsvc).is_file():