X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fpackage.cpp;h=f74b4a09bdda43e905df82ff8584009b2da0b9db;hb=c51884994862b02613c2c0ae75b1f8d39e0f1ee5;hp=6e60b76992b4cc9123eca2906644deab8445cac4;hpb=5622fc20f0be8bff0938d24f6f45d3ab384288ca;p=builder.git diff --git a/source/package.cpp b/source/package.cpp index 6e60b76..f74b4a0 100644 --- a/source/package.cpp +++ b/source/package.cpp @@ -1,10 +1,3 @@ -/* $Id$ - -This file is part of builder -Copyright © 2006-2007, 2009 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #include #include #include @@ -20,22 +13,8 @@ Package::Package(Builder &b, const string &n): name(n), conf_done(false), use_pkgconfig(true) -{ } - -PackageList Package::collect_requires() { - PackageList result; - result.push_back(this); - for(PackageList::const_iterator i=requires.begin(); i!=requires.end(); ++i) - { - PackageList r=(*i)->collect_requires(); - result.splice(result.end(), r); - } - - result.sort(); - result.unique(); - - return result; + builder.get_package_manager().add_package(this); } void Package::configure(const StringMap &opts, unsigned flag) @@ -43,8 +22,7 @@ void Package::configure(const StringMap &opts, unsigned flag) if(conf_done) return; - if(builder.get_verbose()>=3) - IO::print("Configuring %s\n", name); + builder.get_logger().log("configure", format("Configuring %s", name)); do_configure(opts, flag); @@ -56,19 +34,19 @@ void Package::configure(const StringMap &opts, unsigned flag) create_build_info(); - conf_done=true; + conf_done = true; } Package::Loader::Loader(Package &p): - pkg(p) + DataFile::ObjectLoader(p) { add("require", &Loader::require); } void Package::Loader::require(const string &n) { - Package *req=pkg.builder.get_package(n); + Package *req = obj.builder.get_package_manager().find_package(n); if(req) - pkg.requires.push_back(req); + obj.requires.push_back(req); }