]> git.tdb.fi Git - builder.git/commitdiff
Add --no-externals option
authorMikko Rasa <tdb@tdb.fi>
Sat, 6 Feb 2010 07:31:38 +0000 (07:31 +0000)
committerMikko Rasa <tdb@tdb.fi>
Sat, 6 Feb 2010 07:31:38 +0000 (07:31 +0000)
source/builder.cpp
source/builder.h

index 17fbd32e2efece9636ea39f0ed05a589a572f8af..37ad766fe26c7a3ba501caef1c3217c730534a89 100644 (file)
@@ -85,6 +85,7 @@ Builder::Builder(int argc, char **argv):
        getopt.add_option('j', "jobs",       jobs,          GetOpt::REQUIRED_ARG).set_help("Run NUM commands at once, whenever possible.", "NUM");
        getopt.add_option('n', "dry-run",    dry_run,       GetOpt::NO_ARG).set_help("Don't actually do anything, only show what would be done.");
        getopt.add_option('v', "verbose",    verbose,       GetOpt::NO_ARG).set_help("Print more information about what's going on.");
+       getopt.add_option('x', "no-externals",  no_externals, GetOpt::NO_ARG).set_help("Do not load external source packages.");
        getopt.add_option('A', "conf-all",   conf_all,      GetOpt::NO_ARG).set_help("Apply configuration to all packages.");
        getopt.add_option('B', "build-all",  build_all,     GetOpt::NO_ARG).set_help("Build all targets unconditionally.");
        getopt.add_option('C', "chdir",      work_dir,      GetOpt::REQUIRED_ARG).set_help("Change to DIR before doing anything else.", "DIR");
@@ -340,12 +341,15 @@ Package *Builder::get_package(const string &name)
        if(i!=packages.end())
                return i->second;
 
-       FS::Path path = get_package_location(name);
-       if(!path.empty() && !load_build_file(path/"Build"))
+       if(!no_externals)
        {
-               i = packages.find(name);
-               if(i!=packages.end())
-                       return i->second;
+               FS::Path path = get_package_location(name);
+               if(!path.empty() && !load_build_file(path/"Build"))
+               {
+                       i = packages.find(name);
+                       if(i!=packages.end())
+                               return i->second;
+               }
        }
 
        Package *pkg = 0;
index 9dca6f025fceeb8bf8a010d8480dbfbfd5285895..6835299b4ac464807240565fd231731d80b2edd0 100644 (file)
@@ -71,6 +71,7 @@ private:
        SourcePackage *main_pkg;
        PathList pkg_path;
        PathList pkg_dirs;
+       bool no_externals;
 
        TargetMap targets;
        TargetList new_tgts;