if(!build_file)
build_file = new File(builder, *this, f);
components.push_back(Component(*this, Component::TARBALL, "@src"));
+ source_tarball = &components.back();
}
void SourcePackage::set_build_type(const BuildType &t)
add("headers", &Loader::headers);
add("install", &Loader::component<Component::INSTALL>);
add("datafile", &Loader::component<Component::DATAFILE>);
+ add("source_tarball", &Loader::source_tarball);
add("tarball", &Loader::tarball);
add("tar_file", &Loader::tar_file);
}
load_sub_with(*this);
}
+void SourcePackage::Loader::source_tarball()
+{
+ load_sub(*obj.source_tarball);
+}
+
void SourcePackage::Loader::tarball(const string &n)
{
if(n=="@src")
{
- for(ComponentList::iterator i=obj.components.begin(); i!=obj.components.end(); ++i)
- if(i->get_type()==Component::TARBALL && i->get_name()==n)
- load_sub(*i);
+ IO::print("%s: Note: Use source_tarball instead of tarball \"@src\"\n", get_source());
+ load_sub(*obj.source_tarball);
}
else
{
void headers(const std::string &);
void if_arch(const std::string &);
void if_feature(const std::string &);
+ void source_tarball();
void tarball(const std::string &);
void tar_file(const std::string &);
};
FeatureList features;
BuildInfo build_info;
ComponentList components;
+ Component *source_tarball;
Config config;
mutable Cache cache;