aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-30 15:43:24 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-30 15:43:24 +0000
commitab048d61cc539805070aca09d530aa392adcd48c (patch)
tree910263fef0610a454ece8e3a31b9bb851d44f419
parent422333ad6c5dfa06b780fbcc379ee1d7ae950fe6 (diff)
downloadpaludis-ab048d61cc539805070aca09d530aa392adcd48c.tar.gz
paludis-ab048d61cc539805070aca09d530aa392adcd48c.tar.xz
Enough of ebuild to get metadata for a select few packages
-rw-r--r--ebuild/depend.bash5
-rwxr-xr-x[-rw-r--r--]ebuild/ebuild.bash0
-rw-r--r--paludis/portage_repository.cc52
-rw-r--r--src/install.cc4
4 files changed, 52 insertions, 9 deletions
diff --git a/ebuild/depend.bash b/ebuild/depend.bash
index 7a79976..4048a15 100644
--- a/ebuild/depend.bash
+++ b/ebuild/depend.bash
@@ -24,8 +24,9 @@
ebuild_f_depend()
{
local key
- for key in DEPEND RDEPEND PDEPEND ; do
- echo "${key}='" ${!key} "'"
+ for key in DEPEND RDEPEND PDEPEND IUSE SLOT SRC_URI RESTRICT LICENSE \
+ KEYWORDS INHERITED PROVIDE EAPI HOMEPAGE DESCRIPTION ; do
+ echo "${key}="${!key}""
done
}
diff --git a/ebuild/ebuild.bash b/ebuild/ebuild.bash
index c50fd0f..c50fd0f 100644..100755
--- a/ebuild/ebuild.bash
+++ b/ebuild/ebuild.bash
diff --git a/paludis/portage_repository.cc b/paludis/portage_repository.cc
index b80c151..056c580 100644
--- a/paludis/portage_repository.cc
+++ b/paludis/portage_repository.cc
@@ -30,6 +30,7 @@
#include "package_database.hh"
#include "package_dep_atom.hh"
#include "portage_repository.hh"
+#include "pstream.hh"
#include "stringify.hh"
#include "strip.hh"
#include "tokeniser.hh"
@@ -615,6 +616,9 @@ PortageRepository::do_version_metadata(
std::make_pair(QualifiedPackageName(c, p), v)))
return _implementation->metadata.find(std::make_pair(QualifiedPackageName(c, p), v))->second;
+ Context context("When fetching metadata for " + stringify(c) + "/" + stringify(p) +
+ "-" + stringify(v));
+
if (! has_version(c, p, v))
throw InternalError(PALUDIS_HERE, "todo: has_version failed for do_version_metadata"); /// \bug todo
@@ -662,7 +666,39 @@ PortageRepository::do_version_metadata(
result->set(vmk_depend, "=" + stringify(vi->second->package()) + "-" + stringify(v));
}
else
- throw InternalError(PALUDIS_HERE, "no cache handling not implemented"); /// \todo
+ {
+ std::string cmd(
+ "env PV='" + stringify(p) + "-" + strip_trailing_string(
+ strip_trailing(stringify(v), "0123456789"), "-r") + "' " +
+ "PN='" + stringify(p) + "' "
+ "PVR='" + stringify(p) + "-" + stringify(v) + "' " +
+ "CATEGORY='" + stringify(c) + "' " +
+ "ECLASSDIR='" + stringify(_implementation->location) + "/eclass/' " +
+ "PORTDIR='" + stringify(_implementation->location) + "/' " +
+ "DISTDIR='" + stringify(_implementation->location) + "/distfiles/' " +
+ "ebuild/ebuild.bash metadata '" +
+ stringify(_implementation->location) + "/" + stringify(c) + "/" + stringify(p) + "/" +
+ stringify(p) + "-" + stringify(v) + ".ebuild'");
+
+ PStream p(cmd);
+ KeyValueConfigFile f(&p);
+
+ result->set(vmk_depend, f.get("DEPEND"));
+ result->set(vmk_rdepend, f.get("RDEPEND"));
+ result->set(vmk_slot, f.get("SLOT"));
+ result->set(vmk_src_uri, f.get("SRC_URI"));
+ result->set(vmk_restrict, f.get("RESTRICT"));
+ result->set(vmk_homepage, f.get("HOMEPAGE"));
+ result->set(vmk_license, f.get("LICENSE"));
+ result->set(vmk_description, f.get("DESCRIPTION"));
+ result->set(vmk_keywords, f.get("KEYWORDS"));
+ result->set(vmk_inherited, f.get("INHERITED"));
+ result->set(vmk_iuse, f.get("IUSE"));
+ result->set(vmk_pdepend, f.get("PDEPEND"));
+ result->set(vmk_provide, f.get("PROVIDE"));
+ result->set(vmk_eapi, f.get("EAPI"));
+ result->set(vmk_virtual, "");
+ }
_implementation->metadata.insert(std::make_pair(std::make_pair(QualifiedPackageName(c, p), v), result));
return result;
@@ -677,12 +713,16 @@ PortageRepository::do_query_repository_masks(const CategoryNamePart & c,
Context context("When querying repository mask for '" + stringify(c) + "/" + stringify(p) + "-"
+ stringify(v) + "':");
- LineConfigFile ff(_implementation->location / "profiles" / "package.mask");
- for (LineConfigFile::Iterator line(ff.begin()), line_end(ff.end()) ;
- line != line_end ; ++line)
+ FSEntry fff(_implementation->location / "profiles" / "package.mask");
+ if (fff.exists())
{
- PackageDepAtom::ConstPointer a(new PackageDepAtom(*line));
- _implementation->repo_mask[a->package()].push_back(a);
+ LineConfigFile ff(fff);
+ for (LineConfigFile::Iterator line(ff.begin()), line_end(ff.end()) ;
+ line != line_end ; ++line)
+ {
+ PackageDepAtom::ConstPointer a(new PackageDepAtom(*line));
+ _implementation->repo_mask[a->package()].push_back(a);
+ }
}
_implementation->has_repo_mask = true;
diff --git a/src/install.cc b/src/install.cc
index 6d98678..3da6f12 100644
--- a/src/install.cc
+++ b/src/install.cc
@@ -52,7 +52,9 @@ do_install()
if (std::string::npos != q->find('/'))
targets->add_child(p::DepParser::parse(*q));
else
- targets->add_child(p::DepAtom::Pointer(new p::PackageDepAtom(*q)));
+ targets->add_child(p::DepAtom::Pointer(new p::PackageDepAtom(
+ env->package_database()->fetch_unique_qualified_package_name(
+ p::PackageNamePart(*q)))));
}
p::DepList dep_list(env);