From 69cdee2c53972c1dd7e1b9d83ddcd8f6c3c589f7 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 17 Jul 2012 01:16:53 +0300 Subject: [PATCH] Un-abbreviate some function and variable names --- source/analyzer.cpp | 6 ++-- source/binary.cpp | 6 ++-- source/binary.h | 2 +- source/builder.cpp | 18 ++++++------ source/builder.h | 2 +- source/component.cpp | 52 +++++++++++++++++------------------ source/component.h | 6 ++-- source/config.cpp | 8 +++--- source/config.h | 4 +-- source/csourcefile.cpp | 14 +++++----- source/csourcefile.h | 2 +- source/datafile.cpp | 2 +- source/dependencycache.cpp | 4 +-- source/filetarget.cpp | 4 +-- source/gnuarchiver.cpp | 4 +-- source/gnucompiler.cpp | 2 +- source/gnulinker.cpp | 4 +-- source/installedfile.cpp | 2 +- source/objectfile.cpp | 16 +++++------ source/objectfile.h | 4 +-- source/package.h | 4 +-- source/packagemanager.cpp | 4 +-- source/pkgconfigfile.cpp | 2 +- source/pkgconfiggenerator.cpp | 6 ++-- source/sourcepackage.cpp | 14 +++++----- source/sourcepackage.h | 6 ++-- source/staticlibrary.cpp | 2 +- source/tar.cpp | 6 ++-- source/tarball.cpp | 2 +- source/target.cpp | 6 ++-- source/target.h | 6 ++-- 31 files changed, 110 insertions(+), 110 deletions(-) diff --git a/source/analyzer.cpp b/source/analyzer.cpp index b040496..7ea1fff 100644 --- a/source/analyzer.cpp +++ b/source/analyzer.cpp @@ -26,7 +26,7 @@ void Analyzer::analyze() const Builder::TargetMap &targets = builder.get_targets(); for(Builder::TargetMap::const_iterator i=targets.begin(); i!=targets.end(); ++i) { - const Target::Dependencies &depends = i->second->get_depends(); + const Target::Dependencies &depends = i->second->get_dependencies(); for(Target::Dependencies::const_iterator j=depends.begin(); j!=depends.end(); ++j) rdepends[*j].insert(i->second); } @@ -45,7 +45,7 @@ void Analyzer::analyze() Target &cmdline = *builder.get_target("cmdline"); if(mode==RDEPS) { - const Target::Dependencies &deps = cmdline.get_depends(); + const Target::Dependencies &deps = cmdline.get_dependencies(); for(Target::Dependencies::const_iterator i=deps.begin(); i!=deps.end(); ++i) build_depend_table(**i, 0); } @@ -108,7 +108,7 @@ void Analyzer::build_depend_table(Target &tgt, unsigned depth) depends.assign(rdeps.begin(), rdeps.end()); } else - depends = tgt.get_depends(); + depends = tgt.get_dependencies(); depends.sort(full_paths ? target_order_full : target_order); diff --git a/source/binary.cpp b/source/binary.cpp index 0dcb62f..6fd6161 100644 --- a/source/binary.cpp +++ b/source/binary.cpp @@ -20,10 +20,10 @@ Binary::Binary(Builder &b, const Component &c, const string &p, const list::const_iterator i=objs.begin(); i!=objs.end(); ++i) - add_depend(**i); + add_dependency(**i); } -void Binary::find_depends() +void Binary::find_dependencies() { if(!component) return; @@ -64,6 +64,6 @@ void Binary::find_depends() for(list::iterator j=i; (last && j!=dep_libs.end()); ++j) last = (j==i || *j!=*i); if(last) - add_depend(**i); + add_dependency(**i); } } diff --git a/source/binary.h b/source/binary.h index 303bd51..8e6761f 100644 --- a/source/binary.h +++ b/source/binary.h @@ -17,7 +17,7 @@ protected: Binary(Builder &, const Component &, const std::string &, const std::list &); public: - virtual void find_depends(); + virtual void find_dependencies(); }; #endif diff --git a/source/builder.cpp b/source/builder.cpp index 2093212..2f71f1a 100644 --- a/source/builder.cpp +++ b/source/builder.cpp @@ -380,13 +380,13 @@ bool Builder::prepare_build() Target *world = new VirtualTarget(*this, "world"); Target *def_tgt = new VirtualTarget(*this, "default"); - world->add_depend(*def_tgt); + world->add_dependency(*def_tgt); Target *install = new VirtualTarget(*this, "install"); - world->add_depend(*install); + world->add_dependency(*install); Target *tarballs = new VirtualTarget(*this, "tarballs"); - world->add_depend(*tarballs); + world->add_dependency(*tarballs); main_pkg->prepare(); @@ -405,7 +405,7 @@ bool Builder::prepare_build() return false; } - cmdline->add_depend(*tgt); + cmdline->add_dependency(*tgt); } cmdline->prepare(); @@ -541,7 +541,7 @@ int Builder::do_clean() if(tgt->is_buildable() && (tgt->get_package()==main_pkg || clean>=2)) clean_tgts.insert(tgt); - const Target::Dependencies &deps = tgt->get_depends(); + const Target::Dependencies &deps = tgt->get_dependencies(); for(list::const_iterator i=deps.begin(); i!=deps.end(); ++i) if(!clean_tgts.count(*i)) queue.push_back(*i); @@ -561,7 +561,7 @@ void Builder::package_help() const Config::OptionMap &options = config.get_options(); IO::print("Required packages:\n "); - const PackageList &requires = main_pkg->get_requires(); + const PackageList &requires = main_pkg->get_required_packages(); for(PackageList::const_iterator i=requires.begin(); i!=requires.end(); ++i) { if(i!=requires.begin()) @@ -572,9 +572,9 @@ void Builder::package_help() for(Config::OptionMap::const_iterator i=options.begin(); i!=options.end(); ++i) { const Config::Option &opt = i->second; - IO::print(" %s: %s (%s)", opt.name, opt.descr, opt.value); - if(opt.value!=opt.defv) - IO::print(" [%s]", opt.defv); + IO::print(" %s: %s (%s)", opt.name, opt.description, opt.value); + if(opt.value!=opt.default_value) + IO::print(" [%s]", opt.default_value); IO::print("\n"); } } diff --git a/source/builder.h b/source/builder.h index 55af18a..eecbb98 100644 --- a/source/builder.h +++ b/source/builder.h @@ -104,7 +104,7 @@ public: const TargetMap &get_targets() const { return targets; } - const Msp::FS::Path &get_cwd() const { return cwd; } + const Msp::FS::Path &get_work_directory() const { return cwd; } const Architecture &get_current_arch() const { return *current_arch; } const Architecture &get_native_arch() const { return native_arch; } const Msp::FS::Path &get_prefix() const { return prefix; } diff --git a/source/component.cpp b/source/component.cpp index 3f8b004..23bd374 100644 --- a/source/component.cpp +++ b/source/component.cpp @@ -23,7 +23,7 @@ using namespace std; using namespace Msp; Component::Component(SourcePackage &p, Type t, const string &n): - pkg(p), + package(p), type(t), name(n), install(false), @@ -38,7 +38,7 @@ void Component::prepare() void Component::create_build_info() { - const PackageList &pkg_reqs = pkg.get_requires(); + const PackageList &pkg_reqs = package.get_required_packages(); PackageList direct_reqs = requires; direct_reqs.insert(direct_reqs.end(), pkg_reqs.begin(), pkg_reqs.end()); @@ -48,20 +48,20 @@ void Component::create_build_info() BuildInfo::UpdateLevel level = BuildInfo::CHAINED; if(find(direct_reqs.begin(), direct_reqs.end(), *i)!=direct_reqs.end()) level = BuildInfo::DEPENDENCY; - build_info.update_from((*i)->get_exported_binfo(), level); + build_info.update_from((*i)->get_exported_build_info(), level); - const PackageList &reqs = (*i)->get_requires(); + const PackageList &reqs = (*i)->get_required_packages(); for(PackageList::const_iterator j=reqs.begin(); j!=reqs.end(); ++j) if(find(all_reqs.begin(), all_reqs.end(), *j)==all_reqs.end()) all_reqs.push_back(*j); } - build_info.update_from(pkg.get_build_info()); + build_info.update_from(package.get_build_info()); for(BuildInfo::PathList::iterator i=build_info.incpath.begin(); i!=build_info.incpath.end(); ++i) - *i = (pkg.get_source() / *i).str(); + *i = (package.get_source_directory() / *i).str(); for(BuildInfo::PathList::iterator i=build_info.libpath.begin(); i!=build_info.libpath.end(); ++i) - *i = (pkg.get_source() / *i).str(); + *i = (package.get_source_directory() / *i).str(); if(type==LIBRARY || type==MODULE) if(build_info.libmodeget_exported_binfo(); + const BuildInfo &ebi = (*i)->get_exported_build_info(); build_info.libpath.insert(build_info.libpath.end(), ebi.libpath.begin(), ebi.libpath.end()); } } @@ -79,7 +79,7 @@ void Component::create_build_info() void Component::create_targets() const { - Builder &builder = pkg.get_builder(); + Builder &builder = package.get_builder(); const Toolchain &toolchain = builder.get_toolchain(); Target *world = builder.get_target("world"); Target *def_tgt = builder.get_target("default"); @@ -95,8 +95,8 @@ void Component::create_targets() const string tarname = name; if(name=="@src") { - tarname = pkg.get_name()+"-"+pkg.get_version(); - source_filenames.push_back(pkg.get_source()/"Build"); + tarname = package.get_name()+"-"+package.get_version(); + source_filenames.push_back(package.get_source_directory()/"Build"); } list files; @@ -112,7 +112,7 @@ void Component::create_targets() const { const Builder::TargetMap &targets = builder.get_targets(); for(Builder::TargetMap::const_iterator i=targets.begin(); i!=targets.end(); ++i) - if(i->second->get_package()==&pkg && !i->second->is_buildable()) + if(i->second->get_package()==&package && !i->second->is_buildable()) files.push_back(i->second); } @@ -121,7 +121,7 @@ void Component::create_targets() const /*Target *result = tar.create_target(files, tarname); Target *tarballs_tgt = builder.get_target("tarballs"); - tarballs_tgt->add_depend(*result);*/ + tarballs_tgt->add_dependency(*result);*/ return; } @@ -134,7 +134,7 @@ void Component::create_targets() const if(Target *tgt = builder.get_vfs().get_target(*i)) ft = dynamic_cast(tgt); else - ft = new File(builder, pkg, *i); + ft = new File(builder, package, *i); inst_list.push_back(ft); } } @@ -146,13 +146,13 @@ void Component::create_targets() const if(Target *tgt = builder.get_vfs().get_target(source_filenames.front())) source = dynamic_cast(tgt); else - source = new File(builder, pkg, source_filenames.front()); + source = new File(builder, package, source_filenames.front()); Target *result = dcomp.create_target(*source); - if(&pkg==builder.get_main_package() && deflt) - def_tgt->add_depend(*result); + if(&package==builder.get_main_package() && deflt) + def_tgt->add_dependency(*result); else - world->add_depend(*result); + world->add_dependency(*result); if(install) inst_list.push_back(result); } @@ -194,10 +194,10 @@ void Component::create_targets() const for(list::const_iterator i=results.begin(); i!=results.end(); ++i) { - if(&pkg==builder.get_main_package() && deflt) - def_tgt->add_depend(**i); + if(&package==builder.get_main_package() && deflt) + def_tgt->add_dependency(**i); else - world->add_depend(**i); + world->add_dependency(**i); if(install) inst_list.push_back(*i); } @@ -208,7 +208,7 @@ void Component::create_targets() const for(list::const_iterator i=inst_list.begin(); i!=inst_list.end(); ++i) { Target *inst = copy.create_target(**i, inst_loc); - inst_tgt->add_depend(*inst); + inst_tgt->add_dependency(*inst); } } @@ -220,7 +220,7 @@ PathList Component::collect_source_files() const FS::Path path(*i); if(FS::is_dir(path)) { - pkg.get_builder().get_logger().log("files", format("Traversing %s", path)); + package.get_builder().get_logger().log("files", format("Traversing %s", path)); list sfiles = list_files(path); for(list::iterator j=sfiles.begin(); j!=sfiles.end(); ++j) files.push_back(path / *j); @@ -246,12 +246,12 @@ Component::Loader::Loader(Component &c): void Component::Loader::source(const string &s) { - obj.sources.push_back((obj.pkg.get_source()/s).str()); + obj.sources.push_back((obj.package.get_source_directory()/s).str()); } void Component::Loader::require(const string &n) { - Package *req = obj.pkg.get_builder().get_package_manager().find_package(n); + Package *req = obj.package.get_builder().get_package_manager().find_package(n); if(req) obj.requires.push_back(req); } @@ -263,5 +263,5 @@ void Component::Loader::build_info() void Component::Loader::install_map() { - load_sub(obj.install_map, obj.pkg.get_source()); + load_sub(obj.install_map, obj.package.get_source_directory()); } diff --git a/source/component.h b/source/component.h index 5f1332f..5da2883 100644 --- a/source/component.h +++ b/source/component.h @@ -42,7 +42,7 @@ public: }; protected: - SourcePackage &pkg; + SourcePackage &package; Type type; std::string name; StringList sources; @@ -55,13 +55,13 @@ protected: public: Component(SourcePackage &, Type, const std::string &); - const SourcePackage &get_package() const { return pkg; } + const SourcePackage &get_package() const { return package; } Type get_type() const { return type; } const std::string &get_name() const { return name; } const StringList &get_sources() const { return sources; } const BuildInfo &get_build_info() const { return build_info; } bool get_install() const { return install; } - const PackageList &get_requires() const { return requires; } + const PackageList &get_required_packages() const { return requires; } bool is_default() const { return deflt; } const InstallMap &get_install_map() const { return install_map; } diff --git a/source/config.cpp b/source/config.cpp index e4449cc..f311003 100644 --- a/source/config.cpp +++ b/source/config.cpp @@ -39,7 +39,7 @@ void Config::save() const if(!changed) return; - FS::Path fn = package.get_source()/".config"; + FS::Path fn = package.get_source_directory()/".config"; package.get_builder().get_logger().log("files", format("Writing %s", fn)); IO::BufferedFile out(fn.str(), IO::M_WRITE); @@ -68,7 +68,7 @@ bool Config::set_option(const string &opt, const string &val) void Config::load() { - FS::Path fn = package.get_source()/".config"; + FS::Path fn = package.get_source_directory()/".config"; FS::Stat stat = FS::stat(fn); if(stat) { @@ -86,8 +86,8 @@ void Config::load() Config::Option::Option(const string &n, const string &v, const string &d): name(n), - defv(v), - descr(d), + default_value(v), + description(d), value(v) { } diff --git a/source/config.h b/source/config.h index 8372af9..91a6ef0 100644 --- a/source/config.h +++ b/source/config.h @@ -21,8 +21,8 @@ public: struct Option { std::string name; - std::string defv; - std::string descr; + std::string default_value; + std::string description; std::string value; Option(const std::string &, const std::string &, const std::string &); diff --git a/source/csourcefile.cpp b/source/csourcefile.cpp index b0346e4..5628e04 100644 --- a/source/csourcefile.cpp +++ b/source/csourcefile.cpp @@ -22,17 +22,17 @@ CSourceFile::CSourceFile(Builder &b, const Component &c, const FS::Path &p): install_location = FS::Path("include")/package->get_name(); } -void CSourceFile::find_depends() +void CSourceFile::find_dependencies() { if(!component || !mtime) return; const SourcePackage &spkg = component->get_package(); - string relname = FS::relative(path, spkg.get_source()).str(); + string deps_key = FS::relative(path, spkg.get_source_directory()).str(); - DependencyCache &deps_cache = spkg.get_deps_cache(); - if(mtimeget_build_info().incpath; @@ -57,6 +57,6 @@ void CSourceFile::find_depends() { Target *hdr = builder.get_vfs().find_header(i->substr(1), ((*i)[0]=='"' ? local_incpath : incpath)); if(hdr) - add_depend(*hdr); + add_dependency(*hdr); } } diff --git a/source/csourcefile.h b/source/csourcefile.h index 9e231d9..035f667 100644 --- a/source/csourcefile.h +++ b/source/csourcefile.h @@ -18,7 +18,7 @@ public: virtual const char *get_type() const { return "CSourceFile"; } const StringList &get_includes() const { return includes; } - virtual void find_depends(); + virtual void find_dependencies(); }; #endif diff --git a/source/datafile.cpp b/source/datafile.cpp index 188bbdb..bb61d7d 100644 --- a/source/datafile.cpp +++ b/source/datafile.cpp @@ -8,7 +8,7 @@ DataFile::DataFile(Builder &b, const Component &c, File &s): component(c), source(s) { - add_depend(source); + add_dependency(source); install_location = Msp::FS::Path("share")/package->get_name(); } diff --git a/source/dependencycache.cpp b/source/dependencycache.cpp index e91bdbc..a4211a3 100644 --- a/source/dependencycache.cpp +++ b/source/dependencycache.cpp @@ -36,7 +36,7 @@ void DependencyCache::save() const if(deps.empty() || !changed) return; - FS::Path fn = package.get_source()/".deps"; + FS::Path fn = package.get_source_directory()/".deps"; package.get_builder().get_logger().log("files", format("Writing %s", fn)); IO::BufferedFile out(fn.str(), IO::M_WRITE); @@ -51,7 +51,7 @@ void DependencyCache::save() const void DependencyCache::load() { - FS::Path fn = package.get_source()/".deps"; + FS::Path fn = package.get_source_directory()/".deps"; if(FS::Stat st = FS::stat(fn)) { diff --git a/source/filetarget.cpp b/source/filetarget.cpp index 9908c0d..21c2bbf 100644 --- a/source/filetarget.cpp +++ b/source/filetarget.cpp @@ -39,9 +39,9 @@ void FileTarget::init(const SourcePackage *p) string FileTarget::generate_name(Builder &builder, const SourcePackage *pkg, const FS::Path &path) { - if(pkg && FS::descendant_depth(path, pkg->get_source())>=0) + if(pkg && FS::descendant_depth(path, pkg->get_source_directory())>=0) { - FS::Path relpath = FS::relative(path, pkg->get_source()); + FS::Path relpath = FS::relative(path, pkg->get_source_directory()); return format("<%s>%s", pkg->get_name(), relpath.str().substr(1)); } else if(FS::descendant_depth(path, builder.get_prefix())>=0) diff --git a/source/gnuarchiver.cpp b/source/gnuarchiver.cpp index 71edc42..168a163 100644 --- a/source/gnuarchiver.cpp +++ b/source/gnuarchiver.cpp @@ -54,11 +54,11 @@ Task *GnuArchiver::run(const Target &target) const argv.push_back(executable->get_path().str()); argv.push_back("rc"); - FS::Path work_dir = comp.get_package().get_source(); + FS::Path work_dir = comp.get_package().get_source_directory(); argv.push_back(relative(lib.get_path(), work_dir).str()); - const Target::Dependencies &deps = lib.get_depends(); + const Target::Dependencies &deps = lib.get_dependencies(); for(Target::Dependencies::const_iterator i=deps.begin(); i!=deps.end(); ++i) if(ObjectFile *obj = dynamic_cast(*i)) argv.push_back(relative(obj->get_path(), work_dir).str()); diff --git a/source/gnucompiler.cpp b/source/gnucompiler.cpp index 3690393..a6d2705 100644 --- a/source/gnucompiler.cpp +++ b/source/gnucompiler.cpp @@ -82,7 +82,7 @@ Task *GnuCompiler::run(const Target &target) const FS::Path obj_path = object.get_path(); FS::Path src_path = object.get_source().get_path(); - FS::Path work_dir = comp.get_package().get_source(); + FS::Path work_dir = comp.get_package().get_source_directory(); argv.push_back("-o"); argv.push_back(relative(obj_path, work_dir).str()); diff --git a/source/gnulinker.cpp b/source/gnulinker.cpp index 4276397..f7982f7 100644 --- a/source/gnulinker.cpp +++ b/source/gnulinker.cpp @@ -134,14 +134,14 @@ Task *GnuLinker::Linker::run(const Target &target) const if(architecture->get_bits()!=native_arch.get_bits()) argv.push_back(format("-m%d", architecture->get_bits())); - FS::Path work_dir = comp.get_package().get_source(); + FS::Path work_dir = comp.get_package().get_source_directory(); argv.push_back("-o"); argv.push_back(relative(bin.get_path(), work_dir).str()); bool static_link_ok = (binfo.libmode<=BuildInfo::STATIC); - const Target::Dependencies &depends = target.get_depends(); + const Target::Dependencies &depends = target.get_dependencies(); for(Target::Dependencies::const_iterator i=depends.begin(); i!=depends.end(); ++i) { Target *tgt = (*i)->get_real_target(); diff --git a/source/installedfile.cpp b/source/installedfile.cpp index f2909f6..6960cce 100644 --- a/source/installedfile.cpp +++ b/source/installedfile.cpp @@ -11,7 +11,7 @@ InstalledFile::InstalledFile(Builder &b, const SourcePackage &p, FileTarget &s, FileTarget(b, p, generate_target_path(b.get_prefix(), s, loc)), source(s) { - add_depend(source); + add_dependency(source); if(const SharedLibrary *shlib = dynamic_cast(&source)) if(!shlib->get_soname().empty()) diff --git a/source/objectfile.cpp b/source/objectfile.cpp index 7aafe90..ea44216 100644 --- a/source/objectfile.cpp +++ b/source/objectfile.cpp @@ -10,11 +10,11 @@ using namespace std; using namespace Msp; ObjectFile::ObjectFile(Builder &b, const Component &c, SourceFile &s): - FileTarget(b, c.get_package(), generate_target_path(c, FS::relative(s.get_path(), c.get_package().get_source()).str())), + FileTarget(b, c.get_package(), generate_target_path(c, FS::relative(s.get_path(), c.get_package().get_source_directory()).str())), source(s) { component = &c; - add_depend(source); + add_dependency(source); } FS::Path ObjectFile::generate_target_path(const Component &comp, const string &src) @@ -29,19 +29,19 @@ FS::Path ObjectFile::generate_target_path(const Component &comp, const string &s return pkg.get_temp_dir()/comp.get_name()/fn; } -void ObjectFile::find_depends() +void ObjectFile::find_dependencies() { for(Dependencies::iterator i=depends.begin(); i!=depends.end(); ++i) { (*i)->prepare(); - find_depends(dynamic_cast(*i)); + find_dependencies(dynamic_cast(*i)); } } -void ObjectFile::find_depends(FileTarget *tgt) +void ObjectFile::find_dependencies(FileTarget *tgt) { FileTarget *rtgt = dynamic_cast(tgt->get_real_target()); - const Dependencies &tdeps = rtgt->get_depends(); + const Dependencies &tdeps = rtgt->get_dependencies(); Dependencies deps_to_add; if(rtgt==tgt) { @@ -57,7 +57,7 @@ void ObjectFile::find_depends(FileTarget *tgt) for(Dependencies::const_iterator i=tdeps.begin(); i!=tdeps.end(); ++i) { FileTarget *file = dynamic_cast(*i); - if(file && file->get_package()==tpkg && FS::descendant_depth(file->get_path(), tpkg->get_source())>=0) + if(file && file->get_package()==tpkg && FS::descendant_depth(file->get_path(), tpkg->get_source_directory())>=0) { FS::Path displaced = tgt->get_path()/FS::relative(file->get_path(), rtgt->get_path()); if(Target *ddep = builder.get_vfs().get_target(displaced)) @@ -70,5 +70,5 @@ void ObjectFile::find_depends(FileTarget *tgt) for(Dependencies::const_iterator i=deps_to_add.begin(); i!=deps_to_add.end(); ++i) if(find(depends.begin(), depends.end(), *i)==depends.end()) - add_depend(**i); + add_dependency(**i); } diff --git a/source/objectfile.h b/source/objectfile.h index af7cc22..f6bded7 100644 --- a/source/objectfile.h +++ b/source/objectfile.h @@ -22,10 +22,10 @@ public: virtual const char *get_type() const { return "ObjectFile"; } SourceFile &get_source() const { return source; } - virtual void find_depends(); + virtual void find_dependencies(); private: - void find_depends(FileTarget *); + void find_dependencies(FileTarget *); }; #endif diff --git a/source/package.h b/source/package.h index e98f4e7..5c80779 100644 --- a/source/package.h +++ b/source/package.h @@ -45,9 +45,9 @@ public: const std::string &get_name() const { return name; } Builder &get_builder() const { return builder; } - const PackageList &get_requires() const { return requires; } + const PackageList &get_required_packages() const { return requires; } - const BuildInfo &get_exported_binfo() const { return export_binfo; } + const BuildInfo &get_exported_build_info() const { return export_binfo; } /// Indicates whether or not this package supports pkg-config bool get_use_pkgconfig() const { return use_pkgconfig; } diff --git a/source/packagemanager.cpp b/source/packagemanager.cpp index 730f022..ac1851d 100644 --- a/source/packagemanager.cpp +++ b/source/packagemanager.cpp @@ -21,8 +21,8 @@ PackageManager::PackageManager(Builder &b): no_externals(false), env_set(false) { - pkg_path.push_back(builder.get_cwd()/"."); - pkg_path.push_back(builder.get_cwd()/".."); + pkg_path.push_back(builder.get_work_directory()/"."); + pkg_path.push_back(builder.get_work_directory()/".."); } PackageManager::~PackageManager() diff --git a/source/pkgconfigfile.cpp b/source/pkgconfigfile.cpp index ec61496..7631f9a 100644 --- a/source/pkgconfigfile.cpp +++ b/source/pkgconfigfile.cpp @@ -3,7 +3,7 @@ #include "pkgconfigfile.h" PkgConfigFile::PkgConfigFile(Builder &b, const SourcePackage &p): - FileTarget(b, p, p.get_source()/(p.get_name()+".pc")) + FileTarget(b, p, p.get_source_directory()/(p.get_name()+".pc")) { tool = &builder.get_toolchain().get_tool("PCG"); diff --git a/source/pkgconfiggenerator.cpp b/source/pkgconfiggenerator.cpp index 141b363..811fa5d 100644 --- a/source/pkgconfiggenerator.cpp +++ b/source/pkgconfiggenerator.cpp @@ -37,20 +37,20 @@ void PkgConfigGenerator::Worker::main() IO::BufferedFile out(target.get_path().str(), IO::M_WRITE); IO::print(out, "prefix=%s\n", builder.get_prefix().str()); - IO::print(out, "source=%s\n\n", spkg.get_source()); + IO::print(out, "source=%s\n\n", spkg.get_source_directory()); IO::print(out, "Name: %s\n", spkg.get_name()); IO::print(out, "Description: %s\n", spkg.get_description()); IO::print(out, "Version: %s\n", spkg.get_version()); IO::print(out, "Requires:"); - const PackageList &reqs = spkg.get_requires(); + const PackageList &reqs = spkg.get_required_packages(); for(PackageList::const_iterator i=reqs.begin(); i!=reqs.end(); ++i) if((*i)->get_use_pkgconfig()) IO::print(out, " %s", (*i)->get_name()); out.put('\n'); - const BuildInfo &binfo = spkg.get_exported_binfo(); + const BuildInfo &binfo = spkg.get_exported_build_info(); IO::print(out, "Libs:"); for(BuildInfo::PathList::const_iterator i=binfo.libpath.begin(); i!=binfo.libpath.end(); ++i) IO::print(out, " -L%s", FS::relative(*i, builder.get_prefix()).str()); diff --git a/source/sourcepackage.cpp b/source/sourcepackage.cpp index 06ab5fe..3b0b296 100644 --- a/source/sourcepackage.cpp +++ b/source/sourcepackage.cpp @@ -22,7 +22,7 @@ bool component_sort(const Component &c1, const Component &c2) SourcePackage::SourcePackage(Builder &b, const string &n, const FS::Path &s): Package(b, n), - source(s), + source_dir(s), build_type(0), config(*this), deps_cache(*this) @@ -50,7 +50,7 @@ FS::Path SourcePackage::get_temp_dir() const if(temp.is_absolute()) return temp/name/subdir; else - return source/temp/subdir; + return source_dir/temp/subdir; } FS::Path SourcePackage::get_out_dir() const @@ -58,9 +58,9 @@ FS::Path SourcePackage::get_out_dir() const const Architecture &arch = builder.get_current_arch(); string detail = (build_type ? build_type->get_name() : string()); if(arch.is_native()) - return source/detail; + return source_dir/detail; else - return source/arch.get_name()/detail; + return source_dir/arch.get_name()/detail; } void SourcePackage::create_build_info() @@ -113,7 +113,7 @@ void SourcePackage::create_targets() if(pc_needed) { PkgConfigFile *pc = new PkgConfigFile(builder, *this); - builder.get_target("install")->add_depend(*builder.get_toolchain().get_tool("CP").create_target(*pc)); + builder.get_target("install")->add_dependency(*builder.get_toolchain().get_tool("CP").create_target(*pc)); } } @@ -169,7 +169,7 @@ void SourcePackage::Loader::finish() { if(!i->first.compare(0, k->size(), *k)) { - const_cast(j->get_install_map()).add_mapping(obj.source/i->first, i->second); + const_cast(j->get_install_map()).add_mapping(obj.source_dir/i->first, i->second); } } } @@ -280,5 +280,5 @@ void SourcePackage::Loader::tar_file(const string &f) IO::print("%s: Note: tar_file is deprecated\n", get_source()); for(ComponentList::iterator i=obj.components.begin(); i!=obj.components.end(); ++i) if(i->get_type()==Component::TARBALL && i->get_name()=="@src") - const_cast(i->get_sources()).push_back((obj.source/f).str()); + const_cast(i->get_sources()).push_back((obj.source_dir/f).str()); } diff --git a/source/sourcepackage.h b/source/sourcepackage.h index 20461fb..c143a27 100644 --- a/source/sourcepackage.h +++ b/source/sourcepackage.h @@ -57,7 +57,7 @@ private: std::string version; std::string description; - Msp::FS::Path source; + Msp::FS::Path source_dir; const BuildType *build_type; FeatureList features; BuildInfo build_info; @@ -70,7 +70,7 @@ public: const std::string &get_version() const { return version; } const std::string &get_description() const { return description; } - const Msp::FS::Path &get_source() const { return source; } + const Msp::FS::Path &get_source_directory() const { return source_dir; } Msp::FS::Path get_temp_dir() const; Msp::FS::Path get_out_dir() const; const ComponentList &get_components() const { return components; } @@ -79,7 +79,7 @@ public: const BuildInfo &get_build_info() const { return build_info; } Builder &get_builder() const { return builder; } - DependencyCache &get_deps_cache() const { return deps_cache; } + DependencyCache &get_dependency_cache() const { return deps_cache; } private: virtual void create_build_info(); diff --git a/source/staticlibrary.cpp b/source/staticlibrary.cpp index 8e3950f..2bb17fc 100644 --- a/source/staticlibrary.cpp +++ b/source/staticlibrary.cpp @@ -16,7 +16,7 @@ StaticLibrary::StaticLibrary(Builder &b, const Component &c, const list::const_iterator i=objs.begin(); i!=objs.end(); ++i) - add_depend(**i); + add_dependency(**i); install_location = "lib"; } diff --git a/source/tar.cpp b/source/tar.cpp index a85ee3d..b4ba71e 100644 --- a/source/tar.cpp +++ b/source/tar.cpp @@ -22,7 +22,7 @@ Target *Tar::create_target(const list &sources, const string &arg) con TarBall *tarball = new TarBall(builder, *sources.front()->get_package(), arg); for(list::const_iterator i=sources.begin(); i!=sources.end(); ++i) - tarball->add_depend(**i); + tarball->add_dependency(**i); return tarball; } @@ -41,11 +41,11 @@ Tar::Worker::Worker(const TarBall &tb): void Tar::Worker::main() { - const FS::Path &pkg_src = tarball.get_package()->get_source(); + const FS::Path &pkg_src = tarball.get_package()->get_source_directory(); FS::Path basedir = FS::basepart(FS::basename(tarball.get_path())); IO::File out(tarball.get_path().str(), IO::M_WRITE); - const Target::Dependencies &deps = tarball.get_depends(); + const Target::Dependencies &deps = tarball.get_dependencies(); for(Target::Dependencies::const_iterator i=deps.begin(); i!=deps.end(); ++i) { FileTarget *ft = dynamic_cast(*i); diff --git a/source/tarball.cpp b/source/tarball.cpp index fe5a10a..7596a3d 100644 --- a/source/tarball.cpp +++ b/source/tarball.cpp @@ -5,7 +5,7 @@ using namespace std; TarBall::TarBall(Builder &b, const SourcePackage &p, const string &n): - FileTarget(b, p, p.get_source()/(n+".tar")) + FileTarget(b, p, p.get_source_directory()/(n+".tar")) { } const SourcePackage *TarBall::get_package() const diff --git a/source/target.cpp b/source/target.cpp index cf4fae9..cd4cf36 100644 --- a/source/target.cpp +++ b/source/target.cpp @@ -22,7 +22,7 @@ Target::Target(Builder &b, const string &n): builder.add_target(this); } -void Target::add_depend(Target &dep) +void Target::add_dependency(Target &dep) { if(&dep==this) throw invalid_argument("Target::add_depend"); @@ -88,11 +88,11 @@ void Target::prepare() } state = PREPARING; - find_depends(); + find_dependencies(); if(tool) { if(FileTarget *tool_exe = tool->get_executable()) - add_depend(*tool_exe); + add_dependency(*tool_exe); } for(Dependencies::iterator i=depends.begin(); i!=depends.end(); ++i) diff --git a/source/target.h b/source/target.h index 62b6721..f264905 100644 --- a/source/target.h +++ b/source/target.h @@ -60,17 +60,17 @@ public: /** Adds a dependency for the target. Order is preseved and is important for some target types. It is an error to create dependency cycles, although this won't be detected until the targets are prepared. */ - void add_depend(Target &); + void add_dependency(Target &); protected: /** Finds dependencies for the target. Called during preparation. If the target needs to recursively inspect its dependencies, it should prepare its direct dependencies first. */ - virtual void find_depends() { } + virtual void find_dependencies() { } public: /// Returns the dependencies of the target, in the order they were added. - const Dependencies &get_depends() const { return depends; } + const Dependencies &get_dependencies() const { return depends; } /** Tries to locate a target that will help getting this target built. If all dependencies are up-to-date, returns this target. If there are no -- 2.45.2