From: Mikko Rasa Date: Mon, 23 Jul 2012 10:27:21 +0000 (+0300) Subject: Collapse the virtual functions used during package preparation into one X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=592fa2bca4e973678cbdc86802fe1c151b40e04d;p=builder.git Collapse the virtual functions used during package preparation into one --- diff --git a/source/binarypackage.cpp b/source/binarypackage.cpp index 381e792..a167269 100644 --- a/source/binarypackage.cpp +++ b/source/binarypackage.cpp @@ -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]=="@") diff --git a/source/binarypackage.h b/source/binarypackage.h index cb05405..088c3e1 100644 --- a/source/binarypackage.h +++ b/source/binarypackage.h @@ -22,7 +22,7 @@ public: static BinaryPackage *from_flags(Builder &, const std::string &, const std::vector &); private: - virtual void create_build_info(); + virtual void do_prepare(); }; #endif diff --git a/source/package.cpp b/source/package.cpp index 22d1998..44444ad 100644 --- a/source/package.cpp +++ b/source/package.cpp @@ -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; } diff --git a/source/package.h b/source/package.h index 4d40125..8811390 100644 --- a/source/package.h +++ b/source/package.h @@ -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() { } }; diff --git a/source/sourcepackage.cpp b/source/sourcepackage.cpp index 94bb4ba..77440d6 100644 --- a/source/sourcepackage.cpp +++ b/source/sourcepackage.cpp @@ -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; diff --git a/source/sourcepackage.h b/source/sourcepackage.h index 2f6a9a1..f274019 100644 --- a/source/sourcepackage.h +++ b/source/sourcepackage.h @@ -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(); };