]> git.tdb.fi Git - builder.git/commitdiff
Collapse the virtual functions used during package preparation into one
authorMikko Rasa <tdb@tdb.fi>
Mon, 23 Jul 2012 10:27:21 +0000 (13:27 +0300)
committerMikko Rasa <tdb@tdb.fi>
Mon, 23 Jul 2012 10:27:21 +0000 (13:27 +0300)
source/binarypackage.cpp
source/binarypackage.h
source/package.cpp
source/package.h
source/sourcepackage.cpp
source/sourcepackage.h

index 381e792681abfbee7e78163753e397c6f5a68d5a..a167269290dcd24d69a3f37b2879584a53ccdd85 100644 (file)
@@ -12,7 +12,7 @@ BinaryPackage::BinaryPackage(Builder &b, const string &n):
        use_pkgconfig = false;
 }
 
-void BinaryPackage::create_build_info()
+void BinaryPackage::do_prepare()
 {
        for(BuildInfo::PathList::iterator i=export_binfo.incpath.begin(); i!=export_binfo.incpath.end(); ++i)
                if((*i)[0]=="@")
index cb054053b62d56d98eb65bc401a12ddbf01b988d..088c3e1eac2264dc94cf3a96de0a3e11b4947e30 100644 (file)
@@ -22,7 +22,7 @@ public:
 
        static BinaryPackage *from_flags(Builder &, const std::string &, const std::vector<std::string> &);
 private:
-       virtual void create_build_info();
+       virtual void do_prepare();
 };
 
 #endif
index 22d19983cbc0574c5d2aae2fc68dd80cc192c5d5..44444add8b04acb641d97fcccff567b4c74dae87 100644 (file)
@@ -25,8 +25,7 @@ void Package::prepare()
        for(PackageList::const_iterator i=requires.begin(); i!=requires.end(); ++i)
                (*i)->prepare();
 
-       create_build_info();
-       create_targets();
+       do_prepare();
        prepared = true;
 }
 
index 4d4012589b82ed71920efe93240a24b3bb0be757..8811390601c39ef2aa05b1ed201c7588ec667c34 100644 (file)
@@ -57,13 +57,12 @@ public:
        packages, populates build info and creates targets. */
        void prepare();
 
-       bool is_prepared() const { return prepared; }
 protected:
-       virtual void create_build_info() { }
-
-       virtual void create_targets() { }
+       virtual void do_prepare() { }
 
 public:
+       bool is_prepared() const { return prepared; }
+
        virtual void save_caches() { }
 };
 
index 94bb4ba9c0321b7a726e43e21c4552e8baaff3a4..77440d6057112bf013a41c1b221ff7b924a6372c 100644 (file)
@@ -68,7 +68,7 @@ FS::Path SourcePackage::get_out_dir() const
                return source_dir/arch.get_name();
 }
 
-void SourcePackage::create_build_info()
+void SourcePackage::do_prepare()
 {
        BuildInfo final_build_info;
 
@@ -103,10 +103,7 @@ void SourcePackage::create_build_info()
                export_binfo.incpath.push_back((builder.get_prefix()/"include").str());
                export_binfo.libpath.push_back((builder.get_prefix()/"lib").str());
        }
-}
 
-void SourcePackage::create_targets()
-{
        cache.load();
 
        bool pc_needed = false;
index 2f6a9a11e79c1632f3107c59eb6f62d58d983066..f2740199387110add553ffe021c51ef8014f8ecb 100644 (file)
@@ -85,9 +85,7 @@ public:
 
        Cache &get_cache() const { return cache; }
 private:
-       virtual void create_build_info();
-
-       virtual void create_targets();
+       virtual void do_prepare();
 
        virtual void save_caches();
 };