]> git.tdb.fi Git - builder.git/commitdiff
Remove deprecated features
authorMikko Rasa <tdb@tdb.fi>
Fri, 24 May 2013 12:44:37 +0000 (15:44 +0300)
committerMikko Rasa <tdb@tdb.fi>
Fri, 24 May 2013 12:47:26 +0000 (15:47 +0300)
All of these have been deprecated for nearly a year, and I don't have any
active projects using them.

source/builder.cpp
source/builder.h
source/condition.cpp [deleted file]
source/condition.h [deleted file]
source/sourcepackage.cpp
source/sourcepackage.h

index 81f4d8e3d481f30b236abd8cdd90e389705cb4b5..b73618f25ae637b36d5b1c96ffca2f55ccd4b0d2 100644 (file)
@@ -300,7 +300,6 @@ Builder::Loader::Loader(Builder &b, const Config::InputOptions *o, bool a):
        add("architecture", &Loader::architecture);
        add("binary_package", &Loader::binpkg);
        add("build_type", &Loader::build_type);
-       add("profile", &Loader::profile);
        add("package", &Loader::package);
 
        if(!obj.top_loader)
@@ -336,11 +335,6 @@ void Builder::Loader::build_type(const string &n)
                obj.build_type = &i->second;
 }
 
-void Builder::Loader::profile(const string &)
-{
-       IO::print("Profiles are deprecated\n");
-}
-
 void Builder::Loader::package(const string &n)
 {
        SourcePackage *pkg = new SourcePackage(obj, n, get_source());
index 3004ed245ecedb860da199e28f8f4bdaecf2eb60..7998a393eb4ab9f5a513dbcb544dba7836a71a3b 100644 (file)
@@ -41,7 +41,6 @@ private:
                void architecture(const std::string &);
                void binpkg(const std::string &);
                void build_type(const std::string &);
-               void profile(const std::string &);
                void package(const std::string &);
        };
 
diff --git a/source/condition.cpp b/source/condition.cpp
deleted file mode 100644 (file)
index 413870e..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#include <msp/strings/utils.h>
-#include "builder.h"
-#include "condition.h"
-#include "sourcepackage.h"
-
-using namespace std;
-using namespace Msp;
-
-Condition::Condition(SourcePackage &p, const string &expr):
-       pkg(p)
-{
-       vector<string> parts = split(expr);
-
-       for(vector<string>::iterator i=parts.begin(); i!=parts.end(); ++i)
-       {
-               if(*i=="and")
-                       continue;
-
-               string::size_type token = i->find_first_of("=!");
-               if(token==string::npos)
-                       expression.insert(Expression::value_type(*i, "="));
-               else if(token==0 && (*i)[0]=='!')
-                       expression.insert(Expression::value_type(i->substr(1), "!"));
-               else
-                       expression.insert(Expression::value_type(i->substr(0, token), i->substr(token)));
-       }
-}
-
-bool Condition::eval()
-{
-       const Config &conf = pkg.get_config();
-
-       bool result = true;
-       for(Expression::iterator i=expression.begin(); i!=expression.end(); ++i)
-       {
-               bool neg = (i->second[0]=='!');
-               unsigned start = 1;
-               if(i->second[1]=='=')
-                       ++start;
-               string value = i->second.substr(start);
-
-               bool match = false;
-               if(conf.is_option(i->first))
-               {
-                       if(value.empty())
-                               match = lexical_cast<bool>(conf.get_option(i->first).value);
-                       else
-                               match = (conf.get_option(i->first).value==value);
-               }
-               else if(i->first=="arch")
-                       match = pkg.get_builder().get_current_arch().match_name(value);
-
-               if(match==neg)
-                       result = false;
-       }
-
-       return result;
-}
-
-
-Condition::Loader::Loader(Condition &c):
-       DataFile::ObjectLoader<Condition>(c)
-{
-       add("require",    &Loader::require);
-       add("build_info", &Loader::build_info);
-}
-
-void Condition::Loader::require(const string &pkg)
-{
-       obj.requires.push_back(pkg);
-}
-
-void Condition::Loader::build_info()
-{
-       load_sub(obj.build_info);
-}
diff --git a/source/condition.h b/source/condition.h
deleted file mode 100644 (file)
index 0cdc2bb..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef CONDITION_H_
-#define CONDITION_H_
-
-#include <msp/datafile/loader.h>
-#include "buildinfo.h"
-
-class Config;
-class SourcePackage;
-
-class Condition
-{
-public:
-       class Loader: public Msp::DataFile::ObjectLoader<Condition>
-       {
-       public:
-               Loader(Condition &);
-       private:
-               void require(const std::string &);
-               void build_info();
-       };
-
-       typedef std::list<std::string> RequireList;
-
-private:
-       typedef std::map<std::string, std::string> Expression;
-       
-       SourcePackage &pkg;
-       Expression expression;
-       RequireList requires;
-       BuildInfo build_info;
-
-public:
-       Condition(SourcePackage &, const std::string &);
-       const RequireList &get_requires() const { return requires; }
-       const BuildInfo &get_build_info() const { return build_info; }
-       bool eval();
-};
-
-#endif
index faf3bfe3c062d1948af5dd57c7086f3697ae8465..e3f11097bfd7693f8333c7c82eca5c227fc45832 100644 (file)
@@ -166,40 +166,21 @@ void SourcePackage::Loader::init(const Config::InputOptions *o)
        add("description", &SourcePackage::description);
        add("build_info",  &Loader::build_info);
        add("feature",     &Loader::feature);
