diff options
author | 2012-03-26 22:44:55 +0800 | |
---|---|---|
committer | 2012-05-26 18:40:48 +0800 | |
commit | af86bf52b566c9e5c83b53f5a4f1a9689c827a9f (patch) | |
tree | db2325155e6954154ef1cef63675c2b2da85c761 | |
parent | Parser&Walker: improve escaped double quote handling (diff) | |
download | libbash-af86bf52b566c9e5c83b53f5a4f1a9689c827a9f.tar.gz libbash-af86bf52b566c9e5c83b53f5a4f1a9689c827a9f.tar.bz2 libbash-af86bf52b566c9e5c83b53f5a4f1a9689c827a9f.zip |
Utils: handle RDEPEND for metadata generation
-rw-r--r-- | utils/metadata.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/utils/metadata.cpp b/utils/metadata.cpp index ed07092..e0232ae 100644 --- a/utils/metadata.cpp +++ b/utils/metadata.cpp @@ -28,6 +28,7 @@ #include <boost/algorithm/string/classification.hpp> #include <boost/algorithm/string/split.hpp> #include <boost/algorithm/string/trim.hpp> +#include <boost/lexical_cast.hpp> static const std::vector<std::string> metadata_names = {"DEPEND", "RDEPEND", "SLOT", "SRC_URI", "RESTRICT", "HOMEPAGE", "LICENSE", "DESCRIPTION", @@ -56,6 +57,11 @@ void write_metadata(std::ostream& output, std::unordered_map<std::string, std::vector<std::string>>& variables, std::vector<std::string>& functions) { + int EAPI = 0; + if(variables.find("EAPI") != variables.end()) + EAPI = boost::lexical_cast<int>(variables["EAPI"][0]); + if(EAPI < 4 && variables.find("RDEPEND") == variables.end() && variables.find("DEPEND") != variables.end()) + variables["RDEPEND"] = variables["DEPEND"]; for(auto iter_name = metadata_names.begin(); iter_name != metadata_names.end(); ++iter_name) { auto iter_value = variables.find(*iter_name); |