aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/wrap
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2022-09-18 20:47:43 -0400
committerEli Schwartz <eschwartz93@gmail.com>2022-09-28 00:17:42 -0400
commitb314d1f7c1c9c42cf3a52b99a2f09dec443b62bd (patch)
treec10bef9ac3826c45935c3a7beb971eaa25a30038 /mesonbuild/wrap
parent2a262d2936178a13abae2b25135a3f584d0033f6 (diff)
downloadmeson-b314d1f7c1c9c42cf3a52b99a2f09dec443b62bd.zip
meson-b314d1f7c1c9c42cf3a52b99a2f09dec443b62bd.tar.gz
meson-b314d1f7c1c9c42cf3a52b99a2f09dec443b62bd.tar.bz2
wrap: Set self.directory only once
It can wait until after parsing the wrap file to set it.
Diffstat (limited to 'mesonbuild/wrap')
-rw-r--r--mesonbuild/wrap/wrap.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/mesonbuild/wrap/wrap.py b/mesonbuild/wrap/wrap.py
index 3e2449f..9501835 100644
--- a/mesonbuild/wrap/wrap.py
+++ b/mesonbuild/wrap/wrap.py
@@ -124,7 +124,6 @@ class PackageDefinition:
self.basename = os.path.basename(fname)
self.has_wrap = self.basename.endswith('.wrap')
self.name = self.basename[:-5] if self.has_wrap else self.basename
- self.directory = self.name
# must be lowercase for consistency with dep=variable assignment
self.provided_deps[self.name.lower()] = None
# What the original file name was before redirection
@@ -132,9 +131,9 @@ class PackageDefinition:
self.redirected = False
if self.has_wrap:
self.parse_wrap()
- self.directory = self.values.get('directory', self.name)
with open(fname, 'r', encoding='utf-8') as file:
self.wrapfile_hash = hashlib.sha256(file.read().encode('utf-8')).hexdigest()
+ self.directory = self.values.get('directory', self.name)
if os.path.dirname(self.directory):
raise WrapException('Directory key must be a name and not a path')
if self.type and self.type not in ALL_TYPES: