diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2022-09-18 20:47:43 -0400 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2022-09-28 00:17:42 -0400 |
commit | b314d1f7c1c9c42cf3a52b99a2f09dec443b62bd (patch) | |
tree | c10bef9ac3826c45935c3a7beb971eaa25a30038 /mesonbuild/wrap | |
parent | 2a262d2936178a13abae2b25135a3f584d0033f6 (diff) | |
download | meson-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.py | 3 |
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: |