]> git.tdb.fi Git - builder.git/commitdiff
Rename create_targets to prepare_build and make it return bool
authorMikko Rasa <tdb@tdb.fi>
Mon, 16 Jul 2012 19:23:00 +0000 (22:23 +0300)
committerMikko Rasa <tdb@tdb.fi>
Mon, 16 Jul 2012 19:27:36 +0000 (22:27 +0300)
source/builder.cpp
source/builder.h

index c86c5dadaf9ffa2671abf97d73b557b7587fd12d..122e1b901e011d6abafd8ea86789b86e66bb628e 100644 (file)
@@ -274,7 +274,7 @@ int Builder::main()
        if(conf_only)
                return 0;
 
-       if(create_targets())
+       if(!prepare_build())
                return 1;
 
        logger.log("environment", format("Building on %s, for %s%s", native_arch.get_name(),
@@ -395,7 +395,7 @@ int Builder::load_build_file(const FS::Path &fn)
        return 0;
 }
 
-int Builder::create_targets()
+bool Builder::prepare_build()
 {
        Target *world = new VirtualTarget(*this, "world");
 
@@ -422,7 +422,7 @@ int Builder::create_targets()
                if(!tgt)
                {
                        IO::print("I don't know anything about %s\n", *i);
-                       return -1;
+                       return false;
                }
 
                cmdline->add_depend(*tgt);
@@ -437,7 +437,7 @@ int Builder::create_targets()
                if(!tgt)
                {
                        IO::print(IO::cerr, "Unknown what-if target %s\n", *i);
-                       return -1;
+                       return false;
                }
                tgt->touch();
        }
@@ -456,7 +456,7 @@ int Builder::create_targets()
                        i->second->save_caches();
        }
 
-       return 0;
+       return true;
 }
 
 int Builder::do_build()
index 943c8513cb5a90deb60173f5b29f164756836fb8..9f792f828c78a3d4b0c327aa1d13868fcf6d7aac 100644 (file)
@@ -128,10 +128,10 @@ public:
        int load_build_file(const Msp::FS::Path &);
 
 private:
-       /** Creates targets for all packages and prepares them for building.
-       Returns 0 if everything went ok, -1 if something bad happened and a build
-       shouldn't be attempted. */
-       int create_targets();
+       /** Prepares packages and targets for building.  Returns true if everything
+       went ok, or false if something bad happened and a build shouldn't be
+       attempted. */
+       bool prepare_build();
 
        /** Supervises the build process, starting new actions when slots become
        available. */