From 766dad2d4f7ca73dc182f22e306ba0def6fd8722 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 14 Apr 2013 15:21:36 +0300 Subject: [PATCH] Reorder functions --- source/component.cpp | 18 +++++++++--------- source/component.h | 6 +++--- source/package.h | 2 +- source/sourcepackage.cpp | 10 +++++----- source/sourcepackage.h | 7 +++++-- 5 files changed, 23 insertions(+), 20 deletions(-) diff --git a/source/component.cpp b/source/component.cpp index 5104cdf..48675f7 100644 --- a/source/component.cpp +++ b/source/component.cpp @@ -254,6 +254,11 @@ Component::Loader::Loader(Component &c): add("use", &Loader::use); } +void Component::Loader::build_info() +{ + load_sub(obj.build_info); +} + void Component::Loader::if_arch(const string &cond) { bool match = obj.package.get_builder().get_current_arch().match_name(cond); @@ -272,9 +277,9 @@ void Component::Loader::if_feature(const string &cond) load_sub_with(*this); } -void Component::Loader::source(const string &s) +void Component::Loader::install_map() { - obj.sources.push_back((obj.package.get_source_directory()/s).str()); + load_sub(obj.install_map, obj.package.get_source_directory()); } void Component::Loader::require(const string &n) @@ -284,14 +289,9 @@ void Component::Loader::require(const string &n) obj.requires.push_back(req); } -void Component::Loader::build_info() -{ - load_sub(obj.build_info); -} - -void Component::Loader::install_map() +void Component::Loader::source(const string &s) { - load_sub(obj.install_map, obj.package.get_source_directory()); + obj.sources.push_back((obj.package.get_source_directory()/s).str()); } void Component::Loader::use(const string &n) diff --git a/source/component.h b/source/component.h index 83a8baa..044c5ba 100644 --- a/source/component.h +++ b/source/component.h @@ -24,12 +24,12 @@ public: public: Loader(Component &); private: + void build_info(); void if_arch(const std::string &); void if_feature(const std::string &); - void source(const std::string &); - void require(const std::string &); - void build_info(); void install_map(); + void require(const std::string &); + void source(const std::string &); void use(const std::string &); }; diff --git a/source/package.h b/source/package.h index 3a7ba3a..aed1fd9 100644 --- a/source/package.h +++ b/source/package.h @@ -44,8 +44,8 @@ protected: public: virtual ~Package() { } - const std::string &get_name() const { return name; } Builder &get_builder() const { return builder; } + const std::string &get_name() const { return name; } const Requirements &get_required_packages() const { return requires; } const BuildInfo &get_exported_build_info() const { return export_binfo; } diff --git a/source/sourcepackage.cpp b/source/sourcepackage.cpp index b84b22a..2cefeb8 100644 --- a/source/sourcepackage.cpp +++ b/source/sourcepackage.cpp @@ -37,11 +37,6 @@ SourcePackage::SourcePackage(Builder &b, const string &n, const FS::Path &f): source_tarball = &components.back(); } -void SourcePackage::set_build_type(const BuildType &t) -{ - build_type = &t; -} - FS::Path SourcePackage::get_temp_directory() const { string subdir = builder.get_current_arch().get_name(); @@ -88,6 +83,11 @@ bool SourcePackage::match_feature(const string &cond) const } } +void SourcePackage::set_build_type(const BuildType &t) +{ + build_type = &t; +} + void SourcePackage::do_prepare() { BuildInfo final_build_info; diff --git a/source/sourcepackage.h b/source/sourcepackage.h index 94555d6..e5c3152 100644 --- a/source/sourcepackage.h +++ b/source/sourcepackage.h @@ -79,20 +79,23 @@ public: const std::string &get_version() const { return version; } const std::string &get_interface_version() const { return interface_version; } const std::string &get_description() const { return description; } + FileTarget &get_build_file() const { return *build_file; } const Msp::FS::Path &get_source_directory() const { return source_dir; } Msp::FS::Path get_temp_directory() const; Msp::FS::Path get_output_directory() const; + const ComponentList &get_components() const { return components; } const Config &get_config() const { return config; } bool match_feature(const std::string &) const; void set_build_type(const BuildType &); const BuildInfo &get_build_info() const { return build_info; } - - Cache &get_cache() const { return cache; } private: virtual void do_prepare(); +public: + Cache &get_cache() const { return cache; } +private: virtual void save_caches(); }; -- 2.43.0