[jhbuild] jhbuild make: Support being run from subdirectories



commit 629b814acacded1c0c7f5f5d90dab20a2ce48ea6
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Nov 1 15:47:45 2011 -0400

    jhbuild make: Support being run from subdirectories
    
    If you're in a subdir of a module, make "jhbuild make" recognize this and
    build whatever module you're in without you having to cd ../.. or whatever
    
    https://bugzilla.gnome.org/show_bug.cgi?id=663189

 jhbuild/commands/make.py |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/jhbuild/commands/make.py b/jhbuild/commands/make.py
index ddba85c..49e128b 100644
--- a/jhbuild/commands/make.py
+++ b/jhbuild/commands/make.py
@@ -62,14 +62,14 @@ class cmd_make(Command):
 
         module_set = jhbuild.moduleset.load(config)
 
-        dirname,basename = os.path.split(cwd)
-        if not dirname.endswith('/'):
-            dirname = dirname + '/'
-        if not dirname.startswith(config.checkoutroot):
+        if not cwd.startswith(config.checkoutroot):
             logging.error(_('The current directory is not in the checkout root %r') % (config.checkoutroot, ))
             return False
 
-        name = os.path.basename(basename)
+        cwd = cwd[len(config.checkoutroot):]
+        cwd = cwd.lstrip(os.sep)
+        name, _slash, _rest = cwd.partition(os.sep)
+
         try:
             module = module_set.get_module(name, ignore_case=True)
         except KeyError, e:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]