[jhbuild] jhbuild/commands/make: Compare canonical paths
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [jhbuild] jhbuild/commands/make: Compare canonical paths
- Date: Thu, 24 Mar 2022 12:47:36 +0000 (UTC)
commit 98ee53379bcc0d84c8f8bfd885324a85621abd2a
Author: Sebastian Wick <sebastian wick redhat com>
Date: Fri Jan 28 14:09:57 2022 +0100
jhbuild/commands/make: Compare canonical paths
`jhbuild make` tries to figure out which module to build by looking at
the current working directory relative to the checkout directory. The
paths can point to the same directory but not be prefixes of each other
if there is a symlink involved. Fix the issue by canonicalizing both the
CWD and the checkout path.
This fixes `toolbox run jhbuild make` on Silverblue.
jhbuild/commands/make.py | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/jhbuild/commands/make.py b/jhbuild/commands/make.py
index 5a0a0cfe..dd5ad762 100644
--- a/jhbuild/commands/make.py
+++ b/jhbuild/commands/make.py
@@ -51,7 +51,8 @@ class cmd_make(Command):
def run(self, config, options, args, help=None):
# Grab the cwd before anything changes it
- cwd = self.get_cwd()
+ cwd = os.path.realpath(self.get_cwd())
+ checkoutroot = os.path.realpath(config.checkoutroot)
# Explicitly don't touch the network for this
options.nonetwork = True
@@ -72,11 +73,11 @@ class cmd_make(Command):
module_set = jhbuild.moduleset.load(config)
- if not cwd.startswith(config.checkoutroot):
- logging.error(_('The current directory is not in the checkout root %r') % (config.checkoutroot,
))
+ if not cwd.startswith(checkoutroot):
+ logging.error(_('The current directory is not in the checkout root %r') % (checkoutroot, ))
return False
- cwd = cwd[len(config.checkoutroot):]
+ cwd = cwd[len(checkoutroot):]
cwd = cwd.lstrip(os.sep)
modname, _slash, _rest = cwd.partition(os.sep)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]