-       add("if",          &Loader::condition);
        add("if_feature",  &Loader::if_feature);
        add("program",     &Loader::component<Component::PROGRAM>);
        add("library",     &Loader::component<Component::LIBRARY>);
        add("module",      &Loader::component<Component::MODULE>);
-       add("headers",     &Loader::headers);
        add("install",     &Loader::component<Component::INSTALL>);
        add("interface_version", &Loader::interface_version);
        add("datapack",    &Loader::component<Component::DATAPACK>);
        add("source_tarball", &Loader::source_tarball);
        add("tarball",     &Loader::tarball);
-       add("tar_file",    &Loader::tar_file);
        add("version",     &Loader::version);
 }
 
 void SourcePackage::Loader::finish()
 {
        obj.components.sort(component_sort);
-
-       for(map<string, string>::const_iterator i=install_map.begin(); i!=install_map.end(); ++i)
-       {
-               for(ComponentList::iterator j=obj.components.begin(); j!=obj.components.end(); ++j)
-               {
-                       const Component::SourceList &sources = j->get_sources();
-                       for(Component::SourceList::const_iterator k=sources.begin(); k!=sources.end(); ++k)
-                       {
-                               string k_str = k->str();
-                               if(!i->first.compare(0, k_str.size(), k_str))
-                               {
-                                       const_cast<InstallMap &>(j->get_install_map()).add_mapping(obj.source_dir/i->first, i->second);
-                               }
-                       }
-               }
-       }
 }
 
 void SourcePackage::Loader::feature(const string &n, const string &d)
@@ -219,14 +200,6 @@ void SourcePackage::Loader::feature(const string &n, const string &d)
        }
 }
 
-void SourcePackage::Loader::condition(const string &c)
-{
-       IO::print("%s: Note: Old-style conditions are deprecated\n", get_source());
-       Condition cond(obj, c);
-       if(cond.eval())
-               load_sub_with(*this);
-}
-
 template<Component::Type t>
 void SourcePackage::Loader::component(const string &n)
 {
@@ -240,16 +213,6 @@ void SourcePackage::Loader::build_info()
        load_sub(obj.build_info);
 }
 
-void SourcePackage::Loader::headers(const string &n)
-{
-       IO::print("%s: Note: headers components are deprecated\n", get_source());
-       Component comp(obj, Component::LIBRARY, n);
-       load_sub(comp);
-       const Component::SourceList &sources = comp.get_sources();
-       for(Component::SourceList::const_iterator i=sources.begin(); i!=sources.end(); ++i)
-               install_map[i->str()] = "include/"+comp.get_name();
-}
-
 void SourcePackage::Loader::if_feature(const string &cond)
 {
        bool match = obj.match_feature(cond);
@@ -272,24 +235,8 @@ void SourcePackage::Loader::source_tarball()
 
 void SourcePackage::Loader::tarball(const string &n)
 {
-       if(n=="@src")
-       {
-               IO::print("%s: Note: Use source_tarball instead of tarball \"@src\"\n", get_source());
-               load_sub(*obj.source_tarball);
-       }
-       else
-       {
-               Component trbl(obj, Component::TARBALL, n);
-               load_sub(trbl);
-       }
-}
-
-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<Component::SourceList &>(i->get_sources()).push_back((obj.source_dir/f).str());
+       Component trbl(obj, Component::TARBALL, n);
+       load_sub(trbl);
 }
 
 void SourcePackage::Loader::version(const string &v)
index e5c315231f8e77aa084b68bfd78c18867bb1067c..1e0e5f9cde5b76cff7a5c282e195e9e2dba879fb 100644 (file)
@@ -6,7 +6,6 @@
 #include "buildinfo.h"
 #include "cache.h"
 #include "component.h"
-#include "condition.h"
 #include "config.h"
 #include "feature.h"
 #include "package.h"
@@ -32,7 +31,6 @@ public:
        {
        private:
                const Config::InputOptions *options;
-               std::map<std::string, std::string> install_map;
 
        public:
                Loader(SourcePackage &);
@@ -43,14 +41,11 @@ public:
                void feature(const std::string &, const std::string &);
                template<Component::Type>
                void component(const std::string &);
-               void condition(const std::string &);
                void build_info();
-               void headers(const std::string &);
                void if_feature(const std::string &);
                void interface_version(const std::string &);
                void source_tarball();
                void tarball(const std::string &);
-               void tar_file(const std::string &);
                void version(const std::string &);
        };