Gentoo Archives: gentoo-commits

From: "Petteri Räty" <betelgeuse@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/libbash:master commit in: utils/
Date: Sun, 03 Jun 2012 09:10:57
Message-Id: 1338028848.af86bf52b566c9e5c83b53f5a4f1a9689c827a9f.betelgeuse@gentoo
1 commit: af86bf52b566c9e5c83b53f5a4f1a9689c827a9f
2 Author: Mu Qiao <qiaomuf <AT> gentoo <DOT> org>
3 AuthorDate: Mon Mar 26 14:44:55 2012 +0000
4 Commit: Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
5 CommitDate: Sat May 26 10:40:48 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=af86bf52
7
8 Utils: handle RDEPEND for metadata generation
9
10 ---
11 utils/metadata.cpp | 6 ++++++
12 1 files changed, 6 insertions(+), 0 deletions(-)
13
14 diff --git a/utils/metadata.cpp b/utils/metadata.cpp
15 index ed07092..e0232ae 100644
16 --- a/utils/metadata.cpp
17 +++ b/utils/metadata.cpp
18 @@ -28,6 +28,7 @@
19 #include <boost/algorithm/string/classification.hpp>
20 #include <boost/algorithm/string/split.hpp>
21 #include <boost/algorithm/string/trim.hpp>
22 +#include <boost/lexical_cast.hpp>
23
24 static const std::vector<std::string> metadata_names = {"DEPEND", "RDEPEND", "SLOT", "SRC_URI",
25 "RESTRICT", "HOMEPAGE", "LICENSE", "DESCRIPTION",
26 @@ -56,6 +57,11 @@ void write_metadata(std::ostream& output,
27 std::unordered_map<std::string, std::vector<std::string>>& variables,
28 std::vector<std::string>& functions)
29 {
30 + int EAPI = 0;
31 + if(variables.find("EAPI") != variables.end())
32 + EAPI = boost::lexical_cast<int>(variables["EAPI"][0]);
33 + if(EAPI < 4 && variables.find("RDEPEND") == variables.end() && variables.find("DEPEND") != variables.end())
34 + variables["RDEPEND"] = variables["DEPEND"];
35 for(auto iter_name = metadata_names.begin(); iter_name != metadata_names.end(); ++iter_name)
36 {
37 auto iter_value = variables.find(*iter_name);