From 8fa75f16e653e22f188bc09c5d04c3cdb5cf8c52 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 13 Apr 2012 19:54:47 +0300 Subject: [PATCH] Rename Install to InstalledFile --- source/analyzer.cpp | 1 - source/binary.cpp | 3 +-- source/builder.cpp | 4 ++-- source/component.cpp | 1 - source/copy.cpp | 8 ++++---- source/copy.h | 8 ++++---- source/{install.cpp => installedfile.cpp} | 10 +++++----- source/{install.h => installedfile.h} | 10 +++++----- source/objectfile.cpp | 3 +-- 9 files changed, 22 insertions(+), 26 deletions(-) rename source/{install.cpp => installedfile.cpp} (87%) rename source/{install.h => installedfile.h} (63%) diff --git a/source/analyzer.cpp b/source/analyzer.cpp index b064646..70f5f20 100644 --- a/source/analyzer.cpp +++ b/source/analyzer.cpp @@ -2,7 +2,6 @@ #include #include "analyzer.h" #include "builder.h" -#include "install.h" #include "objectfile.h" #include "package.h" #include "sourcefile.h" diff --git a/source/binary.cpp b/source/binary.cpp index 4728cd1..d73c594 100644 --- a/source/binary.cpp +++ b/source/binary.cpp @@ -3,11 +3,10 @@ #include "binary.h" #include "builder.h" #include "component.h" -#include "install.h" #include "link.h" #include "objectfile.h" -#include "package.h" #include "sharedlibrary.h" +#include "sourcepackage.h" #include "staticlibrary.h" using namespace std; diff --git a/source/builder.cpp b/source/builder.cpp index b6f29f8..9c8e27b 100644 --- a/source/builder.cpp +++ b/source/builder.cpp @@ -22,7 +22,7 @@ #include "gnucxxcompiler.h" #include "gnulinker.h" #include "header.h" -#include "install.h" +#include "installedfile.h" #include "misc.h" #include "package.h" #include "pkgconfig.h" @@ -507,7 +507,7 @@ int Builder::create_targets() if(spkg->get_install_flags()&(SourcePackage::LIB|SourcePackage::INCLUDE)) { PkgConfig *pc = new PkgConfig(*this, *spkg); - install->add_depend(new Install(*this, *spkg, *pc)); + install->add_depend(new InstalledFile(*this, *spkg, *pc)); } } diff --git a/source/component.cpp b/source/component.cpp index a7dfc34..2780070 100644 --- a/source/component.cpp +++ b/source/component.cpp @@ -10,7 +10,6 @@ #include "executable.h" #include "file.h" #include "header.h" -#include "install.h" #include "objectfile.h" #include "sharedlibrary.h" #include "sourcepackage.h" diff --git a/source/copy.cpp b/source/copy.cpp index b5ac403..b756e0c 100644 --- a/source/copy.cpp +++ b/source/copy.cpp @@ -7,7 +7,7 @@ #include #include "builder.h" #include "copy.h" -#include "install.h" +#include "installedfile.h" using namespace std; using namespace Msp; @@ -20,20 +20,20 @@ Target *Copy::create_target(const list &sources, const string &arg) co { FileTarget &file_tgt = dynamic_cast(*sources.front()); const SourcePackage &pkg = dynamic_cast(*file_tgt.get_package()); - Install *inst = new Install(builder, pkg, file_tgt, arg); + InstalledFile *inst = new InstalledFile(builder, pkg, file_tgt, arg); inst->set_tool(*this); return inst; } Task *Copy::run(const Target &target) const { - const Install &install = dynamic_cast(target); + const InstalledFile &install = dynamic_cast(target); Worker *worker = new Worker(install); return new InternalTask(worker); } -Copy::Worker::Worker(const Install &t): +Copy::Worker::Worker(const InstalledFile &t): target(t) { launch(); diff --git a/source/copy.h b/source/copy.h index 6150fad..3aa10a9 100644 --- a/source/copy.h +++ b/source/copy.h @@ -6,10 +6,10 @@ #include "internaltask.h" #include "tool.h" -class Install; +class InstalledFile; /** -Copies a file to another place. Used by the Install target. +Copies a file to another place. Used by the InstalledFile target. */ class Copy: public Tool { @@ -20,10 +20,10 @@ private: class Worker: public InternalTask::Worker { private: - const Install ⌖ + const InstalledFile ⌖ public: - Worker(const Install &); + Worker(const InstalledFile &); private: virtual void main(); }; diff --git a/source/install.cpp b/source/installedfile.cpp similarity index 87% rename from source/install.cpp rename to source/installedfile.cpp index 7c39ed6..2a96066 100644 --- a/source/install.cpp +++ b/source/installedfile.cpp @@ -4,7 +4,7 @@ #include "executable.h" #include "datafile.h" #include "header.h" -#include "install.h" +#include "installedfile.h" #include "package.h" #include "pkgconfig.h" #include "sharedlibrary.h" @@ -13,7 +13,7 @@ using namespace std; using namespace Msp; -Install::Install(Builder &b, const SourcePackage &p, FileTarget &s, const std::string &loc): +InstalledFile::InstalledFile(Builder &b, const SourcePackage &p, FileTarget &s, const std::string &loc): FileTarget(b, &p, generate_target_path(s, loc)), source(s) { @@ -28,12 +28,12 @@ Install::Install(Builder &b, const SourcePackage &p, FileTarget &s, const std::s builder.get_vfs().register_path(link, this); } -Target *Install::get_real_target() +Target *InstalledFile::get_real_target() { return source.get_real_target(); } -void Install::check_rebuild() +void InstalledFile::check_rebuild() { if(!mtime) mark_rebuild("Does not exist"); @@ -43,7 +43,7 @@ void Install::check_rebuild() mark_rebuild(source.get_name()+" needs rebuilding"); } -FS::Path Install::generate_target_path(const FileTarget &tgt, const std::string &loc) +FS::Path InstalledFile::generate_target_path(const FileTarget &tgt, const std::string &loc) { if(!tgt.get_package()) throw invalid_argument("Can't install package-less targets"); diff --git a/source/install.h b/source/installedfile.h similarity index 63% rename from source/install.h rename to source/installedfile.h index 2eb88d4..6c6a933 100644 --- a/source/install.h +++ b/source/installedfile.h @@ -1,5 +1,5 @@ -#ifndef INSTALL_H_ -#define INSTALL_H_ +#ifndef INSTALLEDFILE_H_ +#define INSTALLEDFILE_H_ #include "sourcepackage.h" #include "filetarget.h" @@ -7,15 +7,15 @@ /** Represents the installation of a file. */ -class Install: public FileTarget +class InstalledFile: public FileTarget { private: FileTarget &source; Msp::FS::Path link; public: - Install(Builder &, const SourcePackage &, FileTarget &, const std::string & =std::string()); - virtual const char *get_type() const { return "Install"; } + InstalledFile(Builder &, const SourcePackage &, FileTarget &, const std::string & =std::string()); + virtual const char *get_type() const { return "InstalledFile"; } FileTarget &get_source() const { return source; } const Msp::FS::Path &get_symlink() const { return link; } virtual Target *get_real_target(); diff --git a/source/objectfile.cpp b/source/objectfile.cpp index 8068bc6..e020c1b 100644 --- a/source/objectfile.cpp +++ b/source/objectfile.cpp @@ -2,7 +2,6 @@ #include #include "builder.h" #include "component.h" -#include "install.h" #include "objectfile.h" #include "sourcefile.h" #include "sourcepackage.h" @@ -39,7 +38,7 @@ void ObjectFile::find_depends() void ObjectFile::find_depends(FileTarget *tgt) { - Target *rtgt = tgt->get_real_target(); + FileTarget *rtgt = dynamic_cast(tgt->get_real_target()); const Dependencies &tdeps = rtgt->get_depends(); Dependencies deps_to_add; if(rtgt==tgt) -- 2.45.2