From b314d1f7c1c9c42cf3a52b99a2f09dec443b62bd Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Sun, 18 Sep 2022 20:47:43 -0400 Subject: wrap: Set self.directory only once It can wait until after parsing the wrap file to set it. --- mesonbuild/wrap/wrap.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'mesonbuild/wrap') 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: -- cgit v1.1