aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-02-01 12:44:50 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-02-01 12:44:50 +0000
commitd7d14e20c49247a6f8d12c30732ffeb6409a553a (patch)
tree0f4cc542bb2cf2818cbedff730fded448e1bcdf0
parent9f314d06ae24387194d098235472c2f35a60298d (diff)
downloadpaludis-d7d14e20c49247a6f8d12c30732ffeb6409a553a.tar.gz
paludis-d7d14e20c49247a6f8d12c30732ffeb6409a553a.tar.xz
Allow raw metadata display. Start of support for cumulatives.
-rw-r--r--ebuild/depend.bash8
-rw-r--r--ebuild/eclass_functions.bash15
-rw-r--r--src/command_line.cc1
-rw-r--r--src/command_line.hh3
-rw-r--r--src/query.cc55
5 files changed, 69 insertions, 13 deletions
diff --git a/ebuild/depend.bash b/ebuild/depend.bash
index 4048a15..062f4e4 100644
--- a/ebuild/depend.bash
+++ b/ebuild/depend.bash
@@ -24,9 +24,15 @@
ebuild_f_depend()
{
local key
+
+ IUSE="${IUSE} ${E_IUSE}"
+ DEPEND="${DEPEND} ${E_DEPEND}"
+ RDEPEND="${RDEPEND} ${E_RDEPEND}"
+ PDEPEND="${PDEPEND} ${E_PDEPEND}"
+
for key in DEPEND RDEPEND PDEPEND IUSE SLOT SRC_URI RESTRICT LICENSE \
KEYWORDS INHERITED PROVIDE EAPI HOMEPAGE DESCRIPTION ; do
- echo "${key}="${!key}""
+ echo "${key}="${!key}
done
}
diff --git a/ebuild/eclass_functions.bash b/ebuild/eclass_functions.bash
index ffd51ec..40eee81 100644
--- a/ebuild/eclass_functions.bash
+++ b/ebuild/eclass_functions.bash
@@ -38,8 +38,23 @@ inherit()
local location="${ECLASSDIR}/${e}.eclass"
local old_ECLASS="${ECLASS}"
export ECLASS="${e}"
+
+ local current_IUSE="${IUSE}" current_DEPEND="${DEPEND}"
+ local current_RDEPEND="${RDEPEND}" current_PDEPEND="${PDEPEND}"
+
+ unset IUSE DEPEND RDEPEND PDEPEND
+
+ echo "DEBUG: source eclass ${e}" 1>&2
source "${location}" || die "Error sourcing eclass ${e}"
hasq "${ECLASS}" ${INHERITED} || export INHERITED="${INHERITED} ${ECLASS}"
+
+ E_IUSE="${E_IUSE} ${IUSE}"
+ E_PDEPEND="${E_PDEPEND} ${PDEPEND}"
+ E_RDEPEND="${E_RDEPEND} ${RDEPEND}"
+ E_DEPEND="${E_DEPEND} ${DEPEND}"
+
+ unset IUSE DEPEND RDEPEND PDEPEND
+
export ECLASS="${old_ECLASS}"
done
}
diff --git a/src/command_line.cc b/src/command_line.cc
index 646f365..495da6d 100644
--- a/src/command_line.cc
+++ b/src/command_line.cc
@@ -38,6 +38,7 @@ CommandLine::CommandLine() :
a_show_slot(&query_args, "show-slot", 'S', "Show SLOTs"),
a_show_license(&query_args, "show-license", 'L', "Show licenses"),
a_show_licence(&a_show_license, "show-licence"),
+ a_show_metadata(&query_args, "show-metadata", 'M', "Show full metadata"),
install_args(this, "Install options"),
a_pretend(&install_args, "pretend", 'p', "Pretend only"),
diff --git a/src/command_line.hh b/src/command_line.hh
index 909ee0e..4f20888 100644
--- a/src/command_line.hh
+++ b/src/command_line.hh
@@ -99,6 +99,9 @@ class CommandLine :
/// --show-licence
paludis::args::AliasArg a_show_licence;
+ /// --show-metadata
+ paludis::args::SwitchArg a_show_metadata;
+
/// }
/// \name Install arguments
diff --git a/src/query.cc b/src/query.cc
index ced3ce9..ea788d3 100644
--- a/src/query.cc
+++ b/src/query.cc
@@ -119,19 +119,50 @@ void do_one_query(
/* display metadata */
p::VersionMetadata::ConstPointer metadata(env->package_database()->fetch_metadata(*entries->last()));
- if (! metadata->get(p::vmk_homepage).empty())
- std::cout << " " << std::setw(22) << std::left << "Homepage:" << std::setw(0) <<
- " " << metadata->get(p::vmk_homepage) << std::endl;
- if (! metadata->get(p::vmk_description).empty())
- std::cout << " " << std::setw(22) << std::left << "Description:" << std::setw(0) <<
+ if (CommandLine::get_instance()->a_show_metadata.specified())
+ {
+ std::cout << " " << std::setw(22) << std::left << "DEPEND:" << std::setw(0) <<
+ " " << metadata->get(p::vmk_depend) << std::endl;
+ std::cout << " " << std::setw(22) << std::left << "DESCRIPTION:" << std::setw(0) <<
" " << metadata->get(p::vmk_description) << std::endl;
- if (CommandLine::get_instance()->a_show_license.specified())
- if (! metadata->get(p::vmk_license).empty())
- std::cout << " " << std::setw(22) << std::left << "License:" << std::setw(0) <<
- " " << metadata->get(p::vmk_license) << std::endl;
- if (! metadata->get(p::vmk_virtual).empty())
- std::cout << " " << std::setw(22) << std::left << "Virtual for:" << std::setw(0) <<
- " " << metadata->get(p::vmk_virtual) << std::endl;
+ std::cout << " " << std::setw(22) << std::left << "HOMEPAGE:" << std::setw(0) <<
+ " " << metadata->get(p::vmk_homepage) << std::endl;
+ std::cout << " " << std::setw(22) << std::left << "IUSE:" << std::setw(0) <<
+ " " << metadata->get(p::vmk_iuse) << std::endl;
+ std::cout << " " << std::setw(22) << std::left << "KEYWORDS:" << std::setw(0) <<
+ " " << metadata->get(p::vmk_keywords) << std::endl;
+ std::cout << " " << std::setw(22) << std::left << "LICENSE:" << std::setw(0) <<
+ " " << metadata->get(p::vmk_license) << std::endl;
+ std::cout << " " << std::setw(22) << std::left << "PDEPEND:" << std::setw(0) <<
+ " " << metadata->get(p::vmk_pdepend) << std::endl;
+ std::cout << " " << std::setw(22) << std::left << "PROVIDE:" << std::setw(0) <<
+ " " << metadata->get(p::vmk_provide) << std::endl;
+ std::cout << " " << std::setw(22) << std::left << "RDEPEND:" << std::setw(0) <<
+ " " << metadata->get(p::vmk_rdepend) << std::endl;
+ std::cout << " " << std::setw(22) << std::left << "RESTRICT:" << std::setw(0) <<
+ " " << metadata->get(p::vmk_restrict) << std::endl;
+ std::cout << " " << std::setw(22) << std::left << "VIRTUAL:" << std::setw(0) <<
+ " " << metadata->get(p::vmk_virtual) << std::endl;
+ }
+ else
+ {
+ if (! metadata->get(p::vmk_homepage).empty())
+ std::cout << " " << std::setw(22) << std::left << "Homepage:" << std::setw(0) <<
+ " " << metadata->get(p::vmk_homepage) << std::endl;
+ if (! metadata->get(p::vmk_description).empty())
+ std::cout << " " << std::setw(22) << std::left << "Description:" << std::setw(0) <<
+ " " << metadata->get(p::vmk_description) << std::endl;
+ if (CommandLine::get_instance()->a_show_license.specified())
+ if (! metadata->get(p::vmk_license).empty())
+ std::cout << " " << std::setw(22) << std::left << "License:" << std::setw(0) <<
+ " " << metadata->get(p::vmk_license) << std::endl;
+ if (! metadata->get(p::vmk_virtual).empty())
+ std::cout << " " << std::setw(22) << std::left << "Virtual for:" << std::setw(0) <<
+ " " << metadata->get(p::vmk_virtual) << std::endl;
+ if (! metadata->get(p::vmk_provide).empty())
+ std::cout << " " << std::setw(22) << std::left << "Provides:" << std::setw(0) <<
+ " " << metadata->get(p::vmk_provide) << std::endl;
+ }
/* blank line */