aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-01-29 03:19:25 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-01-29 03:19:25 +0000
commit6f9974546ead217b500fb08963817732425d8cf4 (patch)
tree91e36f8e1f76dc84a5a66ed94cc00225a6ffa0d8
parent7a971c183f7e4dee03281ceadc03138aeb1c6108 (diff)
downloadpaludis-6f9974546ead217b500fb08963817732425d8cf4.tar.gz
paludis-6f9974546ead217b500fb08963817732425d8cf4.tar.xz
New VersionMetadata interfaces. Fixes: ticket:40
-rw-r--r--ebuild/Makefile.am3
-rw-r--r--ebuild/builtin_fetch_bin.bash82
-rw-r--r--ebuild/builtin_init_bin.bash68
-rw-r--r--ebuild/builtin_unpack_bin.bash49
-rwxr-xr-xebuild/ebuild.bash6
-rw-r--r--paludis/dep_list/dep_list.cc113
-rw-r--r--paludis/dep_list/dep_list_TEST.cc194
-rw-r--r--paludis/dep_list/dep_list_TEST_blockers.cc80
-rw-r--r--paludis/dep_list/uninstall_list.cc24
-rw-r--r--paludis/dep_list/uninstall_list_TEST.cc18
-rw-r--r--paludis/ebin.cc213
-rw-r--r--paludis/ebin.hh175
-rw-r--r--paludis/ebin.sr69
-rw-r--r--paludis/ebuild.cc47
-rw-r--r--paludis/ebuild.hh20
-rw-r--r--paludis/environment.cc28
-rw-r--r--paludis/environment.hh7
-rw-r--r--paludis/files.m41
-rw-r--r--paludis/portage_dep_parser.cc8
-rw-r--r--paludis/portage_dep_parser.hh7
-rw-r--r--paludis/qa/dep_any_check.cc23
-rw-r--r--paludis/qa/dep_flags_check.cc63
-rw-r--r--paludis/qa/dep_packages_check.cc4
-rw-r--r--paludis/qa/deps_exist_check.cc6
-rw-r--r--paludis/qa/deps_visible_check.cc6
-rw-r--r--paludis/qa/extract_check.cc4
-rw-r--r--paludis/qa/inherits_check.cc4
-rw-r--r--paludis/qa/iuse_check.cc4
-rw-r--r--paludis/qa/keywords_check.cc6
-rw-r--r--paludis/qa/license_check.cc2
-rw-r--r--paludis/qa/parse_deps_check.cc8
-rw-r--r--paludis/qa/pdepend_overlap_check.cc6
-rw-r--r--paludis/qa/restrict_check.cc4
-rw-r--r--paludis/qa/src_uri_check.cc4
-rw-r--r--paludis/repositories/cran/Makefile.am2
-rw-r--r--paludis/repositories/cran/cran_description.cc27
-rw-r--r--paludis/repositories/cran/cran_description.hh3
-rw-r--r--paludis/repositories/cran/cran_installed_repository.cc13
-rw-r--r--paludis/repositories/cran/cran_repository.cc25
-rw-r--r--paludis/repositories/cran/cran_version_metadata.cc47
-rw-r--r--paludis/repositories/cran/cran_version_metadata.hh41
-rw-r--r--paludis/repositories/fake/fake_installed_repository.cc18
-rw-r--r--paludis/repositories/fake/fake_repository.cc15
-rw-r--r--paludis/repositories/fake/fake_repository_base.cc48
-rw-r--r--paludis/repositories/fake/fake_repository_base.hh38
-rw-r--r--paludis/repositories/gems/Makefile.am4
-rw-r--r--paludis/repositories/gems/gems_repository.cc4
-rw-r--r--paludis/repositories/gems/gems_version_metadata.cc43
-rw-r--r--paludis/repositories/gems/gems_version_metadata.hh44
-rw-r--r--paludis/repositories/nothing/nothing_repository.cc7
-rw-r--r--paludis/repositories/nothing/nothing_repository.hh2
-rw-r--r--paludis/repositories/portage/Makefile.am4
-rw-r--r--paludis/repositories/portage/ebuild_entries.cc12
-rw-r--r--paludis/repositories/portage/ebuild_flat_metadata_cache.cc44
-rw-r--r--paludis/repositories/portage/ebuild_flat_metadata_cache.hh7
-rw-r--r--paludis/repositories/portage/portage_repository.cc16
-rw-r--r--paludis/repositories/portage/portage_virtual_version_metadata.cc46
-rw-r--r--paludis/repositories/portage/portage_virtual_version_metadata.hh43
-rw-r--r--paludis/repositories/vdb/Makefile.am3
-rw-r--r--paludis/repositories/vdb/vdb_repository.cc46
-rw-r--r--paludis/repositories/vdb/vdb_version_metadata.cc66
-rw-r--r--paludis/repositories/vdb/vdb_version_metadata.hh59
-rw-r--r--paludis/tasks/find_unused_packages_task.cc4
-rw-r--r--paludis/tasks/report_task.cc4
-rw-r--r--paludis/version_metadata.cc110
-rw-r--r--paludis/version_metadata.hh237
-rw-r--r--paludis/version_metadata.sr91
-rw-r--r--ruby/demos/latest_stable.rb2
-rw-r--r--ruby/version_metadata.cc268
-rw-r--r--ruby/version_metadata_TEST.rb7
-rw-r--r--src/clients/adjutrix/find_dropped_keywords.cc4
-rw-r--r--src/clients/adjutrix/find_reverse_deps.cc10
-rw-r--r--src/clients/adjutrix/find_stable_candidates.cc4
-rw-r--r--src/clients/adjutrix/keywords_graph.cc4
-rw-r--r--src/clients/adjutrix/what_needs_keywording.cc4
-rw-r--r--src/clients/contrarius/install.cc21
-rw-r--r--src/clients/gtkpaludis/queue_list.cc6
-rw-r--r--src/clients/paludis/applets.cc8
-rw-r--r--src/clients/paludis/install.cc21
-rw-r--r--src/clients/paludis/query.cc115
-rw-r--r--src/output/console_install_task.cc17
-rw-r--r--src/output/use_flag_pretty_printer.cc10
82 files changed, 1360 insertions, 1670 deletions
diff --git a/ebuild/Makefile.am b/ebuild/Makefile.am
index 6c9ffcd..e7b2dd9 100644
--- a/ebuild/Makefile.am
+++ b/ebuild/Makefile.am
@@ -9,15 +9,12 @@ libexecprogdir = $(libexecdir)/paludis/
libexecprog_SCRIPTS = \
build_functions.bash \
builtin_fetch.bash \
- builtin_fetch_bin.bash \
builtin_init.bash \
- builtin_init_bin.bash \
builtin_merge.bash \
builtin_metadata.bash \
builtin_strip.bash \
builtin_tidyup.bash \
builtin_unmerge.bash \
- builtin_unpack_bin.bash \
builtin_variable.bash \
ebuild.bash \
echo_functions.bash \
diff --git a/ebuild/builtin_fetch_bin.bash b/ebuild/builtin_fetch_bin.bash
deleted file mode 100644
index 0c3360a..0000000
--- a/ebuild/builtin_fetch_bin.bash
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/bin/bash
-# vim: set sw=4 sts=4 et :
-
-# Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
-#
-# This file is part of the Paludis package manager. Paludis is free software;
-# you can redistribute it and/or modify it under the terms of the GNU General
-# Public License, version 2, as published by the Free Software Foundation.
-#
-# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-# details.
-#
-# You should have received a copy of the GNU General Public License along with
-# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-# Place, Suite 330, Boston, MA 02111-1307 USA
-
-builtin_fetch_bin()
-{
- [[ -d "${PKGDIR}" ]] || die "PKGDIR \"${PKGDIR}\" is not a directory"
-
- local a nofetch unique_aa old_aa
- for a in ${FLAT_BIN_URI} ; do
- local aa=${a##*/}
- hasq "${aa}" ${unique_aa} || unique_aa="${unique_aa} ${aa}"
-
- if [[ -f "${PKGDIR}/${aa}" ]] && [[ "0" != $(getfsize "${PKGDIR}/${aa}") ]] ; then
- if [[ "${old_aa}" != "${aa}" ]] ; then
- ebuild_section "Already have ${aa}"
- old_aa="${aa}"
- fi
- else
- if [[ -f "${PKGDIR}/${aa}" ]] ; then
- ebuild_section "Trying to remove existing ${aa}..."
- rm -f "${PKGDIR}/${aa}"
- fi
-
- prg="${PALUDIS_EBUILD_DIR}/fetchers/do$(echo ${a%%://*} )"
- if [[ -x "${prg}" ]] ; then
- ${prg} "${a}" "${PKGDIR}/${aa}"
- else
- eerror "Don't know how to fetch '${a}'"
- fi
- fi
- done
-
- for a in ${unique_aa} ; do
- [[ -f ${PKGDIR}/${a} ]] || nofetch="${nofetch} ${a}"
- done
-
- if [[ -n "${nofetch}" ]] ; then
- local c
- echo
- eerror "Couldn't fetch the following components:"
- for c in ${nofetch} ; do
- eerror " * ${c}"
- done
- echo
- die "builtin_fetch_bin failed"
- fi
-}
-
-ebuild_f_fetch_bin()
-{
- local old_sandbox_write="${SANDBOX_WRITE}"
- [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]] && SANDBOX_WRITE="${SANDBOX_WRITE+${SANDBOX_WRITE}:}${PKGDIR}"
- if hasq "fetch_bin" ${RESTRICT} ; then
- ebuild_section "Skipping builtin_fetch_bin (RESTRICT)"
- elif hasq "fetch_bin" ${SKIP_FUNCTIONS} ; then
- ebuild_section "Skipping builtin_fetch_bin (SKIP_FUNCTIONS)"
- else
- ebuild_section "Starting builtin_fetch_bin"
- builtin_fetch_bin
- ebuild_section "Done builtin_fetch_bin"
- fi
- [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]] && SANDBOX_WRITE="${old_sandbox_write}"
- true
-}
-
-
-
diff --git a/ebuild/builtin_init_bin.bash b/ebuild/builtin_init_bin.bash
deleted file mode 100644
index 115eccc..0000000
--- a/ebuild/builtin_init_bin.bash
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/bin/bash
-# vim: set sw=4 sts=4 et :
-
-# Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
-
-# This file is part of the Paludis package manager. Paludis is free software;
-# you can redistribute it and/or modify it under the terms of the GNU General
-# Public License, version 2, as published by the Free Software Foundation.
-#
-# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-# details.
-#
-# You should have received a copy of the GNU General Public License along with
-# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-# Place, Suite 330, Boston, MA 02111-1307 USA
-
-builtin_init_bin()
-{
- export ROOT="${ROOT//+(\/)//}"
-
- local a
- for a in P PV PR PN PVR PF CATEGORY PKGDIR \
- KV PALUDIS_TMPDIR PALUDIS_EBUILD_LOG_LEVEL PALUDIS_EBUILD_DIR \
- USERLAND KERNEL ARCH CHOST PALUDIS_COMMAND ROOT ; do
- [[ -z "${!a}" ]] && die "\$${a} unset or empty"
- declare -r ${a}="${!a}"
- done
-
- if [[ -e "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}" ]] ; then
- rm -fr "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}" || die "Couldn't remove previous work"
- fi
-
- export WORKDIR="${PALUDIS_TMPDIR}/${CATEGORY}/${PF}/work"
- mkdir -p "${WORKDIR}" || die "Couldn't create \$WORKDIR (\"${WORKDIR}\")"
- declare -r WORKDIR="${WORKDIR}"
-
- export T="${PALUDIS_TMPDIR}/${CATEGORY}/${PF}/temp/"
- mkdir -p "${T}" || die "Couldn't create \$T (\"${T}\")"
- declare -r T="${T}"
- export HOME="${T}"
-
- export D="${PALUDIS_TMPDIR}/${CATEGORY}/${PF}/image/"
- export D="${D//+(\/)//}"
- mkdir -p "${D}" || die "Couldn't create \$D (\"${D}\")"
- declare -r D="${D}"
-
- export IMAGE="${D}"
- declare -r IMAGE="${IMAGE}"
-
- export S="${WORKDIR}/${P}"
-}
-
-ebuild_f_init_bin()
-{
- if hasq "init_bin" ${RESTRICT} ; then
- ebuild_section "Skipping builtin_init_bin (RESTRICT)"
- elif hasq "init_bin" ${SKIP_FUNCTIONS} ; then
- ebuild_section "Skipping builtin_init_bin (SKIP_FUNCTIONS)"
- else
- ebuild_section "Starting builtin_init_bin"
- builtin_init_bin
- ebuild_section "Done builtin_init_bin"
- fi
-}
-
-
diff --git a/ebuild/builtin_unpack_bin.bash b/ebuild/builtin_unpack_bin.bash
deleted file mode 100644
index eaf1e30..0000000
--- a/ebuild/builtin_unpack_bin.bash
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/bin/bash
-# vim: set sw=4 sts=4 et :
-
-# Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
-#
-# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
-# Gentoo Foundation and distributed under the terms of the GNU General
-# Public License v2.
-#
-# This file is part of the Paludis package manager. Paludis is free software;
-# you can redistribute it and/or modify it under the terms of the GNU General
-# Public License, version 2, as published by the Free Software Foundation.
-#
-# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-# details.
-#
-# You should have received a copy of the GNU General Public License along with
-# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-# Place, Suite 330, Boston, MA 02111-1307 USA
-
-builtin_unpack_bin()
-{
- unpack --binary ${B}
- local ebuild_dir="${IMAGE}/tmp/paludis-ebin/${SRC_REPOSITORY}/${CATEGORY}/${PF}/"
- [[ -d "${ebuild_dir}" ]] || die "ebuild_dir not a directory. Invalid binary package?"
- mv "${ebuild_dir}/"* "${WORKDIR}"/
- rm -fr "${IMAGE}/tmp/paludis-ebin"
- export PALUDIS_LOAD_ENVIRONMENT="${WORKDIR}/environment.bz2"
- ebuild_load_ebuild "${WORKDIR}/${PF}.ebuild"
-}
-
-ebuild_f_unpack_bin()
-{
- cd ${WORKDIR} || die "cd to \${WORKDIR} (\"${WORKDIR}\") failed"
-
- if hasq "unpack_bin" ${RESTRICT} ; then
- ebuild_section "Skipping builtin_unpack_bin (RESTRICT)"
- elif hasq "unpack_bin" ${SKIP_FUNCTIONS} ; then
- ebuild_section "Skipping builtin_unpack_bin (SKIP_FUNCTIONS)"
- else
- ebuild_section "Starting builtin_unpack_bin"
- builtin_unpack_bin
- ebuild_section "Done builtin_unpack_bin"
- fi
-}
-
-
diff --git a/ebuild/ebuild.bash b/ebuild/ebuild.bash
index 5be8bcf..6d562ba 100755
--- a/ebuild/ebuild.bash
+++ b/ebuild/ebuild.bash
@@ -296,7 +296,7 @@ ebuild_main()
for action in $@ ; do
case ${action} in
- metadata|variable|init|fetch|merge|unmerge|tidyup|strip|init_bin|unpack_bin|fetch_bin)
+ metadata|variable|init|fetch|merge|unmerge|tidyup|strip)
ebuild_load_module builtin_${action}
;;
@@ -331,9 +331,7 @@ ebuild_main()
fi
perform_hook ebuild_${action}_post
else
- if [[ "${ebuild%.ebin}" == "${ebuild}" ]] ; then
- ebuild_load_ebuild "${ebuild}"
- fi
+ ebuild_load_ebuild "${ebuild}"
for action in $@ ; do
export EBUILD_PHASE="${action}"
perform_hook ebuild_${action}_pre
diff --git a/paludis/dep_list/dep_list.cc b/paludis/dep_list/dep_list.cc
index 7f13288..2215866 100644
--- a/paludis/dep_list/dep_list.cc
+++ b/paludis/dep_list/dep_list.cc
@@ -111,6 +111,26 @@ namespace paludis
namespace
{
+ class FakedVirtualVersionMetadata :
+ public VersionMetadata,
+ public VersionMetadataVirtualInterface
+ {
+ public:
+ FakedVirtualVersionMetadata(const SlotName & s, const PackageDatabaseEntry & e) :
+ VersionMetadata(
+ VersionMetadataBase(s, "", "", "paludis-1"),
+ VersionMetadataCapabilities::create()
+ .cran_interface(0)
+ .virtual_interface(this)
+ .ebuild_interface(0)
+ .deps_interface(0)
+ .origins_interface(0)
+ .license_interface(0)),
+ VersionMetadataVirtualInterface(e)
+ {
+ }
+ };
+
struct GenerationGreaterThan
{
long g;
@@ -864,9 +884,9 @@ DepList::AddVisitor::visit(const BlockDepAtom * const a)
if ((*r)->metadata->slot == metadata->slot)
{
/* if it's a virtual, it only replaces if it's the same package. */
- if ((*r)->metadata->get_virtual_interface())
+ if ((*r)->metadata->virtual_interface)
{
- if ((*r)->metadata->get_virtual_interface()->virtual_for.name == aa->name)
+ if ((*r)->metadata->virtual_interface->virtual_for.name == aa->name)
replaced = true;
}
else
@@ -885,8 +905,8 @@ DepList::AddVisitor::visit(const BlockDepAtom * const a)
if (aa->name == d->_imp->current_pde()->name)
continue;
- if (metadata->get_virtual_interface() &&
- metadata->get_virtual_interface()->virtual_for.name == d->_imp->current_pde()->name)
+ if (metadata->virtual_interface &&
+ metadata->virtual_interface->virtual_for.name == d->_imp->current_pde()->name)
continue;
}
@@ -924,8 +944,8 @@ DepList::AddVisitor::visit(const BlockDepAtom * const a)
if ((*r)->package.name == d->_imp->current_pde()->name)
continue;
- if ((*r)->metadata->get_virtual_interface() &&
- (*r)->metadata->get_virtual_interface()->virtual_for.name == d->_imp->current_pde()->name)
+ if ((*r)->metadata->virtual_interface &&
+ (*r)->metadata->virtual_interface->virtual_for.name == d->_imp->current_pde()->name)
continue;
}
@@ -1061,7 +1081,7 @@ DepList::add_package(const PackageDatabaseEntry & p, DepTag::ConstPointer tag)
.tags(DepListEntryTags::Pointer(new DepListEntryTags::Concrete))
.destinations(RepositoryNameCollection::Pointer(new RepositoryNameCollection::Concrete))
.associated_entry(0)
- .kind(metadata->get_virtual_interface() ? dlk_virtual : dlk_package))),
+ .kind(metadata->virtual_interface ? dlk_virtual : dlk_package))),
our_merge_entry_post_position(our_merge_entry_position);
_imp->merge_list_index.insert(std::make_pair(p.name, our_merge_entry_position));
@@ -1082,9 +1102,9 @@ DepList::add_package(const PackageDatabaseEntry & p, DepTag::ConstPointer tag)
_imp->merge_list_insert_position = our_merge_entry_position;
/* add provides */
- if (metadata->get_ebuild_interface())
+ if (metadata->ebuild_interface)
{
- DepAtomFlattener f(_imp->env, _imp->current_pde(), metadata->get_ebuild_interface()->provide());
+ DepAtomFlattener f(_imp->env, _imp->current_pde(), metadata->ebuild_interface->provide());
for (DepAtomFlattener::Iterator i(f.begin()), i_end(f.end()) ; i != i_end ; ++i)
{
PackageDepAtom::Pointer pp(new PackageDepAtom("=" + (*i)->text() + "-" + stringify(p.version)));
@@ -1106,9 +1126,8 @@ DepList::add_package(const PackageDatabaseEntry & p, DepTag::ConstPointer tag)
else
{
VersionMetadata::Pointer mm(0);
- mm.assign(new VersionMetadata::Virtual(metadata->deps.parser,
+ mm.assign(new FakedVirtualVersionMetadata(metadata->slot,
PackageDatabaseEntry(p.name, p.version, RepositoryName("virtuals"))));
- mm->slot = metadata->slot;
m = mm;
}
@@ -1126,33 +1145,39 @@ DepList::add_package(const PackageDatabaseEntry & p, DepTag::ConstPointer tag)
}
}
- /* add suggests */
- if (_imp->opts->suggested == dl_suggested_show)
+ if (metadata->deps_interface)
{
- Context c("When showing suggestions:");
- Save<MergeList::iterator> suggest_save_merge_list_insert_position(&_imp->merge_list_insert_position,
- next(our_merge_entry_position));
- ShowSuggestVisitor visitor(this);
- metadata->deps.suggested_depend()->accept(&visitor);
- }
+ /* add suggests */
+ if (_imp->opts->suggested == dl_suggested_show)
+ {
+ Context c("When showing suggestions:");
+ Save<MergeList::iterator> suggest_save_merge_list_insert_position(&_imp->merge_list_insert_position,
+ next(our_merge_entry_position));
+ ShowSuggestVisitor visitor(this);
+ metadata->deps_interface->suggested_depend()->accept(&visitor);
+ }
- /* add pre dependencies */
- add_predeps(metadata->deps.build_depend(), _imp->opts->uninstalled_deps_pre, "build");
- add_predeps(metadata->deps.run_depend(), _imp->opts->uninstalled_deps_runtime, "run");
- add_predeps(metadata->deps.post_depend(), _imp->opts->uninstalled_deps_post, "post");
- if (_imp->opts->suggested == dl_suggested_install)
- add_predeps(metadata->deps.suggested_depend(), _imp->opts->uninstalled_deps_suggested, "suggest");
+ /* add pre dependencies */
+ add_predeps(metadata->deps_interface->build_depend(), _imp->opts->uninstalled_deps_pre, "build");
+ add_predeps(metadata->deps_interface->run_depend(), _imp->opts->uninstalled_deps_runtime, "run");
+ add_predeps(metadata->deps_interface->post_depend(), _imp->opts->uninstalled_deps_post, "post");
+ if (_imp->opts->suggested == dl_suggested_install)
+ add_predeps(metadata->deps_interface->suggested_depend(), _imp->opts->uninstalled_deps_suggested, "suggest");
+ }
our_merge_entry_position->state = dle_has_pre_deps;
_imp->merge_list_insert_position = next(our_merge_entry_post_position);
- /* add post dependencies */
- add_postdeps(metadata->deps.build_depend(), _imp->opts->uninstalled_deps_pre, "build");
- add_postdeps(metadata->deps.run_depend(), _imp->opts->uninstalled_deps_runtime, "run");
- add_postdeps(metadata->deps.post_depend(), _imp->opts->uninstalled_deps_post, "post");
+ if (metadata->deps_interface)
+ {
+ /* add post dependencies */
+ add_postdeps(metadata->deps_interface->build_depend(), _imp->opts->uninstalled_deps_pre, "build");
+ add_postdeps(metadata->deps_interface->run_depend(), _imp->opts->uninstalled_deps_runtime, "run");
+ add_postdeps(metadata->deps_interface->post_depend(), _imp->opts->uninstalled_deps_post, "post");
- if (_imp->opts->suggested == dl_suggested_install)
- add_postdeps(metadata->deps.suggested_depend(), _imp->opts->uninstalled_deps_suggested, "suggest");
+ if (_imp->opts->suggested == dl_suggested_install)
+ add_postdeps(metadata->deps_interface->suggested_depend(), _imp->opts->uninstalled_deps_suggested, "suggest");
+ }
our_merge_entry_position->state = dle_has_all_deps;
}
@@ -1317,16 +1342,22 @@ DepList::add_already_installed_package(const PackageDatabaseEntry & p, DepTag::C
Save<MergeList::const_iterator> save_current_merge_list_entry(&_imp->current_merge_list_entry,
our_merge_entry);
- add_predeps(metadata->deps.build_depend(), _imp->opts->installed_deps_pre, "build");
- add_predeps(metadata->deps.run_depend(), _imp->opts->installed_deps_runtime, "run");
- add_predeps(metadata->deps.post_depend(), _imp->opts->installed_deps_post, "post");
+ if (metadata->deps_interface)
+ {
+ add_predeps(metadata->deps_interface->build_depend(), _imp->opts->installed_deps_pre, "build");
+ add_predeps(metadata->deps_interface->run_depend(), _imp->opts->installed_deps_runtime, "run");
+ add_predeps(metadata->deps_interface->post_depend(), _imp->opts->installed_deps_post, "post");
+ }
our_merge_entry->state = dle_has_pre_deps;
_imp->merge_list_insert_position = next(our_merge_entry);
- add_postdeps(metadata->deps.build_depend(), _imp->opts->installed_deps_pre, "build");
- add_postdeps(metadata->deps.run_depend(), _imp->opts->installed_deps_runtime, "run");
- add_postdeps(metadata->deps.post_depend(), _imp->opts->installed_deps_post, "post");
+ if (metadata->deps_interface)
+ {
+ add_postdeps(metadata->deps_interface->build_depend(), _imp->opts->installed_deps_pre, "build");
+ add_postdeps(metadata->deps_interface->run_depend(), _imp->opts->installed_deps_runtime, "run");
+ add_postdeps(metadata->deps_interface->post_depend(), _imp->opts->installed_deps_post, "post");
+ }
}
namespace
@@ -1435,10 +1466,10 @@ DepList::prefer_installed_over_uninstalled(const PackageDatabaseEntry & installe
if (dl_reinstall_if_use_changed == _imp->opts->reinstall)
{
- const EbuildVersionMetadata * const evm_i(_imp->env->package_database()->fetch_repository(
- installed.repository)->version_metadata(installed.name, installed.version)->get_ebuild_interface());
- const EbuildVersionMetadata * const evm_u(_imp->env->package_database()->fetch_repository(
- uninstalled.repository)->version_metadata(uninstalled.name, uninstalled.version)->get_ebuild_interface());
+ const VersionMetadataEbuildInterface * const evm_i(_imp->env->package_database()->fetch_repository(
+ installed.repository)->version_metadata(installed.name, installed.version)->ebuild_interface);
+ const VersionMetadataEbuildInterface * const evm_u(_imp->env->package_database()->fetch_repository(
+ uninstalled.repository)->version_metadata(uninstalled.name, uninstalled.version)->ebuild_interface);
std::set<std::string> use_i, use_u, use_common;
if (evm_i)
diff --git a/paludis/dep_list/dep_list_TEST.cc b/paludis/dep_list/dep_list_TEST.cc
index 76e954e..99db71b 100644
--- a/paludis/dep_list/dep_list_TEST.cc
+++ b/paludis/dep_list/dep_list_TEST.cc
@@ -66,7 +66,7 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "cat/two";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/two";
repo->add_version("cat", "two", "1");
}
@@ -86,8 +86,8 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "cat/two";
- repo->add_version("cat", "two", "1")->deps.build_depend_string = "cat/three";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/two";
+ repo->add_version("cat", "two", "1")->deps_interface->build_depend_string = "cat/three";
repo->add_version("cat", "three", "1");
}
@@ -108,7 +108,7 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "cat/two cat/three";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/two cat/three";
repo->add_version("cat", "two", "1");
repo->add_version("cat", "three", "1");
}
@@ -130,8 +130,8 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "cat/two cat/three";
- repo->add_version("cat", "two", "1")->deps.build_depend_string = "cat/three";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/two cat/three";
+ repo->add_version("cat", "two", "1")->deps_interface->build_depend_string = "cat/three";
repo->add_version("cat", "three", "1");
}
@@ -152,9 +152,9 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "cat/two cat/three";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/two cat/three";
repo->add_version("cat", "two", "1");
- repo->add_version("cat", "three", "1")->deps.build_depend_string = "cat/two";
+ repo->add_version("cat", "three", "1")->deps_interface->build_depend_string = "cat/two";
}
void populate_expected()
@@ -174,9 +174,9 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "cat/two cat/three";
- repo->add_version("cat", "two", "1")->deps.build_depend_string = "cat/four";
- repo->add_version("cat", "three", "1")->deps.build_depend_string = "cat/four";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/two cat/three";
+ repo->add_version("cat", "two", "1")->deps_interface->build_depend_string = "cat/four";
+ repo->add_version("cat", "three", "1")->deps_interface->build_depend_string = "cat/four";
repo->add_version("cat", "four", "1");
}
@@ -198,9 +198,9 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "cat/two cat/three";
- repo->add_version("cat", "two", "1")->deps.build_depend_string = "cat/four cat/three";
- repo->add_version("cat", "three", "1")->deps.build_depend_string = "cat/four";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/two cat/three";
+ repo->add_version("cat", "two", "1")->deps_interface->build_depend_string = "cat/four cat/three";
+ repo->add_version("cat", "three", "1")->deps_interface->build_depend_string = "cat/four";
repo->add_version("cat", "four", "1");
}
@@ -222,9 +222,9 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "cat/two cat/three";
- repo->add_version("cat", "two", "1")->deps.build_depend_string = "cat/four";
- repo->add_version("cat", "three", "1")->deps.build_depend_string = "cat/four cat/two";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/two cat/three";
+ repo->add_version("cat", "two", "1")->deps_interface->build_depend_string = "cat/four";
+ repo->add_version("cat", "three", "1")->deps_interface->build_depend_string = "cat/four cat/two";
repo->add_version("cat", "four", "1");
}
@@ -246,7 +246,7 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "|| ( cat/two cat/three )";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "|| ( cat/two cat/three )";
repo->add_version("cat", "two", "1");
repo->add_version("cat", "three", "1");
}
@@ -267,9 +267,9 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "cat/two cat/three";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/two cat/three";
repo->add_version("cat", "two", "1");
- repo->add_version("cat", "three", "1")->deps.build_depend_string = "|| ( cat/two cat/four )";
+ repo->add_version("cat", "three", "1")->deps_interface->build_depend_string = "|| ( cat/two cat/four )";
repo->add_version("cat", "four", "1");
}
@@ -290,7 +290,7 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "|| ( ( cat/two cat/three ) cat/four )";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "|| ( ( cat/two cat/three ) cat/four )";
repo->add_version("cat", "two", "1");
repo->add_version("cat", "three", "1");
repo->add_version("cat", "four", "1");
@@ -313,10 +313,10 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "cat/two cat/three cat/four";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/two cat/three cat/four";
repo->add_version("cat", "two", "1");
repo->add_version("cat", "three", "1");
- repo->add_version("cat", "four", "1")->deps.build_depend_string = "|| ( ( cat/two cat/three ) cat/five )";
+ repo->add_version("cat", "four", "1")->deps_interface->build_depend_string = "|| ( ( cat/two cat/three ) cat/five )";
}
void populate_expected()
@@ -337,7 +337,7 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "|| ( cat/two cat/three )";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "|| ( cat/two cat/three )";
repo->add_version("cat", "three", "1");
}
@@ -357,8 +357,8 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "|| ( cat/two cat/three )";
- repo->add_version("cat", "two", "1")->deps.build_depend_string = "cat/four";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "|| ( cat/two cat/three )";
+ repo->add_version("cat", "two", "1")->deps_interface->build_depend_string = "cat/four";
repo->add_version("cat", "three", "1");
}
@@ -378,7 +378,7 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "cat/two:slot2";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/two:slot2";
repo->add_version("cat", "two", "1.1")->slot = SlotName("slot1");
repo->add_version("cat", "two", "1.2")->slot = SlotName("slot2");
repo->add_version("cat", "two", "1.3")->slot = SlotName("slot3");
@@ -400,7 +400,7 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "<cat/two-1.2-r2:slot2";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "<cat/two-1.2-r2:slot2";
repo->add_version("cat", "two", "1.1")->slot = SlotName("slot1");
repo->add_version("cat", "two", "1.2")->slot = SlotName("slot2");
repo->add_version("cat", "two", "1.2-r1")->slot = SlotName("slot2");
@@ -424,7 +424,7 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "|| ( )";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "|| ( )";
}
void populate_expected()
@@ -442,7 +442,7 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "enabled? ( cat/two )";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "enabled? ( cat/two )";
repo->add_version("cat", "two", "1");
}
@@ -462,7 +462,7 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "!enabled? ( cat/two )";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "!enabled? ( cat/two )";
repo->add_version("cat", "two", "1");
}
@@ -481,7 +481,7 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "disabled? ( cat/two )";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "disabled? ( cat/two )";
repo->add_version("cat", "two", "1");
}
@@ -500,7 +500,7 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "!disabled? ( cat/two )";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "!disabled? ( cat/two )";
repo->add_version("cat", "two", "1");
}
@@ -520,7 +520,7 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "|| ( enabled? ( cat/two ) cat/three )";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "|| ( enabled? ( cat/two ) cat/three )";
repo->add_version("cat", "two", "1");
repo->add_version("cat", "three", "1");
}
@@ -541,7 +541,7 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "|| ( !enabled? ( cat/two ) cat/three )";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "|| ( !enabled? ( cat/two ) cat/three )";
repo->add_version("cat", "two", "1");
repo->add_version("cat", "three", "1");
}
@@ -562,7 +562,7 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "|| ( disabled? ( cat/two ) cat/three )";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "|| ( disabled? ( cat/two ) cat/three )";
repo->add_version("cat", "two", "1");
repo->add_version("cat", "three", "1");
}
@@ -583,7 +583,7 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "|| ( !disabled? ( cat/two ) cat/three )";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "|| ( !disabled? ( cat/two ) cat/three )";
repo->add_version("cat", "two", "1");
repo->add_version("cat", "three", "1");
}
@@ -604,7 +604,7 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "cat/three || ( enabled? ( cat/two ) cat/three )";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/three || ( enabled? ( cat/two ) cat/three )";
repo->add_version("cat", "two", "1");
repo->add_version("cat", "three", "1");
}
@@ -625,7 +625,7 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "cat/three || ( !enabled? ( cat/two ) cat/three )";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/three || ( !enabled? ( cat/two ) cat/three )";
repo->add_version("cat", "two", "1");
repo->add_version("cat", "three", "1");
}
@@ -646,7 +646,7 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "cat/three || ( disabled? ( cat/two ) cat/three )";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/three || ( disabled? ( cat/two ) cat/three )";
repo->add_version("cat", "two", "1");
repo->add_version("cat", "three", "1");
}
@@ -667,7 +667,7 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "cat/three || ( !disabled? ( cat/two ) cat/three )";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/three || ( !disabled? ( cat/two ) cat/three )";
repo->add_version("cat", "two", "1");
repo->add_version("cat", "three", "1");
}
@@ -688,7 +688,7 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "cat/three || ( enabled? ( cat/three ) cat/two )";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/three || ( enabled? ( cat/three ) cat/two )";
repo->add_version("cat", "two", "1");
repo->add_version("cat", "three", "1");
}
@@ -709,7 +709,7 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "cat/three || ( !enabled? ( cat/three ) cat/two )";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/three || ( !enabled? ( cat/three ) cat/two )";
repo->add_version("cat", "two", "1");
repo->add_version("cat", "three", "1");
}
@@ -731,7 +731,7 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "cat/three || ( disabled? ( cat/three ) cat/two )";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/three || ( disabled? ( cat/three ) cat/two )";
repo->add_version("cat", "two", "1");
repo->add_version("cat", "three", "1");
}
@@ -753,7 +753,7 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "cat/three || ( !disabled? ( cat/three ) cat/two )";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/three || ( !disabled? ( cat/three ) cat/two )";
repo->add_version("cat", "two", "1");
repo->add_version("cat", "three", "1");
}
@@ -774,7 +774,7 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "|| ( enabled1? ( cat/two ) enabled2? ( cat/three ) )";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "|| ( enabled1? ( cat/two ) enabled2? ( cat/three ) )";
repo->add_version("cat", "two", "1");
repo->add_version("cat", "three", "1");
}
@@ -795,7 +795,7 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "|| ( !enabled1? ( cat/two ) enabled2? ( cat/three ) )";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "|| ( !enabled1? ( cat/two ) enabled2? ( cat/three ) )";
repo->add_version("cat", "two", "1");
repo->add_version("cat", "three", "1");
}
@@ -816,7 +816,7 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "|| ( !enabled1? ( cat/two ) !enabled2? ( cat/three ) )";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "|| ( !enabled1? ( cat/two ) !enabled2? ( cat/three ) )";
repo->add_version("cat", "two", "1");
repo->add_version("cat", "three", "1");
}
@@ -836,8 +836,8 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "|| ( cat/two cat/three )";
- repo->add_version("cat", "two", "1")->deps.build_depend_string = "cat/one";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "|| ( cat/two cat/three )";
+ repo->add_version("cat", "two", "1")->deps_interface->build_depend_string = "cat/one";
repo->add_version("cat", "three", "1");
}
@@ -857,8 +857,8 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "|| ( cat/two cat/three )";
- repo->add_version("cat", "two", "1")->deps.post_depend_string = "cat/one";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "|| ( cat/two cat/three )";
+ repo->add_version("cat", "two", "1")->deps_interface->post_depend_string = "cat/one";
repo->add_version("cat", "three", "1");
}
@@ -878,7 +878,7 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "( cat/two cat/two )";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "( cat/two cat/two )";
repo->add_version("cat", "two", "1");
}
@@ -898,8 +898,8 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "( cat/two[enabled] )";
- repo->add_version("cat", "two", "1")->get_ebuild_interface()->iuse = "enabled";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "( cat/two[enabled] )";
+ repo->add_version("cat", "two", "1")->ebuild_interface->iuse = "enabled";
}
void populate_expected()
@@ -918,8 +918,8 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "( cat/two[-disabled] )";
- repo->add_version("cat", "two", "1")->get_ebuild_interface()->iuse = "disabled";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "( cat/two[-disabled] )";
+ repo->add_version("cat", "two", "1")->ebuild_interface->iuse = "disabled";
}
void populate_expected()
@@ -938,8 +938,8 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "( cat/two[disabled] )";
- repo->add_version("cat", "two", "1")->get_ebuild_interface()->iuse = "disabled";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "( cat/two[disabled] )";
+ repo->add_version("cat", "two", "1")->ebuild_interface->iuse = "disabled";
}
void populate_expected()
@@ -964,8 +964,8 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "( cat/two[-enabled] )";
- repo->add_version("cat", "two", "1")->get_ebuild_interface()->iuse = "enabled";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "( cat/two[-enabled] )";
+ repo->add_version("cat", "two", "1")->ebuild_interface->iuse = "enabled";
}
void populate_expected()
@@ -990,8 +990,8 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "( cat/two cat/two[enabled] )";
- repo->add_version("cat", "two", "1")->get_ebuild_interface()->iuse = "enabled";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "( cat/two cat/two[enabled] )";
+ repo->add_version("cat", "two", "1")->ebuild_interface->iuse = "enabled";
}
void populate_expected()
@@ -1010,8 +1010,8 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "( cat/two cat/two[-disabled] )";
- repo->add_version("cat", "two", "1")->get_ebuild_interface()->iuse = "disabled";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "( cat/two cat/two[-disabled] )";
+ repo->add_version("cat", "two", "1")->ebuild_interface->iuse = "disabled";
}
void populate_expected()
@@ -1030,8 +1030,8 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "( cat/two cat/two[disabled] )";
- repo->add_version("cat", "two", "1")->get_ebuild_interface()->iuse = "disabled";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "( cat/two cat/two[disabled] )";
+ repo->add_version("cat", "two", "1")->ebuild_interface->iuse = "disabled";
}
void populate_expected()
@@ -1056,8 +1056,8 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "( cat/two cat/two[-enabled] )";
- repo->add_version("cat", "two", "1")->get_ebuild_interface()->iuse = "enabled";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "( cat/two cat/two[-enabled] )";
+ repo->add_version("cat", "two", "1")->ebuild_interface->iuse = "enabled";
}
void populate_expected()
@@ -1082,7 +1082,7 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.post_depend_string = "cat/two";
+ repo->add_version("cat", "one", "1")->deps_interface->post_depend_string = "cat/two";
repo->add_version("cat", "two", "1");
}
@@ -1102,8 +1102,8 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.post_depend_string = "cat/two";
- repo->add_version("cat", "two", "1")->deps.build_depend_string = "cat/three";
+ repo->add_version("cat", "one", "1")->deps_interface->post_depend_string = "cat/two";
+ repo->add_version("cat", "two", "1")->deps_interface->build_depend_string = "cat/three";
repo->add_version("cat", "three", "1");
}
@@ -1124,8 +1124,8 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.post_depend_string = "cat/two";
- repo->add_version("cat", "two", "1")->deps.build_depend_string = "cat/one";
+ repo->add_version("cat", "one", "1")->deps_interface->post_depend_string = "cat/two";
+ repo->add_version("cat", "two", "1")->deps_interface->build_depend_string = "cat/one";
}
void populate_expected()
@@ -1144,8 +1144,8 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "cat/two || ( cat/three cat/four )";
- repo->add_version("cat", "two", "1")->get_ebuild_interface()->provide_string = "cat/four";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/two || ( cat/three cat/four )";
+ repo->add_version("cat", "two", "1")->ebuild_interface->provide_string = "cat/four";
repo->add_version("cat", "three", "1");
}
@@ -1166,9 +1166,9 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.post_depend_string = "cat/two";
- repo->add_version("cat", "two", "1")->deps.build_depend_string = "cat/three";
- repo->add_version("cat", "three", "1")->deps.build_depend_string = "cat/one";
+ repo->add_version("cat", "one", "1")->deps_interface->post_depend_string = "cat/two";
+ repo->add_version("cat", "two", "1")->deps_interface->build_depend_string = "cat/three";
+ repo->add_version("cat", "three", "1")->deps_interface->build_depend_string = "cat/one";
}
void populate_expected()
@@ -1188,7 +1188,7 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->get_ebuild_interface()->provide_string = "cat/two";
+ repo->add_version("cat", "one", "1")->ebuild_interface->provide_string = "cat/two";
}
void populate_expected()
@@ -1207,7 +1207,7 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "|| ( cat/two >=cat/three-2 )";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "|| ( cat/two >=cat/three-2 )";
repo->add_version("cat", "two", "1");
repo->add_version("cat", "three", "2");
installed_repo->add_version("cat", "three", "1");
@@ -1229,7 +1229,7 @@ namespace test_cases
{
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "|| ( cat/two >=cat/three-3 )";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "|| ( cat/two >=cat/three-3 )";
repo->add_version("cat", "two", "1");
repo->add_version("cat", "three", "2");
installed_repo->add_version("cat", "three", "1");
@@ -1257,13 +1257,13 @@ namespace test_cases
FakeRepository::Pointer repo(new FakeRepository(&env, RepositoryName("repo")));
env.package_database()->add_repository(repo);
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "cat/two cat/three";
- repo->add_version("cat", "two", "1")->deps.build_depend_string = "cat/four";
- repo->add_version("cat", "three", "1")->deps.build_depend_string = "cat/four cat/two";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/two cat/three";
+ repo->add_version("cat", "two", "1")->deps_interface->build_depend_string = "cat/four";
+ repo->add_version("cat", "three", "1")->deps_interface->build_depend_string = "cat/four cat/two";
repo->add_version("cat", "four", "1");
- repo->add_version("cat", "five", "1")->deps.build_depend_string = "cat/six cat/seven";
+ repo->add_version("cat", "five", "1")->deps_interface->build_depend_string = "cat/six cat/seven";
repo->add_version("cat", "six", "1");
- repo->add_version("cat", "seven", "1")->deps.build_depend_string = "cat/doesnotexist";
+ repo->add_version("cat", "seven", "1")->deps_interface->build_depend_string = "cat/doesnotexist";
DepList d(&env, DepListOptions());
d.add(PortageDepParser::parse("cat/one"));
@@ -1291,13 +1291,13 @@ namespace test_cases
FakeRepository::Pointer repo(new FakeRepository(&env, RepositoryName("repo")));
env.package_database()->add_repository(repo);
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "cat/two cat/three";
- repo->add_version("cat", "two", "1")->deps.build_depend_string = "cat/four";
- repo->add_version("cat", "three", "1")->deps.build_depend_string = "cat/four cat/two";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/two cat/three";
+ repo->add_version("cat", "two", "1")->deps_interface->build_depend_string = "cat/four";
+ repo->add_version("cat", "three", "1")->deps_interface->build_depend_string = "cat/four cat/two";
repo->add_version("cat", "four", "1");
- repo->add_version("cat", "five", "1")->deps.build_depend_string = "cat/six cat/seven";
+ repo->add_version("cat", "five", "1")->deps_interface->build_depend_string = "cat/six cat/seven";
repo->add_version("cat", "six", "1");
- repo->add_version("cat", "seven", "1")->deps.post_depend_string = "cat/doesnotexist";
+ repo->add_version("cat", "seven", "1")->deps_interface->post_depend_string = "cat/doesnotexist";
DepList d(&env, DepListOptions());
d.add(PortageDepParser::parse("cat/one"));
@@ -1351,7 +1351,7 @@ namespace test_cases
FakeRepository::Pointer repo(new FakeRepository(&env, RepositoryName("repo")));
env.package_database()->add_repository(repo);
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "cat/two";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/two";
FakeInstalledRepository::Pointer installed_repo(
new FakeInstalledRepository(&env, RepositoryName("installed_repo")));
@@ -1377,7 +1377,7 @@ namespace test_cases
FakeRepository::Pointer repo(new FakeRepository(&env, RepositoryName("repo")));
env.package_database()->add_repository(repo);
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "cat/two";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/two";
FakeInstalledRepository::Pointer installed_repo(
new FakeInstalledRepository(&env, RepositoryName("installed_repo")));
@@ -1405,7 +1405,7 @@ namespace test_cases
FakeRepository::Pointer repo(new FakeRepository(&env, RepositoryName("repo")));
env.package_database()->add_repository(repo);
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "cat/two";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/two";
FakeInstalledRepository::Pointer installed_repo(
new FakeInstalledRepository(&env, RepositoryName("installed_repo")));
@@ -1446,7 +1446,7 @@ namespace test_cases
FakeRepository::Pointer repo(new FakeRepository(&env, RepositoryName("repo")));
env.package_database()->add_repository(repo);
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "cat/two";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/two";
repo->add_version("cat", "two", "2");
FakeInstalledRepository::Pointer installed_repo(
@@ -1479,7 +1479,7 @@ namespace test_cases
FakeRepository::Pointer repo(new FakeRepository(&env, RepositoryName("repo")));
env.package_database()->add_repository(repo);
- repo->add_version("cat", "zero", "1")->deps.build_depend_string =
+ repo->add_version("cat", "zero", "1")->deps_interface->build_depend_string =
"( cat/one cat/two cat/three-live cat/four-cvs cat/five-svn cat/six-darcs )";
repo->add_version("cat", "one", "scm");
repo->add_version("cat", "two", "2");
diff --git a/paludis/dep_list/dep_list_TEST_blockers.cc b/paludis/dep_list/dep_list_TEST_blockers.cc
index fba8534..3dddac5 100644
--- a/paludis/dep_list/dep_list_TEST_blockers.cc
+++ b/paludis/dep_list/dep_list_TEST_blockers.cc
@@ -30,7 +30,7 @@ namespace test_cases
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "!cat/two";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "!cat/two";
installed_repo->add_version("cat", "two", "1");
}
@@ -63,8 +63,8 @@ namespace test_cases
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "cat/two";
- repo->add_version("cat", "two", "1")->deps.build_depend_string = "!cat/two";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/two";
+ repo->add_version("cat", "two", "1")->deps_interface->build_depend_string = "!cat/two";
}
void populate_expected()
@@ -81,10 +81,10 @@ namespace test_cases
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "cat/two";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/two";
VersionMetadata::Pointer two_m(repo->add_version("cat", "two", "1"));
- two_m->deps.build_depend_string = "!virtual/two";
- two_m->get_ebuild_interface()->provide_string = "virtual/two";
+ two_m->deps_interface->build_depend_string = "!virtual/two";
+ two_m->ebuild_interface->provide_string = "virtual/two";
}
void populate_expected()
@@ -102,11 +102,11 @@ namespace test_cases
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "cat/two";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/two";
VersionMetadata::Pointer two_m(repo->add_version("cat", "two", "1"));
- two_m->deps.build_depend_string = "!virtual/two";
- two_m->get_ebuild_interface()->provide_string = "virtual/two";
- installed_repo->add_version("other", "two", "1")->get_ebuild_interface()->provide_string = "virtual/two";
+ two_m->deps_interface->build_depend_string = "!virtual/two";
+ two_m->ebuild_interface->provide_string = "virtual/two";
+ installed_repo->add_version("other", "two", "1")->ebuild_interface->provide_string = "virtual/two";
}
void populate_expected()
@@ -142,9 +142,9 @@ namespace test_cases
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "cat/two cat/three";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/two cat/three";
repo->add_version("cat", "two", "1");
- repo->add_version("cat", "three", "1")->deps.build_depend_string = "!cat/two";
+ repo->add_version("cat", "three", "1")->deps_interface->build_depend_string = "!cat/two";
}
void populate_expected()
@@ -168,9 +168,9 @@ namespace test_cases
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = ">=cat/two-2 cat/three";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = ">=cat/two-2 cat/three";
repo->add_version("cat", "two", "2");
- repo->add_version("cat", "three", "1")->deps.build_depend_string = "!<cat/two-2";
+ repo->add_version("cat", "three", "1")->deps_interface->build_depend_string = "!<cat/two-2";
installed_repo->add_version("cat", "two", "1");
}
@@ -189,8 +189,8 @@ namespace test_cases
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "cat/two";
- repo->add_version("cat", "two", "1")->deps.build_depend_string = "!cat/two";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/two";
+ repo->add_version("cat", "two", "1")->deps_interface->build_depend_string = "!cat/two";
installed_repo->add_version("cat", "two", "1");
}
@@ -209,12 +209,12 @@ namespace test_cases
void populate_repo()
{
VersionMetadata::Pointer one_m(repo->add_version("cat", "one", "1"));
- one_m->get_ebuild_interface()->provide_string = "virtual/one";
- one_m->deps.build_depend_string = "!virtual/one";
- one_m->deps.run_depend_string = "!virtual/one";
+ one_m->ebuild_interface->provide_string = "virtual/one";
+ one_m->deps_interface->build_depend_string = "!virtual/one";
+ one_m->deps_interface->run_depend_string = "!virtual/one";
VersionMetadata::Pointer i_one_m(installed_repo->add_version("cat", "one", "1"));
- i_one_m->get_ebuild_interface()->provide_string = "virtual/one";
- i_one_m->deps.run_depend_string = "!virtual/one";
+ i_one_m->ebuild_interface->provide_string = "virtual/one";
+ i_one_m->deps_interface->run_depend_string = "!virtual/one";
}
void populate_expected()
@@ -232,12 +232,12 @@ namespace test_cases
void populate_repo()
{
VersionMetadata::Pointer one_m(repo->add_version("cat", "one", "1"));
- one_m->get_ebuild_interface()->provide_string = "virtual/one";
- one_m->deps.build_depend_string = "!virtual/one";
- one_m->deps.run_depend_string = "!virtual/one";
+ one_m->ebuild_interface->provide_string = "virtual/one";
+ one_m->deps_interface->build_depend_string = "!virtual/one";
+ one_m->deps_interface->run_depend_string = "!virtual/one";
VersionMetadata::Pointer i_one_m(installed_repo->add_version("cat", "one", "1"));
- i_one_m->get_ebuild_interface()->provide_string = "virtual/one";
- i_one_m->deps.run_depend_string = "!virtual/one";
+ i_one_m->ebuild_interface->provide_string = "virtual/one";
+ i_one_m->deps_interface->run_depend_string = "!virtual/one";
}
void populate_expected()
@@ -259,11 +259,11 @@ namespace test_cases
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "cat/two";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/two";
VersionMetadata::Pointer two_m(repo->add_version("cat", "two", "2"));
- two_m->get_ebuild_interface()->provide_string = "virtual/two";
- two_m->deps.build_depend_string = "!virtual/two";
- installed_repo->add_version("cat", "two", "1")->get_ebuild_interface()->provide_string = "virtual/two";
+ two_m->ebuild_interface->provide_string = "virtual/two";
+ two_m->deps_interface->build_depend_string = "!virtual/two";
+ installed_repo->add_version("cat", "two", "1")->ebuild_interface->provide_string = "virtual/two";
}
void populate_expected()
@@ -281,8 +281,8 @@ namespace test_cases
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "cat/two";
- repo->add_version("cat", "two", "2")->deps.build_depend_string = "!<cat/two-2";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/two";
+ repo->add_version("cat", "two", "2")->deps_interface->build_depend_string = "!<cat/two-2";
installed_repo->add_version("cat", "two", "1");
}
@@ -307,11 +307,11 @@ namespace test_cases
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "cat/two";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/two";
VersionMetadata::Pointer two_m(repo->add_version("cat", "two", "2"));
- two_m->deps.build_depend_string = "!<virtual/two-2";
- two_m->get_ebuild_interface()->provide_string = "virtual/two";
- installed_repo->add_version("cat", "two", "1")->get_ebuild_interface()->provide_string = "virtual/two";
+ two_m->deps_interface->build_depend_string = "!<virtual/two-2";
+ two_m->ebuild_interface->provide_string = "virtual/two";
+ installed_repo->add_version("cat", "two", "1")->ebuild_interface->provide_string = "virtual/two";
}
void populate_expected()
@@ -335,11 +335,11 @@ namespace test_cases
void populate_repo()
{
- repo->add_version("cat", "one", "1")->deps.build_depend_string = "cat/two";
+ repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/two";
VersionMetadata::Pointer two_m(repo->add_version("cat", "two", "2"));
- two_m->deps.build_depend_string = "!<virtual/two-2";
- two_m->get_ebuild_interface()->provide_string = "virtual/two";
- installed_repo->add_version("other", "two", "1")->get_ebuild_interface()->provide_string = "virtual/two";
+ two_m->deps_interface->build_depend_string = "!<virtual/two-2";
+ two_m->ebuild_interface->provide_string = "virtual/two";
+ installed_repo->add_version("other", "two", "1")->ebuild_interface->provide_string = "virtual/two";
}
void populate_expected()
diff --git a/paludis/dep_list/uninstall_list.cc b/paludis/dep_list/uninstall_list.cc
index b5ab02c..681ac8f 100644
--- a/paludis/dep_list/uninstall_list.cc
+++ b/paludis/dep_list/uninstall_list.cc
@@ -252,7 +252,7 @@ UninstallList::add_package(const PackageDatabaseEntry & e, const PackageDatabase
std::list<UninstallListEntry>::iterator i(_imp->uninstall_list.insert(
_imp->uninstall_list.end(), UninstallListEntry(
- e, m->get_virtual_interface(), SortedCollection<DepTag::Pointer>::Pointer(
+ e, m->virtual_interface, SortedCollection<DepTag::Pointer>::Pointer(
new SortedCollection<DepTag::Pointer>::Concrete))));
if (t)
i->tags->insert(DepTag::Pointer(new DependencyDepTag(*t)));
@@ -366,10 +366,13 @@ UninstallList::collect_depped_upon(ArbitrarilyOrderedPackageDatabaseEntryCollect
DepCollector c(_imp->env, *i);
VersionMetadata::ConstPointer metadata(_imp->env->package_database()->fetch_repository(
i->repository)->version_metadata(i->name, i->version));
- metadata->deps.build_depend()->accept(&c);
- metadata->deps.run_depend()->accept(&c);
- metadata->deps.post_depend()->accept(&c);
- metadata->deps.suggested_depend()->accept(&c);
+ if (metadata->deps_interface)
+ {
+ metadata->deps_interface->build_depend()->accept(&c);
+ metadata->deps_interface->run_depend()->accept(&c);
+ metadata->deps_interface->post_depend()->accept(&c);
+ metadata->deps_interface->suggested_depend()->accept(&c);
+ }
cache = _imp->dep_collector_cache.insert(std::make_pair(*i,
ArbitrarilyOrderedPackageDatabaseEntryCollection::ConstPointer(c.matches))).first;
}
@@ -459,10 +462,13 @@ UninstallList::add_dependencies(const PackageDatabaseEntry & e)
DepCollector c(_imp->env, *i);
VersionMetadata::ConstPointer metadata(_imp->env->package_database()->fetch_repository(
i->repository)->version_metadata(i->name, i->version));
- metadata->deps.build_depend()->accept(&c);
- metadata->deps.run_depend()->accept(&c);
- metadata->deps.post_depend()->accept(&c);
- metadata->deps.suggested_depend()->accept(&c);
+ if (metadata->deps_interface)
+ {
+ metadata->deps_interface->build_depend()->accept(&c);
+ metadata->deps_interface->run_depend()->accept(&c);
+ metadata->deps_interface->post_depend()->accept(&c);
+ metadata->deps_interface->suggested_depend()->accept(&c);
+ }
cache = _imp->dep_collector_cache.insert(std::make_pair(*i,
ArbitrarilyOrderedPackageDatabaseEntryCollection::ConstPointer(c.matches))).first;
}
diff --git a/paludis/dep_list/uninstall_list_TEST.cc b/paludis/dep_list/uninstall_list_TEST.cc
index eaef0a1..36befe9 100644
--- a/paludis/dep_list/uninstall_list_TEST.cc
+++ b/paludis/dep_list/uninstall_list_TEST.cc
@@ -200,7 +200,7 @@ namespace test_cases
void populate_repo()
{
- installed_repo->add_version("foo", "bar", "1")->deps.build_depend_string = "foo/baz";
+ installed_repo->add_version("foo", "bar", "1")->deps_interface->build_depend_string = "foo/baz";
installed_repo->add_version("foo", "baz", "2");
}
@@ -230,8 +230,8 @@ namespace test_cases
void populate_repo()
{
- installed_repo->add_version("foo", "bar", "1")->deps.build_depend_string = "foo/baz";
- installed_repo->add_version("foo", "baz", "2")->deps.build_depend_string = "foo/moo";
+ installed_repo->add_version("foo", "bar", "1")->deps_interface->build_depend_string = "foo/baz";
+ installed_repo->add_version("foo", "baz", "2")->deps_interface->build_depend_string = "foo/moo";
installed_repo->add_version("foo", "moo", "3");
}
@@ -262,9 +262,9 @@ namespace test_cases
void populate_repo()
{
- installed_repo->add_version("foo", "bar", "1")->deps.build_depend_string = "foo/baz foo/oink";
+ installed_repo->add_version("foo", "bar", "1")->deps_interface->build_depend_string = "foo/baz foo/oink";
installed_repo->add_version("foo", "baz", "2");
- installed_repo->add_version("foo", "moo", "3")->deps.build_depend_string = "foo/oink";
+ installed_repo->add_version("foo", "moo", "3")->deps_interface->build_depend_string = "foo/oink";
installed_repo->add_version("foo", "oink", "1");
}
@@ -296,9 +296,9 @@ namespace test_cases
void populate_repo()
{
- installed_repo->add_version("foo", "bar", "1")->deps.build_depend_string = "foo/baz foo/oink";
+ installed_repo->add_version("foo", "bar", "1")->deps_interface->build_depend_string = "foo/baz foo/oink";
installed_repo->add_version("foo", "baz", "2");
- installed_repo->add_version("foo", "moo", "3")->deps.build_depend_string = "foo/oink";
+ installed_repo->add_version("foo", "moo", "3")->deps_interface->build_depend_string = "foo/oink";
installed_repo->add_version("foo", "oink", "1");
}
@@ -335,7 +335,7 @@ namespace test_cases
void populate_repo()
{
- installed_repo->add_version("foo", "bar", "1")->deps.build_depend_string = "foo/baz foo/moo";
+ installed_repo->add_version("foo", "bar", "1")->deps_interface->build_depend_string = "foo/baz foo/moo";
installed_repo->add_version("foo", "baz", "2");
installed_repo->add_version("foo", "moo", "2");
}
@@ -371,7 +371,7 @@ namespace test_cases
void populate_repo()
{
- installed_repo->add_version("foo", "bar", "1")->deps.build_depend_string = "foo/baz foo/moo";
+ installed_repo->add_version("foo", "bar", "1")->deps_interface->build_depend_string = "foo/baz foo/moo";
installed_repo->add_version("foo", "baz", "2");
installed_repo->add_version("foo", "moo", "2");
}
diff --git a/paludis/ebin.cc b/paludis/ebin.cc
deleted file mode 100644
index 1bcac33..0000000
--- a/paludis/ebin.cc
+++ /dev/null
@@ -1,213 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include <paludis/ebin.hh>
-#include <paludis/util/system.hh>
-#include <paludis/util/strip.hh>
-#include <paludis/util/pstream.hh>
-#include <paludis/util/log.hh>
-#include <paludis/environment.hh>
-#include <paludis/config_file.hh>
-#include <paludis/portage_dep_parser.hh>
-#include <sys/resource.h>
-#include <sys/time.h>
-#include <unistd.h>
-
-/** \file
- * Implementation for ebin.hh things.
- *
- * \ingroup grpebininterface
- */
-
-using namespace paludis;
-
-#include <paludis/ebin-sr.cc>
-
-EbinCommand::EbinCommand(const EbinCommandParams & p) :
- params(p)
-{
-}
-
-EbinCommand::~EbinCommand()
-{
-}
-
-bool
-EbinCommand::success()
-{
- return true;
-}
-
-bool
-EbinCommand::use_sandbox() const
-{
- return true;
-}
-
-bool
-EbinCommand::failure()
-{
- return false;
-}
-
-bool
-EbinCommand::operator() ()
-{
- std::string ebin_cmd(getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis") +
- "/ebuild.bash '" +
- stringify(params.ebin_dir) + "/" +
- stringify(params.db_entry->name.package) + "-" +
- stringify(params.db_entry->version) +
- ".ebin' " + commands());
-
- if (use_sandbox())
- ebin_cmd = make_sandbox_command(ebin_cmd);
-
- MakeEnvCommand cmd(extend_command(make_env_command(ebin_cmd)
- ("P", stringify(params.db_entry->name.package) + "-" +
- stringify(params.db_entry->version.remove_revision()))
- ("PV", stringify(params.db_entry->version.remove_revision()))
- ("PR", stringify(params.db_entry->version.revision_only()))
- ("PN", stringify(params.db_entry->name.package))
- ("PVR", stringify(params.db_entry->version))
- ("PF", stringify(params.db_entry->name.package) + "-" +
- stringify(params.db_entry->version))
- ("CATEGORY", stringify(params.db_entry->name.category))
- ("REPOSITORY", stringify(params.db_entry->repository))
- ("SRC_REPOSITORY", stringify(params.src_repository))
- ("PKGDIR", stringify(params.pkgdir))
- ("PALUDIS_TMPDIR", stringify(params.buildroot))
- ("PALUDIS_CONFIG_DIR", SYSCONFDIR "/paludis/")
- ("PALUDIS_BASHRC_FILES", params.environment->bashrc_files())
- ("PALUDIS_HOOK_DIRS", params.environment->hook_dirs())
- ("PALUDIS_COMMAND", params.environment->paludis_command())
- ("KV", kernel_version())
- ("PALUDIS_EBUILD_LOG_LEVEL", stringify(Log::get_instance()->log_level()))
- ("PALUDIS_EBUILD_DIR", getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis"))));
-
- if (do_run_command(add_portage_vars(cmd)))
- return success();
- else
- return failure();
-}
-
-MakeEnvCommand
-EbinCommand::add_portage_vars(const MakeEnvCommand & cmd) const
-{
- return cmd
- ("PORTAGE_BASHRC", "/dev/null")
- ("PORTAGE_BUILDDIR", stringify(params.buildroot) + "/" +
- stringify(params.db_entry->name.category) + "/" +
- stringify(params.db_entry->name.package) + "-" +
- stringify(params.db_entry->version))
- ("PORTAGE_CALLER", params.environment->paludis_command())
- ("PORTAGE_GID", "0")
- ("PORTAGE_INST_GID", "0")
- ("PORTAGE_INST_UID", "0")
- ("PORTAGE_MASTER_PID", stringify(::getpid()))
- ("PORTAGE_NICENCESS", stringify(::getpriority(PRIO_PROCESS, 0)))
- ("PORTAGE_TMPDIR", stringify(params.buildroot))
- ("PORTAGE_TMPFS", "/dev/shm")
- ("PORTAGE_WORKDIR_MODE", "0700");
-}
-
-bool
-EbinCommand::do_run_command(const std::string & cmd)
-{
- return 0 == run_command(cmd);
-}
-
-std::string
-EbinFetchCommand::commands() const
-{
- return "fetch_bin";
-}
-
-bool
-EbinFetchCommand::failure()
-{
- throw PackageFetchActionError("Fetch failed for '" + stringify(
- *params.db_entry) + "'");
-}
-
-MakeEnvCommand
-EbinFetchCommand::extend_command(const MakeEnvCommand & cmd)
-{
- MakeEnvCommand result(cmd
- ("B", fetch_params.b)
- ("FLAT_BIN_URI", fetch_params.flat_bin_uri)
- ("ROOT", fetch_params.root)
- ("PALUDIS_PROFILE_DIR", stringify(*fetch_params.profiles->begin()))
- ("PALUDIS_PROFILE_DIRS", join(fetch_params.profiles->begin(),
- fetch_params.profiles->end(), " ")));
-
- return result;
-}
-
-EbinFetchCommand::EbinFetchCommand(const EbinCommandParams & p,
- const EbinFetchCommandParams & f) :
- EbinCommand(p),
- fetch_params(f)
-{
-}
-
-std::string
-EbinInstallCommand::commands() const
-{
- return "init_bin unpack_bin setup strip preinst merge postinst tidyup";
-}
-
-bool
-EbinInstallCommand::failure()
-{
- throw PackageInstallActionError("Install failed for '" + stringify(
- *params.db_entry) + "'");
-}
-
-MakeEnvCommand
-EbinInstallCommand::extend_command(const MakeEnvCommand & cmd)
-{
- MakeEnvCommand result(cmd
- ("B", install_params.b)
- ("USE", install_params.use)
- ("USE_EXPAND", install_params.use_expand)
- ("ROOT", install_params.root)
- ("PALUDIS_EBUILD_OVERRIDE_CONFIG_PROTECT_MASK",
- install_params.disable_cfgpro ? "/" : "")
- ("PALUDIS_PROFILE_DIR", stringify(*install_params.profiles->begin()))
- ("PALUDIS_PROFILE_DIRS", join(install_params.profiles->begin(),
- install_params.profiles->end(), " "))
- ("SLOT", stringify(install_params.slot)));
-
- for (AssociativeCollection<std::string, std::string>::Iterator
- i(install_params.expand_vars->begin()),
- j(install_params.expand_vars->end()) ; i != j ; ++i)
- result = result(i->first, i->second);
-
- return result;
-}
-
-EbinInstallCommand::EbinInstallCommand(const EbinCommandParams & p,
- const EbinInstallCommandParams & f) :
- EbinCommand(p),
- install_params(f)
-{
-}
-
-
diff --git a/paludis/ebin.hh b/paludis/ebin.hh
deleted file mode 100644
index 51a470e..0000000
--- a/paludis/ebin.hh
+++ /dev/null
@@ -1,175 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_EBIN_HH
-#define PALUDIS_GUARD_PALUDIS_EBIN_HH 1
-
-#include <paludis/util/instantiation_policy.hh>
-#include <paludis/util/sr.hh>
-#include <paludis/util/fs_entry.hh>
-#include <paludis/util/attributes.hh>
-#include <paludis/util/collection.hh>
-#include <paludis/package_database.hh>
-#include <string>
-
-/** \file
- * Declarations for the EbinCommand classes.
- *
- * \ingroup grpebininterface
- */
-
-namespace paludis
-{
- class Environment;
- class MakeEnvCommand;
-
-#include <paludis/ebin-sr.hh>
-
- /**
- * An EbinCommand is the base class from which specific ebin
- * command interfaces are descended.
- *
- * \ingroup grpebininterface
- */
- class EbinCommand :
- private InstantiationPolicy<EbinCommand, instantiation_method::NonCopyableTag>
- {
- protected:
- /**
- * Our parameters.
- */
- const EbinCommandParams params;
-
- /**
- * Constructor.
- */
- EbinCommand(const EbinCommandParams &);
-
- /**
- * Override in descendents: which commands (for example, 'prerm
- * unmerge postrm') do we give to ebin.bash?
- */
- virtual std::string commands() const = 0;
-
- /**
- * Actions to be taken after a successful command.
- *
- * The return value of this function is used for the return value
- * of operator().
- */
- virtual bool success();
-
- /**
- * Should the sandbox, if available, be used?
- */
- virtual bool use_sandbox() const;
-
- /**
- * Actions to be taken after a failed command.
- *
- * The return value of this function is used for the return value
- * of operator(). In some descendents, this function throws and
- * does not return.
- */
- virtual bool failure() = 0;
-
- /**
- * Run the specified command. Can be overridden if, for example,
- * the command output needs to be captured.
- *
- * \return Whether the command succeeded.
- */
- virtual bool do_run_command(const std::string &);
-
- /**
- * Add Portage emulation vars.
- */
- virtual MakeEnvCommand add_portage_vars(const MakeEnvCommand &) const;
-
- /**
- * Extend the command to be run.
- */
- virtual MakeEnvCommand extend_command(const MakeEnvCommand &) = 0;
-
- public:
- /**
- * Destructor.
- */
- virtual ~EbinCommand();
-
- /**
- * Run the command.
- */
- virtual bool operator() ();
- };
-
- /**
- * An EbinFetchCommand is used to download and verify the digests for a
- * particular ebin in a PortageRepository. On failure it throws.
- *
- * \ingroup grpebininterface
- */
- class EbinFetchCommand :
- public EbinCommand
- {
- protected:
- /// Parameters for fetch.
- const EbinFetchCommandParams fetch_params;
-
- virtual std::string commands() const;
-
- virtual bool failure() PALUDIS_ATTRIBUTE((noreturn));
-
- virtual MakeEnvCommand extend_command(const MakeEnvCommand &);
-
- public:
- /**
- * Constructor.
- */
- EbinFetchCommand(const EbinCommandParams &, const EbinFetchCommandParams &);
- };
-
- /**
- * An EbinInstallCommand is used to install an ebin from a
- * PortageRepository. On failure it throws.
- *
- * \ingroup grpebininterface
- */
- class EbinInstallCommand :
- public EbinCommand
- {
- protected:
- /// Parameters for install.
- const EbinInstallCommandParams install_params;
-
- virtual std::string commands() const;
-
- virtual bool failure() PALUDIS_ATTRIBUTE((noreturn));
-
- virtual MakeEnvCommand extend_command(const MakeEnvCommand &);
-
- public:
- /**
- * Constructor.
- */
- EbinInstallCommand(const EbinCommandParams &, const EbinInstallCommandParams &);
- };
-}
-
-#endif
diff --git a/paludis/ebin.sr b/paludis/ebin.sr
deleted file mode 100644
index 7f8bd52..0000000
--- a/paludis/ebin.sr
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/bin/bash
-# vim: set sw=4 sts=4 et :
-
-make_class_EbinCommandParams()
-{
- key ebin_dir "FSEntry"
- key environment "const Environment *"
- key db_entry "const PackageDatabaseEntry *"
- key src_repository "RepositoryName"
- key pkgdir "FSEntry"
- key buildroot "FSEntry"
-
- doxygen_comment << "END"
- /**
- * Parameters for an EbinCommand.
- *
- * \see EbinCommand
- * \ingroup grpebininterface
- * \nosubgrouping
- */
-END
-
- allow_named_args
-}
-
-make_class_EbinFetchCommandParams()
-{
- key b std::string
- key flat_bin_uri std::string
- key root std::string
- key profiles FSEntryCollection::ConstPointer
-
- doxygen_comment << "END"
- /**
- * Parameters for an EbinFetchCommand.
- *
- * \see EbinFetchCommand
- * \ingroup grpebininterface
- * \nosubgrouping
- */
-END
-
- allow_named_args
-}
-
-make_class_EbinInstallCommandParams()
-{
- key b std::string
- key use std::string
- key use_expand std::string
- key root std::string
- key profiles FSEntryCollection::ConstPointer
- key expand_vars "AssociativeCollection<std::string, std::string>::ConstPointer"
- key disable_cfgpro bool
- key slot SlotName
-
- doxygen_comment << "END"
- /**
- * Parameters for an EbinInstallCommand.
- *
- * \see EbinInstallCommand
- * \ingroup grpebininterface
- * \nosubgrouping
- */
-END
-
- allow_named_args
-}
-
diff --git a/paludis/ebuild.cc b/paludis/ebuild.cc
index babf5ef..e58d092 100644
--- a/paludis/ebuild.cc
+++ b/paludis/ebuild.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -175,25 +175,25 @@ EbuildMetadataCommand::do_run_command(const std::string & cmd)
{
PStream prog(cmd);
KeyValueConfigFile f(&prog);
- _metadata.assign(new VersionMetadata::Ebuild(PortageDepParser::parse_depend));
+ _metadata.assign(new EbuildVersionMetadata);
bool ok(false);
try
{
- _metadata->deps.build_depend_string = f.get("DEPEND");
- _metadata->deps.run_depend_string = f.get("RDEPEND");
+ _metadata->build_depend_string = f.get("DEPEND");
+ _metadata->run_depend_string = f.get("RDEPEND");
_metadata->slot = SlotName(f.get("SLOT"));
- _metadata->get_ebuild_interface()->src_uri = f.get("SRC_URI");
- _metadata->get_ebuild_interface()->restrict_string = f.get("RESTRICT");
+ _metadata->src_uri = f.get("SRC_URI");
+ _metadata->restrict_string = f.get("RESTRICT");
_metadata->homepage = f.get("HOMEPAGE");
- _metadata->license_string = f.get("LICENSE");
+ _metadata->license_interface->license_string = f.get("LICENSE");
_metadata->description = f.get("DESCRIPTION");
- _metadata->get_ebuild_interface()->keywords = f.get("KEYWORDS");
- _metadata->get_ebuild_interface()->eclass_keywords = f.get("E_KEYWORDS");
- _metadata->get_ebuild_interface()->inherited = f.get("INHERITED");
- _metadata->get_ebuild_interface()->iuse = f.get("IUSE");
- _metadata->deps.post_depend_string = f.get("PDEPEND");
- _metadata->get_ebuild_interface()->provide_string = f.get("PROVIDE");
+ _metadata->keywords = f.get("KEYWORDS");
+ _metadata->eclass_keywords = f.get("E_KEYWORDS");
+ _metadata->inherited = f.get("INHERITED");
+ _metadata->iuse = f.get("IUSE");
+ _metadata->post_depend_string = f.get("PDEPEND");
+ _metadata->provide_string = f.get("PROVIDE");
_metadata->eapi = f.get("EAPI");
if (0 == prog.exit_status())
@@ -407,3 +407,24 @@ EbuildUninstallCommand::EbuildUninstallCommand(const EbuildCommandParams & p,
{
}
+EbuildVersionMetadata::EbuildVersionMetadata() :
+ VersionMetadata(
+ VersionMetadataBase(SlotName("unset"), "", "", "UNKNOWN"),
+ VersionMetadataCapabilities::create()
+ .ebuild_interface(this)
+ .cran_interface(0)
+ .deps_interface(this)
+ .license_interface(this)
+ .virtual_interface(0)
+ .origins_interface(0)
+ ),
+ VersionMetadataEbuildInterface(),
+ VersionMetadataDepsInterface(PortageDepParser::parse_depend),
+ VersionMetadataLicenseInterface(PortageDepParser::parse_license)
+{
+}
+
+EbuildVersionMetadata::~EbuildVersionMetadata()
+{
+}
+
diff --git a/paludis/ebuild.hh b/paludis/ebuild.hh
index b09a16a..aecab42 100644
--- a/paludis/ebuild.hh
+++ b/paludis/ebuild.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -60,6 +60,20 @@ namespace paludis
#include <paludis/ebuild-sr.hh>
+ class EbuildVersionMetadata :
+ public VersionMetadata,
+ public VersionMetadataEbuildInterface,
+ public VersionMetadataDepsInterface,
+ public VersionMetadataLicenseInterface
+ {
+ public:
+ typedef CountedPtr<EbuildVersionMetadata, count_policy::InternalCountTag> Pointer;
+ typedef CountedPtr<const EbuildVersionMetadata, count_policy::InternalCountTag> ConstPointer;
+
+ EbuildVersionMetadata();
+ virtual ~EbuildVersionMetadata();
+ };
+
/**
* An EbuildCommand is the base class from which specific ebuild
* command interfaces are descended.
@@ -148,7 +162,7 @@ namespace paludis
public EbuildCommand
{
private:
- VersionMetadata::Ebuild::Pointer _metadata;
+ EbuildVersionMetadata::Pointer _metadata;
protected:
virtual std::string commands() const;
@@ -169,7 +183,7 @@ namespace paludis
* Return a pointer to our generated metadata. If operator() has not
* yet been called, will be a zero pointer.
*/
- VersionMetadata::Pointer metadata() const
+ EbuildVersionMetadata::Pointer metadata() const
{
return _metadata;
}
diff --git a/paludis/environment.cc b/paludis/environment.cc
index bc7f5e5..589b765 100644
--- a/paludis/environment.cc
+++ b/paludis/environment.cc
@@ -132,23 +132,22 @@ Environment::mask_reasons(const PackageDatabaseEntry & e, const bool override_ti
VersionMetadata::ConstPointer metadata(package_database()->fetch_repository(
e.repository)->version_metadata(e.name, e.version));
- if (metadata->eapi != "0" && metadata->eapi != ""
- && metadata->eapi != "paludis-1" && metadata->eapi != "CRAN-0")
+ if (! accept_eapi(metadata->eapi))
result.set(mr_eapi);
else
{
- if (metadata->get_virtual_interface())
+ if (metadata->virtual_interface)
{
- result |= mask_reasons(metadata->get_virtual_interface()->virtual_for);
+ result |= mask_reasons(metadata->virtual_interface->virtual_for);
if (result.any())
result.set(mr_by_association);
}
- if (metadata->get_ebuild_interface())
+ if (metadata->ebuild_interface)
{
std::set<KeywordName> keywords;
WhitespaceTokeniser::get_instance()->tokenise(
- metadata->get_ebuild_interface()->keywords,
+ metadata->ebuild_interface->keywords,
create_inserter<KeywordName>(std::inserter(keywords, keywords.end())));
if (keywords.empty())
keywords.insert(KeywordName("empty"));
@@ -178,10 +177,13 @@ Environment::mask_reasons(const PackageDatabaseEntry & e, const bool override_ti
}
}
- LicenceChecker lc(this, &e);
- metadata->license()->accept(&lc);
- if (! lc.ok)
- result.set(mr_license);
+ if (metadata->license_interface)
+ {
+ LicenceChecker lc(this, &e);
+ metadata->license_interface->license()->accept(&lc);
+ if (! lc.ok)
+ result.set(mr_license);
+ }
if (! query_user_unmasks(e))
{
@@ -512,3 +514,9 @@ Environment::sets_list() const
return SetsCollection::ConstPointer(new SetsCollection::Concrete);
}
+bool
+Environment::accept_eapi(const std::string & e) const
+{
+ return e == "0" || e == "" || e == "paludis-1" || e == "CRAN-0";
+}
+
diff --git a/paludis/environment.hh b/paludis/environment.hh
index 1a53e37..4564638 100644
--- a/paludis/environment.hh
+++ b/paludis/environment.hh
@@ -153,6 +153,13 @@ namespace paludis
const bool override_tilde_keywords = false) const;
/**
+ * Is the specified EAPI accepted?
+ *
+ * Default behaviour: known EAPIs accepted.
+ */
+ virtual bool accept_eapi(const std::string &) const;
+
+ /**
* Is the specified LICENSE accepted?
*
* Default behaviour: yes.
diff --git a/paludis/files.m4 b/paludis/files.m4
index c3d4d93..9182c5f 100644
--- a/paludis/files.m4
+++ b/paludis/files.m4
@@ -15,7 +15,6 @@ add(`dep_atom', `hh', `cc', `test')
add(`dep_atom_flattener', `hh', `cc')
add(`dep_atom_pretty_printer', `hh', `cc')
add(`dep_tag', `hh', `cc', `sr')
-add(`ebin', `hh', `cc', `sr')
add(`ebuild', `hh', `cc', `sr')
add(`environment', `hh', `cc')
add(`hashed_containers', `hhx', `cc', `test')
diff --git a/paludis/portage_dep_parser.cc b/paludis/portage_dep_parser.cc
index cb480d5..1b48b8b 100644
--- a/paludis/portage_dep_parser.cc
+++ b/paludis/portage_dep_parser.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2005, 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -284,3 +284,9 @@ PortageDepParser::parse_depend(const std::string & s)
{
return PortageDepParser::parse(s);
}
+
+DepAtom::ConstPointer
+PortageDepParser::parse_license(const std::string & s)
+{
+ return PortageDepParser::parse(s, PortageDepParserPolicy<PlainTextDepAtom, true>::get_instance());
+}
diff --git a/paludis/portage_dep_parser.hh b/paludis/portage_dep_parser.hh
index a848b2a..47a6181 100644
--- a/paludis/portage_dep_parser.hh
+++ b/paludis/portage_dep_parser.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2005, 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -191,6 +191,11 @@ namespace paludis
* Convenience wrapper for parse for depend strings, for VersionMetadata.
*/
static DepAtom::ConstPointer parse_depend(const std::string & s);
+
+ /**
+ * Convenience wrapper for parse for license strings, for VersionMetadata.
+ */
+ static DepAtom::ConstPointer parse_license(const std::string & s);
};
}
diff --git a/paludis/qa/dep_any_check.cc b/paludis/qa/dep_any_check.cc
index fc49cf4..5eecd88 100644
--- a/paludis/qa/dep_any_check.cc
+++ b/paludis/qa/dep_any_check.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -109,17 +109,20 @@ DepAnyCheck::operator() (const EbuildCheckData & e) const
VersionMetadata::ConstPointer metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
- Checker depend_checker(result, "DEPEND");
- std::string depend(metadata->deps.build_depend_string);
- PortageDepParser::parse(depend)->accept(&depend_checker);
+ if (metadata->deps_interface)
+ {
+ Checker depend_checker(result, "DEPEND");
+ std::string depend(metadata->deps_interface->build_depend_string);
+ PortageDepParser::parse(depend)->accept(&depend_checker);
- Checker rdepend_checker(result, "RDEPEND");
- std::string rdepend(metadata->deps.run_depend_string);
- PortageDepParser::parse(rdepend)->accept(&rdepend_checker);
+ Checker rdepend_checker(result, "RDEPEND");
+ std::string rdepend(metadata->deps_interface->run_depend_string);
+ PortageDepParser::parse(rdepend)->accept(&rdepend_checker);
- Checker pdepend_checker(result, "PDEPEND");
- std::string pdepend(metadata->deps.post_depend_string);
- PortageDepParser::parse(pdepend)->accept(&pdepend_checker);
+ Checker pdepend_checker(result, "PDEPEND");
+ std::string pdepend(metadata->deps_interface->post_depend_string);
+ PortageDepParser::parse(pdepend)->accept(&pdepend_checker);
+ }
}
catch (const InternalError &)
{
diff --git a/paludis/qa/dep_flags_check.cc b/paludis/qa/dep_flags_check.cc
index 49e1563..db045a4 100644
--- a/paludis/qa/dep_flags_check.cc
+++ b/paludis/qa/dep_flags_check.cc
@@ -133,39 +133,42 @@ DepFlagsCheck::operator() (const EbuildCheckData & e) const
VersionMetadata::ConstPointer metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
- std::set<UseFlagName> iuse;
- WhitespaceTokeniser::get_instance()->tokenise(metadata->get_ebuild_interface()->
- iuse, create_inserter<UseFlagName>(std::inserter(iuse, iuse.begin())));
- iuse.insert(UseFlagName("bootstrap"));
- iuse.insert(UseFlagName("build"));
-
- Checker depend_checker(result, "DEPEND", e.environment, iuse);
- std::string depend(metadata->deps.build_depend_string);
- PortageDepParser::parse(depend)->accept(&depend_checker);
-
- Checker rdepend_checker(result, "RDEPEND", e.environment, iuse);
- std::string rdepend(metadata->deps.run_depend_string);
- PortageDepParser::parse(rdepend)->accept(&rdepend_checker);
-
- Checker pdepend_checker(result, "PDEPEND", e.environment, iuse);
- std::string pdepend(metadata->deps.post_depend_string);
- PortageDepParser::parse(pdepend)->accept(&pdepend_checker);
-
- Checker provide_checker(result, "PROVIDE", e.environment, iuse);
- std::string provide(metadata->get_ebuild_interface()->provide_string);
- PortageDepParser::parse(provide, PortageDepParserPolicy<PackageDepAtom, false>::get_instance())->accept(&provide_checker);
-
- Checker license_checker(result, "LICENSE", e.environment, iuse);
- std::string license(metadata->license_string);
- PortageDepParser::parse(license, PortageDepParserPolicy<PlainTextDepAtom, true>::get_instance())->accept(&license_checker);
-
- Checker src_uri_checker(result, "SRC_URI", e.environment, iuse);
- if (metadata->get_ebuild_interface() == 0)
+ if (metadata->ebuild_interface == 0)
result << Message(qal_fatal, "Not an ebuild");
+ else
+ {
+ std::set<UseFlagName> iuse;
+ WhitespaceTokeniser::get_instance()->tokenise(metadata->ebuild_interface->
+ iuse, create_inserter<UseFlagName>(std::inserter(iuse, iuse.begin())));
+ iuse.insert(UseFlagName("bootstrap"));
+ iuse.insert(UseFlagName("build"));
+
+ Checker depend_checker(result, "DEPEND", e.environment, iuse);
+ std::string depend(metadata->deps_interface->build_depend_string);
+ PortageDepParser::parse(depend)->accept(&depend_checker);
+
+ Checker rdepend_checker(result, "RDEPEND", e.environment, iuse);
+ std::string rdepend(metadata->deps_interface->run_depend_string);
+ PortageDepParser::parse(rdepend)->accept(&rdepend_checker);
+
+ Checker pdepend_checker(result, "PDEPEND", e.environment, iuse);
+ std::string pdepend(metadata->deps_interface->post_depend_string);
+ PortageDepParser::parse(pdepend)->accept(&pdepend_checker);
- std::string src_uri(metadata->get_ebuild_interface()->src_uri);
+ Checker provide_checker(result, "PROVIDE", e.environment, iuse);
+ std::string provide(metadata->ebuild_interface->provide_string);
+ PortageDepParser::parse(provide, PortageDepParserPolicy<PackageDepAtom, false>::get_instance())->accept(&provide_checker);
- PortageDepParser::parse(src_uri, PortageDepParserPolicy<PlainTextDepAtom, true>::get_instance())->accept(&src_uri_checker);
+ Checker license_checker(result, "LICENSE", e.environment, iuse);
+ std::string license(metadata->license_interface->license_string);
+ PortageDepParser::parse(license, PortageDepParserPolicy<PlainTextDepAtom, true>::get_instance())->accept(&license_checker);
+
+ Checker src_uri_checker(result, "SRC_URI", e.environment, iuse);
+
+ std::string src_uri(metadata->ebuild_interface->src_uri);
+
+ PortageDepParser::parse(src_uri, PortageDepParserPolicy<PlainTextDepAtom, true>::get_instance())->accept(&src_uri_checker);
+ }
}
catch (const InternalError &)
{
diff --git a/paludis/qa/dep_packages_check.cc b/paludis/qa/dep_packages_check.cc
index dea7ca1..51be2fb 100644
--- a/paludis/qa/dep_packages_check.cc
+++ b/paludis/qa/dep_packages_check.cc
@@ -108,7 +108,7 @@ DepPackagesCheck::operator() (const EbuildCheckData & e) const
}
Checker depend_checker(result, "DEPEND", suspicious_depend);
- std::string depend(metadata->deps.build_depend_string);
+ std::string depend(metadata->deps_interface->build_depend_string);
PortageDepParser::parse(depend)->accept(&depend_checker);
static std::set<QualifiedPackageName> suspicious_rdepend;
@@ -132,7 +132,7 @@ DepPackagesCheck::operator() (const EbuildCheckData & e) const
}
Checker rdepend_checker(result, "RDEPEND", suspicious_rdepend);
- std::string rdepend(metadata->deps.run_depend_string);
+ std::string rdepend(metadata->deps_interface->run_depend_string);
PortageDepParser::parse(rdepend)->accept(&rdepend_checker);
}
catch (const InternalError &)
diff --git a/paludis/qa/deps_exist_check.cc b/paludis/qa/deps_exist_check.cc
index 446954a..47f75ad 100644
--- a/paludis/qa/deps_exist_check.cc
+++ b/paludis/qa/deps_exist_check.cc
@@ -101,15 +101,15 @@ DepsExistCheck::operator() (const EbuildCheckData & e) const
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
Checker depend_checker(result, "DEPEND", e.environment);
- std::string depend(metadata->deps.build_depend_string);
+ std::string depend(metadata->deps_interface->build_depend_string);
PortageDepParser::parse(depend)->accept(&depend_checker);
Checker rdepend_checker(result, "RDEPEND", e.environment);
- std::string rdepend(metadata->deps.run_depend_string);
+ std::string rdepend(metadata->deps_interface->run_depend_string);
PortageDepParser::parse(rdepend)->accept(&rdepend_checker);
Checker pdepend_checker(result, "PDEPEND", e.environment);
- std::string pdepend(metadata->deps.post_depend_string);
+ std::string pdepend(metadata->deps_interface->post_depend_string);
PortageDepParser::parse(pdepend)->accept(&pdepend_checker);
}
catch (const InternalError &)
diff --git a/paludis/qa/deps_visible_check.cc b/paludis/qa/deps_visible_check.cc
index 0045147..8f35e78 100644
--- a/paludis/qa/deps_visible_check.cc
+++ b/paludis/qa/deps_visible_check.cc
@@ -205,15 +205,15 @@ DepsVisibleCheck::operator() (const PerProfileEbuildCheckData & e) const
else
{
Checker depend_checker(result, "DEPEND", e.environment, ee, unstable);
- std::string depend(metadata->deps.build_depend_string);
+ std::string depend(metadata->deps_interface->build_depend_string);
PortageDepParser::parse(depend)->accept(&depend_checker);
Checker rdepend_checker(result, "RDEPEND", e.environment, ee, unstable);
- std::string rdepend(metadata->deps.run_depend_string);
+ std::string rdepend(metadata->deps_interface->run_depend_string);
PortageDepParser::parse(rdepend)->accept(&rdepend_checker);
Checker pdepend_checker(result, "PDEPEND", e.environment, ee, unstable);
- std::string pdepend(metadata->deps.post_depend_string);
+ std::string pdepend(metadata->deps_interface->post_depend_string);
PortageDepParser::parse(pdepend)->accept(&pdepend_checker);
}
diff --git a/paludis/qa/extract_check.cc b/paludis/qa/extract_check.cc
index 363caae..7fb1596 100644
--- a/paludis/qa/extract_check.cc
+++ b/paludis/qa/extract_check.cc
@@ -87,9 +87,9 @@ ExtractCheck::operator() (const EbuildCheckData & e) const
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
Checker checker;
- PortageDepParser::parse(metadata->get_ebuild_interface()->src_uri,
+ PortageDepParser::parse(metadata->ebuild_interface->src_uri,
PortageDepParserPolicy<PlainTextDepAtom, false>::get_instance())->accept(&checker);
- PortageDepParser::parse(metadata->deps.build_depend_string)->accept(&checker);
+ PortageDepParser::parse(metadata->deps_interface->build_depend_string)->accept(&checker);
if (checker.need_zip && ! checker.have_zip)
result << Message(qal_major, "Found .zip in SRC_URI but app-arch/unzip is not in DEPEND");
diff --git a/paludis/qa/inherits_check.cc b/paludis/qa/inherits_check.cc
index 727dae0..6e330a2 100644
--- a/paludis/qa/inherits_check.cc
+++ b/paludis/qa/inherits_check.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -51,7 +51,7 @@ InheritsCheck::operator() (const EbuildCheckData & e) const
std::set<std::string> inherits;
Tokeniser<delim_kind::AnyOfTag, delim_mode::DelimiterTag> tokeniser(" \t\n");
- tokeniser.tokenise(metadata->get_ebuild_interface()->inherited, std::inserter(inherits, inherits.begin()));
+ tokeniser.tokenise(metadata->ebuild_interface->inherited, std::inserter(inherits, inherits.begin()));
static std::set<std::string> inherits_blacklist;
if (inherits_blacklist.empty())
diff --git a/paludis/qa/iuse_check.cc b/paludis/qa/iuse_check.cc
index 7df0724..5b9584c 100644
--- a/paludis/qa/iuse_check.cc
+++ b/paludis/qa/iuse_check.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -55,7 +55,7 @@ IuseCheck::operator() (const EbuildCheckData & e) const
try
{
std::set<UseFlagName> iuse;
- WhitespaceTokeniser::get_instance()->tokenise(metadata->get_ebuild_interface()->
+ WhitespaceTokeniser::get_instance()->tokenise(metadata->ebuild_interface->
iuse, create_inserter<UseFlagName>(std::inserter(iuse, iuse.begin())));
diff --git a/paludis/qa/keywords_check.cc b/paludis/qa/keywords_check.cc
index aa87f7f..98333d2 100644
--- a/paludis/qa/keywords_check.cc
+++ b/paludis/qa/keywords_check.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -47,7 +47,7 @@ KeywordsCheck::operator() (const EbuildCheckData & e) const
{
//std::set<KeywordName> keywords(metadata->begin_keywords(), metadata->end_keywords());
std::set<KeywordName> keywords;
- WhitespaceTokeniser::get_instance()->tokenise(metadata->get_ebuild_interface()->
+ WhitespaceTokeniser::get_instance()->tokenise(metadata->ebuild_interface->
keywords, create_inserter<KeywordName>(std::inserter(keywords, keywords.begin())));
if (keywords.end() != keywords.find(KeywordName("-*")) &&
@@ -63,7 +63,7 @@ KeywordsCheck::operator() (const EbuildCheckData & e) const
result << Message(qal_major, "Bad entries in KEYWORDS");
}
- if (! metadata->get_ebuild_interface()->eclass_keywords.empty())
+ if (! metadata->ebuild_interface->eclass_keywords.empty())
result << Message(qal_major, "KEYWORDS was altered by an eclass");
}
catch (const InternalError &)
diff --git a/paludis/qa/license_check.cc b/paludis/qa/license_check.cc
index e45fe4c..f63b488 100644
--- a/paludis/qa/license_check.cc
+++ b/paludis/qa/license_check.cc
@@ -92,7 +92,7 @@ LicenseCheck::operator() (const EbuildCheckData & e) const
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
- std::string license(metadata->license_string);
+ std::string license(metadata->license_interface->license_string);
DepAtom::ConstPointer license_parts(0);
try
diff --git a/paludis/qa/parse_deps_check.cc b/paludis/qa/parse_deps_check.cc
index 7713535..b73d85e 100644
--- a/paludis/qa/parse_deps_check.cc
+++ b/paludis/qa/parse_deps_check.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -44,7 +44,7 @@ ParseDepsCheck::operator() (const EbuildCheckData & e) const
try
{
- std::string depend(metadata->deps.build_depend_string);
+ std::string depend(metadata->deps_interface->build_depend_string);
PortageDepParser::parse(depend);
}
catch (const Exception & err)
@@ -55,7 +55,7 @@ ParseDepsCheck::operator() (const EbuildCheckData & e) const
try
{
- std::string rdepend(metadata->deps.run_depend_string);
+ std::string rdepend(metadata->deps_interface->run_depend_string);
PortageDepParser::parse(rdepend);
}
catch (const Exception & err)
@@ -66,7 +66,7 @@ ParseDepsCheck::operator() (const EbuildCheckData & e) const
try
{
- std::string pdepend(metadata->deps.post_depend_string);
+ std::string pdepend(metadata->deps_interface->post_depend_string);
PortageDepParser::parse(pdepend);
}
catch (const Exception & err)
diff --git a/paludis/qa/pdepend_overlap_check.cc b/paludis/qa/pdepend_overlap_check.cc
index 9f7ad9f..0bab7ef 100644
--- a/paludis/qa/pdepend_overlap_check.cc
+++ b/paludis/qa/pdepend_overlap_check.cc
@@ -79,12 +79,12 @@ PdependOverlapCheck::operator() (const EbuildCheckData & e) const
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
Collector pdepend_collector;
- std::string pdepend(metadata->deps.post_depend_string);
+ std::string pdepend(metadata->deps_interface->post_depend_string);
PortageDepParser::parse(pdepend)->accept(&pdepend_collector);
{
Collector depend_collector;
- std::string depend(metadata->deps.build_depend_string);
+ std::string depend(metadata->deps_interface->build_depend_string);
PortageDepParser::parse(depend)->accept(&depend_collector);
std::set<QualifiedPackageName> overlap;
@@ -99,7 +99,7 @@ PdependOverlapCheck::operator() (const EbuildCheckData & e) const
{
Collector rdepend_collector;
- std::string rdepend(metadata->deps.run_depend_string);
+ std::string rdepend(metadata->deps_interface->run_depend_string);
PortageDepParser::parse(rdepend)->accept(&rdepend_collector);
std::set<QualifiedPackageName> overlap;
diff --git a/paludis/qa/restrict_check.cc b/paludis/qa/restrict_check.cc
index 659dd66..fc02cc3 100644
--- a/paludis/qa/restrict_check.cc
+++ b/paludis/qa/restrict_check.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -47,7 +47,7 @@ RestrictCheck::operator() (const EbuildCheckData & e) const
std::set<std::string> restricts;
Tokeniser<delim_kind::AnyOfTag, delim_mode::DelimiterTag> tokeniser(" \t\n");
- tokeniser.tokenise(metadata->get_ebuild_interface()->restrict_string,
+ tokeniser.tokenise(metadata->ebuild_interface->restrict_string,
std::inserter(restricts, restricts.begin()));
static std::set<std::string> allowed_restricts;
diff --git a/paludis/qa/src_uri_check.cc b/paludis/qa/src_uri_check.cc
index d7ebb40..fffb076 100644
--- a/paludis/qa/src_uri_check.cc
+++ b/paludis/qa/src_uri_check.cc
@@ -141,7 +141,7 @@ SrcUriCheck::operator() (const EbuildCheckData & e) const
VersionMetadata::ConstPointer metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
- std::string src_uri(metadata->get_ebuild_interface()->src_uri);
+ std::string src_uri(metadata->ebuild_interface->src_uri);
DepAtom::ConstPointer src_uri_parts(0);
try
@@ -151,7 +151,7 @@ SrcUriCheck::operator() (const EbuildCheckData & e) const
std::set<std::string> restricts;
Tokeniser<delim_kind::AnyOfTag, delim_mode::DelimiterTag> tokeniser(" \t\n");
- tokeniser.tokenise(metadata->get_ebuild_interface()->restrict_string,
+ tokeniser.tokenise(metadata->ebuild_interface->restrict_string,
std::inserter(restricts, restricts.begin()));
bool fetch_restrict(restricts.end() != restricts.find("fetch"));
diff --git a/paludis/repositories/cran/Makefile.am b/paludis/repositories/cran/Makefile.am
index 11dc81c..309513a 100644
--- a/paludis/repositories/cran/Makefile.am
+++ b/paludis/repositories/cran/Makefile.am
@@ -25,6 +25,7 @@ paludis_repositories_cran_includedir = $(includedir)/paludis/repositories/cran/
libpaludiscranrepository_la_LDFLAGS = -version-info @VERSION_LIB_CURRENT@:@VERSION_LIB_REVISION@:0
paludis_repositories_cran_include_HEADERS = \
+ cran_version_metadata.hh \
cran_description.hh \
cran_dep_parser.hh \
cran_repository.hh \
@@ -33,6 +34,7 @@ paludis_repositories_cran_include_HEADERS = \
cran_installed_repository-sr.hh
libpaludiscranrepository_la_SOURCES = \
+ cran_version_metadata.cc \
cran_description.cc \
cran_dep_parser.cc \
cran_repository.cc \
diff --git a/paludis/repositories/cran/cran_description.cc b/paludis/repositories/cran/cran_description.cc
index f0d2847..a6f1dea 100644
--- a/paludis/repositories/cran/cran_description.cc
+++ b/paludis/repositories/cran/cran_description.cc
@@ -1,7 +1,8 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006,2007 Danny van Dyk <kugelfang@gentoo.org>
+ * Copyright (c) 2006, 2007 Danny van Dyk <kugelfang@gentoo.org>
+ * Copyright (c) 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -19,6 +20,7 @@
#include <paludis/repositories/cran/cran_description.hh>
#include <paludis/repositories/cran/cran_dep_parser.hh>
+#include <paludis/repositories/cran/cran_version_metadata.hh>
#include <paludis/config_file.hh>
#include <paludis/util/log.hh>
#include <paludis/util/strip.hh>
@@ -26,18 +28,17 @@
using namespace paludis;
-CRANDescription::CRANDescription(const std::string & n, const FSEntry & f) :
+CRANDescription::CRANDescription(const std::string & n, const FSEntry & f, bool installed) :
name("cran/" + n),
version("0"),
- metadata(new VersionMetadata::CRAN(CRANDepParser::parse))
+ metadata(new CRANVersionMetadata(installed))
{
Context context("When parsing file '" + stringify(f) + "' for package '" + n + "':");
if (! f.is_regular_file())
{
+ metadata->eapi = "UNKNOWN";
Log::get_instance()->message(ll_warning, lc_context, "Unexpected irregular file: '" + stringify(f) + "'.");
- metadata->eapi = "INVALID";
-
return;
}
@@ -46,8 +47,8 @@ CRANDescription::CRANDescription(const std::string & n, const FSEntry & f) :
// Fill in default values
metadata->slot = SlotName("0");
- metadata->eapi = "CRAN-0";
- metadata->get_cran_interface()->keywords = std::string("*");
+ metadata->cran_interface->keywords = std::string("*");
+ metadata->eapi = "CRAN-1";
std::string key;
for ( ; l != l_end ; ++l)
@@ -68,7 +69,7 @@ CRANDescription::CRANDescription(const std::string & n, const FSEntry & f) :
if (("Package" == key) || ("Bundle" == key))
{
- metadata->get_cran_interface()->package = value;
+ metadata->cran_interface->package = value;
metadata->homepage = "http://cran.r-project.org/src/contrib/Descriptions/" + value + ".html";
if ("Package" == key)
{
@@ -79,12 +80,12 @@ CRANDescription::CRANDescription(const std::string & n, const FSEntry & f) :
}
else
{
- metadata->get_cran_interface()->is_bundle = true;
+ metadata->cran_interface->is_bundle = true;
}
}
else if ("Version" == key)
{
- metadata->get_cran_interface()->version = value;
+ metadata->cran_interface->version = value;
normalise_version(value);
version = VersionSpec(value);
}
@@ -98,11 +99,11 @@ CRANDescription::CRANDescription(const std::string & n, const FSEntry & f) :
value = "R";
else
value.append(", R");
- metadata->deps.build_depend_string = value;
- metadata->deps.run_depend_string = value;
+ metadata->deps_interface->build_depend_string = value;
+ metadata->deps_interface->run_depend_string = value;
}
else if ("Suggests" == key)
- metadata->deps.suggested_depend_string = value;
+ metadata->deps_interface->suggested_depend_string = value;
}
}
diff --git a/paludis/repositories/cran/cran_description.hh b/paludis/repositories/cran/cran_description.hh
index 5da542f..81a4abc 100644
--- a/paludis/repositories/cran/cran_description.hh
+++ b/paludis/repositories/cran/cran_description.hh
@@ -2,6 +2,7 @@
/*
* Copyright (c) 2006 Danny van Dyk <kugelfang@gentoo.org>
+ * Copyright (c) 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -62,7 +63,7 @@ namespace paludis
}
/// Constructor
- CRANDescription(const std::string & n, const FSEntry & f);
+ CRANDescription(const std::string & n, const FSEntry & f, bool installed);
/// Comparison operator
bool operator< (const CRANDescription & other) const
diff --git a/paludis/repositories/cran/cran_installed_repository.cc b/paludis/repositories/cran/cran_installed_repository.cc
index d1530de..98724eb 100644
--- a/paludis/repositories/cran/cran_installed_repository.cc
+++ b/paludis/repositories/cran/cran_installed_repository.cc
@@ -24,6 +24,7 @@
#include <paludis/repositories/cran/cran_description.hh>
#include <paludis/repositories/cran/cran_dep_parser.hh>
#include <paludis/repositories/cran/cran_installed_repository.hh>
+#include <paludis/repositories/cran/cran_version_metadata.hh>
#include <paludis/util/collection_concrete.hh>
#include <paludis/util/iterator.hh>
#include <paludis/util/dir_iterator.hh>
@@ -126,7 +127,7 @@ Implementation<CRANInstalledRepository>::load_entries() const
std::string n(d->basename());
CRANDescription::normalise_name(n);
- CRANDescription desc(n, f);
+ CRANDescription desc(n, f, true);
entries.push_back(desc);
QualifiedPackageName q("cran/" + n);
@@ -152,7 +153,7 @@ Implementation<CRANInstalledRepository>::load_entries() const
n.erase(pos);
CRANDescription::normalise_name(n);
- CRANDescription desc(n, *f);
+ CRANDescription desc(n, *f, true);
entries.push_back(desc);
QualifiedPackageName q("cran/" + n);
@@ -335,11 +336,11 @@ CRANInstalledRepository::do_version_metadata(
if (d.is_regular_file())
{
- CRANDescription description(stringify(q.package), d);
+ CRANDescription description(stringify(q.package), d, true);
// Don't put this into CRANDescription, as it's only relevant to CRANInstalledRepository
std::string repo(file_contents(_imp->location, q, "REPOSITORY"));
if (! repo.empty())
- description.metadata->origins.source.assign(new PackageDatabaseEntry(stringify(q.package), v,
+ description.metadata->origins_interface->source.assign(new PackageDatabaseEntry(stringify(q.package), v,
RepositoryName(repo)));
result = description.metadata;
}
@@ -348,7 +349,7 @@ CRANInstalledRepository::do_version_metadata(
Log::get_instance()->message(ll_warning, lc_no_context, "has_version failed for request for '" +
stringify(q) + "-" + stringify(v) + "' in repository '" +
stringify(name()) + "': No DESCRIPTION file present.");
- result.assign(new VersionMetadata(CRANDepParser::parse));
+ result.assign(new CRANVersionMetadata(true));
result->eapi = "UNKNOWN";
return result;
}
@@ -528,7 +529,7 @@ CRANInstalledRepository::do_uninstall(const QualifiedPackageName & q, const Vers
VersionMetadata::ConstPointer vm(do_version_metadata(q, v));
MakeEnvCommand cmd(LIBEXECDIR "/paludis/cran.bash unmerge", "");
- cmd = cmd("PN", vm->get_cran_interface()->package);
+ cmd = cmd("PN", vm->cran_interface->package);
cmd = cmd("PV", stringify(v));
cmd = cmd("PALUDIS_CRAN_LIBRARY", stringify(_imp->location));
cmd = cmd("PALUDIS_EBUILD_DIR", std::string(LIBEXECDIR "/paludis/"));
diff --git a/paludis/repositories/cran/cran_repository.cc b/paludis/repositories/cran/cran_repository.cc
index f24b731..87df9a7 100644
--- a/paludis/repositories/cran/cran_repository.cc
+++ b/paludis/repositories/cran/cran_repository.cc
@@ -29,6 +29,7 @@
#include <paludis/repositories/cran/cran_dep_parser.hh>
#include <paludis/repositories/cran/cran_description.hh>
#include <paludis/repositories/cran/cran_repository.hh>
+#include <paludis/repositories/cran/cran_version_metadata.hh>
#include <paludis/repositories/repository_maker.hh>
#include <paludis/syncer.hh>
#include <paludis/util/collection_concrete.hh>
@@ -354,16 +355,16 @@ CRANRepository::need_packages() const
if (*i == last_package_name)
continue;
- CRANDescription d(*i, FSEntry(_imp->location / std::string(last_package_name + ".DESCRIPTION")));
+ CRANDescription d(*i, FSEntry(_imp->location / std::string(last_package_name + ".DESCRIPTION")), false);
- std::string dep(d.metadata->deps.build_depend_string);
- std::string pkg(d.metadata->get_cran_interface()->package);
+ std::string dep(d.metadata->deps_interface->build_depend_string);
+ std::string pkg(d.metadata->cran_interface->package);
if ("" == dep)
dep = pkg;
else
dep += "," + pkg;
- d.metadata->deps.build_depend_string = dep;
- d.metadata->get_cran_interface()->is_bundle_member = true;
+ d.metadata->deps_interface->build_depend_string = dep;
+ d.metadata->cran_interface->is_bundle_member = true;
_imp->package_names[d.name] = true;
_imp->metadata.insert(std::make_pair(std::make_pair(d.name, d.version), d.metadata));
@@ -397,7 +398,7 @@ CRANRepository::do_version_metadata(
if (! has_version(q, v))
throw NoSuchPackageError(stringify(PackageDatabaseEntry(q, v, name())));
- VersionMetadata::Pointer result(new VersionMetadata(CRANDepParser::parse));
+ VersionMetadata::Pointer result(new CRANVersionMetadata(false));
FSEntry d(_imp->location);
PackageNamePart p(q.package);
@@ -407,7 +408,7 @@ CRANRepository::do_version_metadata(
if (d.is_regular_file())
{
- CRANDescription desc(stringify(p), d);
+ CRANDescription desc(stringify(p), d, false);
result = desc.metadata;
}
else
@@ -415,7 +416,7 @@ CRANRepository::do_version_metadata(
Log::get_instance()->message(ll_warning, lc_no_context, "has_version failed for request for '" +
stringify(q) + "-" + stringify(v) + "' in repository '" +
stringify(name()) + "': File '" + n + ".DESCRIPTION' not present.");
- result.assign(new VersionMetadata(CRANDepParser::parse));
+ result.assign(new CRANVersionMetadata(false));
result->eapi = "UNKNOWN";
}
@@ -490,7 +491,7 @@ CRANRepository::do_install(const QualifiedPackageName &q, const VersionSpec &vn,
CategoryNamePart c("cran");
VersionMetadata::ConstPointer vm(do_version_metadata(q, vn));
- if (vm->get_cran_interface()->is_bundle_member)
+ if (vm->cran_interface->is_bundle_member)
{
MakeEnvCommand cmd(LIBEXECDIR "/paludis/cran.bash skip", "");
cmd = cmd("CATEGORY", "cran");
@@ -499,8 +500,8 @@ CRANRepository::do_install(const QualifiedPackageName &q, const VersionSpec &vn,
return;
}
- std::string p(vm->get_cran_interface()->package);
- std::string v(vm->get_cran_interface()->version);
+ std::string p(vm->cran_interface->package);
+ std::string v(vm->cran_interface->version);
MakeEnvCommand cmd(LIBEXECDIR "/paludis/cran.bash fetch", "");
cmd = cmd("CATEGORY", "cran");
@@ -528,7 +529,7 @@ CRANRepository::do_install(const QualifiedPackageName &q, const VersionSpec &vn,
cmd = cmd("DISTDIR", stringify(_imp->distdir));
cmd = cmd("DISTFILE", std::string(p + "_" + v + ".tar.gz"));
cmd = cmd("IMAGE", image);
- cmd = cmd("IS_BUNDLE", (vm->get_cran_interface()->is_bundle ? "yes" : ""));
+ cmd = cmd("IS_BUNDLE", (vm->cran_interface->is_bundle ? "yes" : ""));
cmd = cmd("LOCATION", stringify(_imp->location));
cmd = cmd("PN", stringify(pn));
cmd = cmd("PV", stringify(vn));
diff --git a/paludis/repositories/cran/cran_version_metadata.cc b/paludis/repositories/cran/cran_version_metadata.cc
new file mode 100644
index 0000000..c110697
--- /dev/null
+++ b/paludis/repositories/cran/cran_version_metadata.cc
@@ -0,0 +1,47 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "cran_version_metadata.hh"
+#include "cran_dep_parser.hh"
+
+using namespace paludis;
+
+CRANVersionMetadata::CRANVersionMetadata(bool want_origins) :
+ VersionMetadata(
+ VersionMetadataBase(SlotName("unset"), "", "", "UNKNOWN"),
+ VersionMetadataCapabilities::create()
+ .cran_interface(this)
+ .ebuild_interface(0)
+ .license_interface(0)
+ .virtual_interface(0)
+ .origins_interface(want_origins ? _origins : 0)
+ .deps_interface(this)
+ ),
+ VersionMetadataCRANInterface("", "", "", false, false),
+ VersionMetadataDepsInterface(CRANDepParser::parse),
+ _origins(want_origins ? new VersionMetadataOriginsInterface : 0)
+{
+}
+
+CRANVersionMetadata::~CRANVersionMetadata()
+{
+ if (_origins)
+ delete _origins;
+}
+
diff --git a/paludis/repositories/cran/cran_version_metadata.hh b/paludis/repositories/cran/cran_version_metadata.hh
new file mode 100644
index 0000000..f7bc9ba
--- /dev/null
+++ b/paludis/repositories/cran/cran_version_metadata.hh
@@ -0,0 +1,41 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PALUDIS_GUARD_PALUDIS_REPOSITORIES_CRAN_CRAN_VERSION_METADATA_HH
+#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_CRAN_CRAN_VERSION_METADATA_HH 1
+
+#include <paludis/version_metadata.hh>
+
+namespace paludis
+{
+ class CRANVersionMetadata :
+ public VersionMetadata,
+ public VersionMetadataCRANInterface,
+ public VersionMetadataDepsInterface
+ {
+ private:
+ VersionMetadataOriginsInterface * _origins;
+
+ public:
+ CRANVersionMetadata(bool want_origins);
+ virtual ~CRANVersionMetadata();
+ };
+}
+
+#endif
diff --git a/paludis/repositories/fake/fake_installed_repository.cc b/paludis/repositories/fake/fake_installed_repository.cc
index 5e50ab4..500ff2e 100644
--- a/paludis/repositories/fake/fake_installed_repository.cc
+++ b/paludis/repositories/fake/fake_installed_repository.cc
@@ -69,10 +69,10 @@ FakeInstalledRepository::provided_packages() const
v != v_end ; ++v)
{
VersionMetadata::ConstPointer m(version_metadata(*p, *v));
- if (! m->get_ebuild_interface())
+ if (! m->ebuild_interface)
continue;
- DepAtom::ConstPointer provide(PortageDepParser::parse(m->get_ebuild_interface()->provide_string,
+ DepAtom::ConstPointer provide(PortageDepParser::parse(m->ebuild_interface->provide_string,
PortageDepParserPolicy<PackageDepAtom, false>::get_instance()));
PackageDatabaseEntry dbe(*p, *v, name());
DepAtomFlattener f(environment(), &dbe, provide);
@@ -93,15 +93,15 @@ VersionMetadata::ConstPointer
FakeInstalledRepository::provided_package_version_metadata(const RepositoryProvidesEntry & p) const
{
VersionMetadata::ConstPointer m(version_metadata(p.provided_by_name, p.version));
- VersionMetadata::Virtual::Pointer result(new VersionMetadata::Virtual(
- PortageDepParser::parse_depend, PackageDatabaseEntry(p.provided_by_name,
- p.version, name())));
+ FakeVirtualVersionMetadata::Pointer result(new FakeVirtualVersionMetadata(
+ m->slot, PackageDatabaseEntry(p.provided_by_name, p.version, name())));
+
+ if (m->license_interface)
+ result->license_interface->license_string = m->license_interface->license_string;
- result->slot = m->slot;
- result->license_string = m->license_string;
result->eapi = m->eapi;
- result->deps = VersionMetadataDeps(&PortageDepParser::parse_depend,
- stringify(p.provided_by_name), stringify(p.provided_by_name), "", "");
+ result->deps_interface->build_depend_string = stringify(p.provided_by_name);
+ result->deps_interface->run_depend_string = stringify(p.provided_by_name);
return result;
}
diff --git a/paludis/repositories/fake/fake_repository.cc b/paludis/repositories/fake/fake_repository.cc
index 4f7af88..3f39183 100644
--- a/paludis/repositories/fake/fake_repository.cc
+++ b/paludis/repositories/fake/fake_repository.cc
@@ -62,16 +62,15 @@ FakeRepository::virtual_package_version_metadata(
const RepositoryVirtualsEntry & p, const VersionSpec & v) const
{
VersionMetadata::ConstPointer m(version_metadata(p.provided_by_atom->package(), v));
- VersionMetadata::Virtual::Pointer result(new VersionMetadata::Virtual(
- PortageDepParser::parse_depend, PackageDatabaseEntry(
- p.provided_by_atom->package(), v, name())));
+ FakeVirtualVersionMetadata::Pointer result(new FakeVirtualVersionMetadata(
+ m->slot, PackageDatabaseEntry(p.provided_by_atom->package(), v, name())));
+
+ if (m->license_interface)
+ result->license_interface->license_string = m->license_interface->license_string;
- result->slot = m->slot;
- result->license_string = m->license_string;
result->eapi = m->eapi;
- result->deps = VersionMetadataDeps(&PortageDepParser::parse_depend,
- "=" + stringify(p.provided_by_atom->package()) + "-" + stringify(v),
- "=" + stringify(p.provided_by_atom->package()) + "-" + stringify(v), "", "");
+ result->deps_interface->build_depend_string = "=" + stringify(p.provided_by_atom->package()) + "-" + stringify(v);
+ result->deps_interface->run_depend_string = "=" + stringify(p.provided_by_atom->package()) + "-" + stringify(v);
return result;
}
diff --git a/paludis/repositories/fake/fake_repository_base.cc b/paludis/repositories/fake/fake_repository_base.cc
index f00c552..f15cd2c 100644
--- a/paludis/repositories/fake/fake_repository_base.cc
+++ b/paludis/repositories/fake/fake_repository_base.cc
@@ -171,11 +171,10 @@ FakeRepositoryBase::add_version(const QualifiedPackageName & q, const VersionSpe
_imp->versions.find(q)->second->insert(v);
_imp->metadata.insert(
std::make_pair(stringify(q) + "-" + stringify(v),
- VersionMetadata::Pointer(new VersionMetadata::Ebuild(PortageDepParser::parse_depend))));
+ VersionMetadata::Pointer(new FakeVersionMetadata)));
VersionMetadata::Pointer r(_imp->metadata.find(stringify(q) + "-" + stringify(v))->second);
r->slot = SlotName("0");
r->eapi = "0";
- r->get_ebuild_interface()->keywords = "test";
return r;
}
@@ -304,3 +303,48 @@ FakeRepositoryBase::environment() const
return _imp->env;
}
+FakeVersionMetadata::FakeVersionMetadata() :
+ VersionMetadata(
+ VersionMetadataBase(SlotName("0"), "", "", "paludis-1"),
+ VersionMetadataCapabilities::create()
+ .ebuild_interface(this)
+ .deps_interface(this)
+ .license_interface(this)
+ .cran_interface(0)
+ .virtual_interface(0)
+ .origins_interface(0)
+ ),
+ VersionMetadataEbuildInterface(),
+ VersionMetadataDepsInterface(&PortageDepParser::parse_depend),
+ VersionMetadataLicenseInterface(&PortageDepParser::parse_license)
+{
+ keywords = "test";
+}
+
+FakeVersionMetadata::~FakeVersionMetadata()
+{
+}
+
+FakeVirtualVersionMetadata::FakeVirtualVersionMetadata(const SlotName & s, const PackageDatabaseEntry & p) :
+ VersionMetadata(
+ VersionMetadataBase(s, "", "", "paludis-1"),
+ VersionMetadataCapabilities::create()
+ .ebuild_interface(this)
+ .deps_interface(this)
+ .license_interface(this)
+ .cran_interface(0)
+ .virtual_interface(this)
+ .origins_interface(0)
+ ),
+ VersionMetadataEbuildInterface(),
+ VersionMetadataDepsInterface(&PortageDepParser::parse_depend),
+ VersionMetadataLicenseInterface(&PortageDepParser::parse_license),
+ VersionMetadataVirtualInterface(p)
+{
+ keywords = "test";
+}
+
+FakeVirtualVersionMetadata::~FakeVirtualVersionMetadata()
+{
+}
+
diff --git a/paludis/repositories/fake/fake_repository_base.hh b/paludis/repositories/fake/fake_repository_base.hh
index 3675dd6..ccb92c2 100644
--- a/paludis/repositories/fake/fake_repository_base.hh
+++ b/paludis/repositories/fake/fake_repository_base.hh
@@ -32,6 +32,44 @@
namespace paludis
{
/**
+ * FakeVersionMetadata is used by FakeRepository and
+ * FakeInstalledRepository for version metadata.
+ *
+ * \see FakeInstalledRepository
+ * \see FakeRepository
+ * \ingroup grpfakerepository
+ */
+ class FakeVersionMetadata :
+ public VersionMetadata,
+ public VersionMetadataEbuildInterface,
+ public VersionMetadataDepsInterface,
+ public VersionMetadataLicenseInterface
+ {
+ public:
+ FakeVersionMetadata();
+ virtual ~FakeVersionMetadata();
+ };
+
+ /**
+ * FakeVirtualVersionMetadata is used by FakeRepository for virtual
+ * version metadata.
+ *
+ * \see FakeRepository
+ * \ingroup grpfakerepository
+ */
+ class FakeVirtualVersionMetadata :
+ public VersionMetadata,
+ public VersionMetadataEbuildInterface,
+ public VersionMetadataDepsInterface,
+ public VersionMetadataLicenseInterface,
+ public VersionMetadataVirtualInterface
+ {
+ public:
+ FakeVirtualVersionMetadata(const SlotName &, const PackageDatabaseEntry &);
+ virtual ~FakeVirtualVersionMetadata();
+ };
+
+ /**
* A FakeRepositoryBase is a Repository subclass whose subclasses are used for
* various test cases.
*
diff --git a/paludis/repositories/gems/Makefile.am b/paludis/repositories/gems/Makefile.am
index 625cbc6..77461fb 100644
--- a/paludis/repositories/gems/Makefile.am
+++ b/paludis/repositories/gems/Makefile.am
@@ -35,7 +35,8 @@ paludis_repositories_gems_include_HEADERS = \
cache.hh \
cache-sr.hh \
make_gems_repository.hh \
- yaml.hh
+ yaml.hh \
+ gems_version_metadata.hh
libpaludisgemsrepository_la_SOURCES = \
gems_repository.cc \
@@ -43,6 +44,7 @@ libpaludisgemsrepository_la_SOURCES = \
cache.cc \
make_gems_repository.cc \
yaml.cc \
+ gems_version_metadata.cc \
registration.cc \
$(paludis_repositories_gems_include_HEADERS)
diff --git a/paludis/repositories/gems/gems_repository.cc b/paludis/repositories/gems/gems_repository.cc
index 0060ea5..91dbe24 100644
--- a/paludis/repositories/gems/gems_repository.cc
+++ b/paludis/repositories/gems/gems_repository.cc
@@ -22,6 +22,7 @@
using namespace paludis;
#include <paludis/repositories/gems/gems_repository-sr.cc>
+#include <paludis/repositories/gems/gems_version_metadata.hh>
#include <paludis/repositories/gems/cache.hh>
#include <paludis/util/collection_concrete.hh>
#include <paludis/util/tokeniser.hh>
@@ -69,8 +70,7 @@ namespace paludis
for (GemsCache::Iterator g(cache.begin()), g_end(cache.end()) ;
g != g_end ; ++g)
{
- VersionMetadata::Pointer m(new VersionMetadata(PortageDepParser::parse_depend));
- m->slot = SlotName(stringify(g->version));
+ VersionMetadata::Pointer m(new GemsVersionMetadata(g->version));
m->homepage = g->homepage;
if (g->description.empty())
m->description = g->summary;
diff --git a/paludis/repositories/gems/gems_version_metadata.cc b/paludis/repositories/gems/gems_version_metadata.cc
new file mode 100644
index 0000000..96e4081
--- /dev/null
+++ b/paludis/repositories/gems/gems_version_metadata.cc
@@ -0,0 +1,43 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "gems_version_metadata.hh"
+#include <paludis/portage_dep_parser.hh>
+
+using namespace paludis;
+
+GemsVersionMetadata::GemsVersionMetadata(const VersionSpec & v) :
+ VersionMetadata(
+ VersionMetadataBase(SlotName(stringify(v)), "", "", "paludis-1"),
+ VersionMetadataCapabilities::create()
+ .deps_interface(this)
+ .ebuild_interface(0)
+ .cran_interface(0)
+ .virtual_interface(0)
+ .origins_interface(0)
+ .license_interface(0)
+ ),
+ VersionMetadataDepsInterface(&PortageDepParser::parse_depend)
+{
+}
+
+GemsVersionMetadata::~GemsVersionMetadata()
+{
+}
+
diff --git a/paludis/repositories/gems/gems_version_metadata.hh b/paludis/repositories/gems/gems_version_metadata.hh
new file mode 100644
index 0000000..cd141b8
--- /dev/null
+++ b/paludis/repositories/gems/gems_version_metadata.hh
@@ -0,0 +1,44 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PALUDIS_GUARD_PALUDIS_REPOSITORIES_GEMS_GEMS_VERSION_METADATA_HH
+#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_GEMS_GEMS_VERSION_METADATA_HH 1
+
+#include <paludis/version_metadata.hh>
+#include <paludis/version_spec.hh>
+
+namespace paludis
+{
+ /**
+ * Version metadata for a Gems repository entry.
+ *
+ * \see GemsRepository
+ * \ingroup grpgemsrepository
+ */
+ class GemsVersionMetadata :
+ public VersionMetadata,
+ public VersionMetadataDepsInterface
+ {
+ public:
+ GemsVersionMetadata(const VersionSpec &);
+ virtual ~GemsVersionMetadata();
+ };
+}
+
+#endif
diff --git a/paludis/repositories/nothing/nothing_repository.cc b/paludis/repositories/nothing/nothing_repository.cc
index e4eafb9..fef71e4 100644
--- a/paludis/repositories/nothing/nothing_repository.cc
+++ b/paludis/repositories/nothing/nothing_repository.cc
@@ -20,6 +20,7 @@
#include "config.h"
#include <paludis/repositories/nothing/nothing_repository.hh>
+#include <paludis/package_database.hh>
#include <paludis/util/collection_concrete.hh>
#include <paludis/portage_dep_parser.hh>
#include <paludis/syncer.hh>
@@ -170,11 +171,7 @@ VersionMetadata::ConstPointer
NothingRepository::do_version_metadata(
const QualifiedPackageName & q, const VersionSpec & v) const
{
- Log::get_instance()->message(ll_warning, lc_context, "has_version failed for request for '" +
- stringify(q) + "-" + stringify(v) + "' in repository '" +
- stringify(name()) + "'");
- return VersionMetadata::ConstPointer(new VersionMetadata::Ebuild(
- PortageDepParser::parse_depend));
+ throw NoSuchPackageError(stringify(PackageDatabaseEntry(q, v, name())));
}
CountedPtr<Repository>
diff --git a/paludis/repositories/nothing/nothing_repository.hh b/paludis/repositories/nothing/nothing_repository.hh
index 022215f..c3f2c92 100644
--- a/paludis/repositories/nothing/nothing_repository.hh
+++ b/paludis/repositories/nothing/nothing_repository.hh
@@ -64,7 +64,7 @@ namespace paludis
virtual VersionMetadata::ConstPointer do_version_metadata(
const QualifiedPackageName &,
- const VersionSpec &) const;
+ const VersionSpec &) const PALUDIS_ATTRIBUTE((noreturn));
virtual bool do_is_licence(const std::string &) const;
diff --git a/paludis/repositories/portage/Makefile.am b/paludis/repositories/portage/Makefile.am
index 71ea5fc..22e7850 100644
--- a/paludis/repositories/portage/Makefile.am
+++ b/paludis/repositories/portage/Makefile.am
@@ -61,7 +61,8 @@ paludis_repositories_portage_include_HEADERS = \
ebuild_flat_metadata_cache.hh \
eclass_mtimes.hh \
make_ebuild_repository.hh \
- use_desc.hh
+ use_desc.hh \
+ portage_virtual_version_metadata.hh
libpaludisportagerepository_la_SOURCES = \
glsa.cc \
@@ -78,6 +79,7 @@ libpaludisportagerepository_la_SOURCES = \
portage_repository_params.cc \
make_ebuild_repository.cc \
use_desc.cc \
+ portage_virtual_version_metadata.cc \
registration.cc \
$(paludis_repositories_portage_include_HEADERS)
diff --git a/paludis/repositories/portage/ebuild_entries.cc b/paludis/repositories/portage/ebuild_entries.cc
index 0c2c2b0..ac64004 100644
--- a/paludis/repositories/portage/ebuild_entries.cc
+++ b/paludis/repositories/portage/ebuild_entries.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2005, 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -89,7 +89,7 @@ EbuildEntries::generate_version_metadata(const QualifiedPackageName & q,
{
Context context("When generating version metadata for '" + stringify(q) + "-" + stringify(v) + "':");
- VersionMetadata::Pointer result(new VersionMetadata::Ebuild(PortageDepParser::parse_depend));
+ EbuildVersionMetadata::Pointer result(new EbuildVersionMetadata);
FSEntry ebuild_file(_imp->params.location / stringify(q.category) /
stringify(q.package) / (stringify(q.package) + "-" + stringify(v) + ".ebuild"));
@@ -243,7 +243,7 @@ EbuildEntries::install(const QualifiedPackageName & q, const VersionSpec & v,
{
std::list<std::string> restricts;
WhitespaceTokeniser::get_instance()->tokenise(
- metadata->get_ebuild_interface()->restrict_string, std::back_inserter(restricts));
+ metadata->ebuild_interface->restrict_string, std::back_inserter(restricts));
fetch_restrict = (restricts.end() != std::find(restricts.begin(), restricts.end(), "fetch")) ||
(restricts.end() != std::find(restricts.begin(), restricts.end(), "nofetch"));
no_mirror = (restricts.end() != std::find(restricts.begin(), restricts.end(), "mirror")) ||
@@ -255,7 +255,7 @@ EbuildEntries::install(const QualifiedPackageName & q, const VersionSpec & v,
std::set<std::string> already_in_archives;
/* make A and FLAT_SRC_URI */
- DepAtom::ConstPointer f_atom(PortageDepParser::parse(metadata->get_ebuild_interface()->src_uri,
+ DepAtom::ConstPointer f_atom(PortageDepParser::parse(metadata->ebuild_interface->src_uri,
PortageDepParserPolicy<PlainTextDepAtom, false>::get_instance()));
DepAtomFlattener f(_imp->params.environment, &e, f_atom);
@@ -339,7 +339,7 @@ EbuildEntries::install(const QualifiedPackageName & q, const VersionSpec & v,
/* make AA */
DepAtom::ConstPointer g_atom(PortageDepParser::parse(
- metadata->get_ebuild_interface()->src_uri,
+ metadata->ebuild_interface->src_uri,
PortageDepParserPolicy<PlainTextDepAtom, false>::get_instance()));
AAFinder g(g_atom);
std::set<std::string> already_in_all_archives;
@@ -378,7 +378,7 @@ EbuildEntries::install(const QualifiedPackageName & q, const VersionSpec & v,
std::string use;
{
std::set<UseFlagName> iuse;
- WhitespaceTokeniser::get_instance()->tokenise(metadata->get_ebuild_interface()->
+ WhitespaceTokeniser::get_instance()->tokenise(metadata->ebuild_interface->
iuse, create_inserter<UseFlagName>(std::inserter(iuse, iuse.begin())));
for (std::set<UseFlagName>::const_iterator iuse_it(iuse.begin()), iuse_end(iuse.end()) ;
iuse_it != iuse_end; ++iuse_it)
diff --git a/paludis/repositories/portage/ebuild_flat_metadata_cache.cc b/paludis/repositories/portage/ebuild_flat_metadata_cache.cc
index a377e64..ca83e19 100644
--- a/paludis/repositories/portage/ebuild_flat_metadata_cache.cc
+++ b/paludis/repositories/portage/ebuild_flat_metadata_cache.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -38,7 +38,7 @@ EbuildFlatMetadataCache::EbuildFlatMetadataCache(const FSEntry & f,
}
bool
-EbuildFlatMetadataCache::load(VersionMetadata::Pointer result)
+EbuildFlatMetadataCache::load(EbuildVersionMetadata::Pointer result)
{
Context context("When loading version metadata to '" + stringify(_filename) + "':");
@@ -47,20 +47,20 @@ EbuildFlatMetadataCache::load(VersionMetadata::Pointer result)
if (cache)
{
- std::getline(cache, line); result->deps.build_depend_string = line;
- std::getline(cache, line); result->deps.run_depend_string = line;
+ std::getline(cache, line); result->build_depend_string = line;
+ std::getline(cache, line); result->run_depend_string = line;
std::getline(cache, line); result->slot = SlotName(line);
- std::getline(cache, line); result->get_ebuild_interface()->src_uri = line;
- std::getline(cache, line); result->get_ebuild_interface()->restrict_string = line;
+ std::getline(cache, line); result->src_uri = line;
+ std::getline(cache, line); result->restrict_string = line;
std::getline(cache, line); result->homepage = line;
std::getline(cache, line); result->license_string = line;
std::getline(cache, line); result->description = line;
- std::getline(cache, line); result->get_ebuild_interface()->keywords = line;
- std::getline(cache, line); result->get_ebuild_interface()->inherited = line;
- std::getline(cache, line); result->get_ebuild_interface()->iuse = line;
+ std::getline(cache, line); result->keywords = line;
+ std::getline(cache, line); result->inherited = line;
+ std::getline(cache, line); result->iuse = line;
std::getline(cache, line);
- std::getline(cache, line); result->deps.post_depend_string = line;
- std::getline(cache, line); result->get_ebuild_interface()->provide_string = line;
+ std::getline(cache, line); result->post_depend_string = line;
+ std::getline(cache, line); result->provide_string = line;
std::getline(cache, line); result->eapi = line;
// check mtimes
@@ -73,7 +73,7 @@ EbuildFlatMetadataCache::load(VersionMetadata::Pointer result)
{
std::set<std::string> inherits;
WhitespaceTokeniser::get_instance()->tokenise(
- stringify(result->get_ebuild_interface()->inherited),
+ stringify(result->inherited),
std::inserter(inherits, inherits.end()));
for (std::set<std::string>::const_iterator i(inherits.begin()),
@@ -111,7 +111,7 @@ namespace
}
void
-EbuildFlatMetadataCache::save(VersionMetadata::ConstPointer v)
+EbuildFlatMetadataCache::save(EbuildVersionMetadata::ConstPointer v)
{
Context context("When saving version metadata to '" + stringify(_filename) + "':");
@@ -121,20 +121,20 @@ EbuildFlatMetadataCache::save(VersionMetadata::ConstPointer v)
if (cache)
{
- cache << normalise(v->deps.build_depend_string) << std::endl;
- cache << normalise(v->deps.run_depend_string) << std::endl;
+ cache << normalise(v->build_depend_string) << std::endl;
+ cache << normalise(v->run_depend_string) << std::endl;
cache << normalise(v->slot) << std::endl;
- cache << normalise(v->get_ebuild_interface()->src_uri) << std::endl;
- cache << normalise(v->get_ebuild_interface()->restrict_string) << std::endl;
+ cache << normalise(v->src_uri) << std::endl;
+ cache << normalise(v->restrict_string) << std::endl;
cache << normalise(v->homepage) << std::endl;
cache << normalise(v->license_string) << std::endl;
cache << normalise(v->description) << std::endl;
- cache << normalise(v->get_ebuild_interface()->keywords) << std::endl;
- cache << normalise(v->get_ebuild_interface()->inherited) << std::endl;
- cache << normalise(v->get_ebuild_interface()->iuse) << std::endl;
+ cache << normalise(v->keywords) << std::endl;
+ cache << normalise(v->inherited) << std::endl;
+ cache << normalise(v->iuse) << std::endl;
cache << std::endl;
- cache << normalise(v->deps.post_depend_string) << std::endl;
- cache << normalise(v->get_ebuild_interface()->provide_string) << std::endl;
+ cache << normalise(v->post_depend_string) << std::endl;
+ cache << normalise(v->provide_string) << std::endl;
cache << normalise(v->eapi) << std::endl;
}
else
diff --git a/paludis/repositories/portage/ebuild_flat_metadata_cache.hh b/paludis/repositories/portage/ebuild_flat_metadata_cache.hh
index 6c75465..496e96d 100644
--- a/paludis/repositories/portage/ebuild_flat_metadata_cache.hh
+++ b/paludis/repositories/portage/ebuild_flat_metadata_cache.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -20,6 +20,7 @@
#ifndef PALUDIS_GUARD_PALUDIS_REPOSITORIES_PORTAGE_EBUILD_FLAT_METADATA_CACHE_HH
#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_PORTAGE_EBUILD_FLAT_METADATA_CACHE_HH 1
+#include <paludis/ebuild.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/version_metadata.hh>
#include <paludis/repositories/portage/eclass_mtimes.hh>
@@ -56,8 +57,8 @@ namespace paludis
///\name Cache operations
///\{
- bool load(VersionMetadata::Pointer);
- void save(VersionMetadata::ConstPointer);
+ bool load(EbuildVersionMetadata::Pointer);
+ void save(EbuildVersionMetadata::ConstPointer);
///\}
};
diff --git a/paludis/repositories/portage/portage_repository.cc b/paludis/repositories/portage/portage_repository.cc
index b938a74..0cea3d2 100644
--- a/paludis/repositories/portage/portage_repository.cc
+++ b/paludis/repositories/portage/portage_repository.cc
@@ -26,6 +26,7 @@
#include <paludis/repositories/portage/portage_repository_sets.hh>
#include <paludis/repositories/portage/portage_repository_exceptions.hh>
#include <paludis/repositories/portage/portage_repository_entries.hh>
+#include <paludis/repositories/portage/portage_virtual_version_metadata.hh>
#include <paludis/repositories/portage/use_desc.hh>
#include <paludis/config_file.hh>
@@ -969,16 +970,15 @@ PortageRepository::virtual_package_version_metadata(const RepositoryVirtualsEntr
const VersionSpec & v) const
{
VersionMetadata::ConstPointer m(version_metadata(p.provided_by_atom->package(), v));
- VersionMetadata::Virtual::Pointer result(new VersionMetadata::Virtual(
- PortageDepParser::parse_depend, PackageDatabaseEntry(
- p.provided_by_atom->package(), v, name())));
+ PortageVirtualVersionMetadata::Pointer result(new PortageVirtualVersionMetadata(
+ m->slot, PackageDatabaseEntry(p.provided_by_atom->package(), v, name())));
+
+ if (m->license_interface)
+ result->license_string = m->license_interface->license_string;
- result->slot = m->slot;
- result->license_string = m->license_string;
result->eapi = m->eapi;
- result->deps = VersionMetadataDeps(&PortageDepParser::parse_depend,
- "=" + stringify(p.provided_by_atom->package()) + "-" + stringify(v),
- "=" + stringify(p.provided_by_atom->package()) + "-" + stringify(v), "", "");
+ result->deps_interface->build_depend_string = "=" + stringify(p.provided_by_atom->package()) + "-" + stringify(v);
+ result->deps_interface->run_depend_string = "=" + stringify(p.provided_by_atom->package()) + "-" + stringify(v);
return result;
diff --git a/paludis/repositories/portage/portage_virtual_version_metadata.cc b/paludis/repositories/portage/portage_virtual_version_metadata.cc
new file mode 100644
index 0000000..21e12dc
--- /dev/null
+++ b/paludis/repositories/portage/portage_virtual_version_metadata.cc
@@ -0,0 +1,46 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "portage_virtual_version_metadata.hh"
+#include <paludis/portage_dep_parser.hh>
+
+using namespace paludis;
+
+PortageVirtualVersionMetadata::PortageVirtualVersionMetadata(const SlotName & s,
+ const PackageDatabaseEntry & e) :
+ VersionMetadata(
+ VersionMetadataBase(s, "", "", "paludis-1"),
+ VersionMetadataCapabilities::create()
+ .virtual_interface(this)
+ .ebuild_interface(this)
+ .deps_interface(this)
+ .license_interface(this)
+ .cran_interface(0)
+ .origins_interface(0)
+ ),
+ VersionMetadataVirtualInterface(e),
+ VersionMetadataDepsInterface(&PortageDepParser::parse_depend),
+ VersionMetadataLicenseInterface(&PortageDepParser::parse_license)
+{
+}
+
+PortageVirtualVersionMetadata::~PortageVirtualVersionMetadata()
+{
+}
+
diff --git a/paludis/repositories/portage/portage_virtual_version_metadata.hh b/paludis/repositories/portage/portage_virtual_version_metadata.hh
new file mode 100644
index 0000000..8eb244d
--- /dev/null
+++ b/paludis/repositories/portage/portage_virtual_version_metadata.hh
@@ -0,0 +1,43 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PALUDIS_GUARD_PALUDIS_REPOSITORIES_PORTAGE_PORTAGE_VIRTUAL_VERSION_METADATA_HH
+#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_PORTAGE_PORTAGE_VIRTUAL_VERSION_METADATA_HH 1
+
+#include <paludis/version_metadata.hh>
+
+namespace paludis
+{
+ class PortageVirtualVersionMetadata :
+ public VersionMetadata,
+ public VersionMetadataVirtualInterface,
+ public VersionMetadataEbuildInterface,
+ public VersionMetadataDepsInterface,
+ public VersionMetadataLicenseInterface
+ {
+ public:
+ PortageVirtualVersionMetadata(const SlotName &, const PackageDatabaseEntry &);
+ virtual ~PortageVirtualVersionMetadata();
+
+ typedef CountedPtr<const PortageVirtualVersionMetadata, count_policy::InternalCountTag> ConstPointer;
+ typedef CountedPtr<PortageVirtualVersionMetadata, count_policy::InternalCountTag> Pointer;
+ };
+}
+
+#endif
diff --git a/paludis/repositories/vdb/Makefile.am b/paludis/repositories/vdb/Makefile.am
index eaa8476..e01432f 100644
--- a/paludis/repositories/vdb/Makefile.am
+++ b/paludis/repositories/vdb/Makefile.am
@@ -23,12 +23,15 @@ endif
libpaludisvdbrepository_la_SOURCES = \
vdb_repository.cc \
vdb_repository.hh \
+ vdb_version_metadata.hh \
+ vdb_version_metadata.cc \
registration.cc
libpaludisvdbrepository_la_LDFLAGS = -version-info @VERSION_LIB_CURRENT@:@VERSION_LIB_REVISION@:0
paludis_repositories_vdb_includedir = $(includedir)/paludis/repositories/vdb/
paludis_repositories_vdb_include_HEADERS = \
vdb_repository.hh \
+ vdb_version_metadata.hh \
vdb_repository-sr.hh
if ! MONOLITHIC
diff --git a/paludis/repositories/vdb/vdb_repository.cc b/paludis/repositories/vdb/vdb_repository.cc
index dae4522..cd7ca16 100644
--- a/paludis/repositories/vdb/vdb_repository.cc
+++ b/paludis/repositories/vdb/vdb_repository.cc
@@ -18,11 +18,12 @@
*/
#include <paludis/repositories/vdb/vdb_repository.hh>
+#include <paludis/repositories/vdb/vdb_version_metadata.hh>
#include <paludis/dep_atom.hh>
#include <paludis/dep_atom_flattener.hh>
-#include <paludis/portage_dep_parser.hh>
#include <paludis/ebuild.hh>
+#include <paludis/portage_dep_parser.hh>
#include <paludis/hashed_containers.hh>
#include <paludis/config_file.hh>
#include <paludis/match_package.hh>
@@ -72,7 +73,7 @@ namespace
VersionSpec version;
/// Our metadata, may be zero.
- VersionMetadata::Pointer metadata;
+ VDBVersionMetadata::Pointer metadata;
/// Our built USE flags.
std::set<UseFlagName> use;
@@ -449,21 +450,16 @@ namespace paludis
Context context("When loading VDBRepository entry for '" + stringify(p->name)
+ "-" + stringify(p->version) + "' from '" + stringify(location) + "':");
- p->metadata = VersionMetadata::Pointer(new VersionMetadata::Ebuild(PortageDepParser::parse_depend));
- p->metadata->deps.build_depend_string = file_contents(location, p->name, p->version, "DEPEND");
- p->metadata->deps.run_depend_string = file_contents(location, p->name, p->version, "RDEPEND");
+ p->metadata = VDBVersionMetadata::Pointer(new VDBVersionMetadata);
+ p->metadata->build_depend_string = file_contents(location, p->name, p->version, "DEPEND");
+ p->metadata->run_depend_string = file_contents(location, p->name, p->version, "RDEPEND");
p->metadata->license_string = file_contents(location, p->name, p->version, "LICENSE");
- p->metadata->get_ebuild_interface()->keywords = "*";
- p->metadata->get_ebuild_interface()->inherited =
- file_contents(location, p->name, p->version, "INHERITED");
- p->metadata->get_ebuild_interface()->iuse =
- file_contents(location, p->name, p->version, "IUSE");
- p->metadata->deps.post_depend_string =
- file_contents(location, p->name, p->version, "PDEPEND");
- p->metadata->get_ebuild_interface()->provide_string =
- file_contents(location, p->name, p->version, "PROVIDE");
- p->metadata->get_ebuild_interface()->src_uri =
- file_contents(location, p->name, p->version, "SRC_URI");
+ p->metadata->keywords = "*";
+ p->metadata->inherited = file_contents(location, p->name, p->version, "INHERITED");
+ p->metadata->iuse = file_contents(location, p->name, p->version, "IUSE");
+ p->metadata->post_depend_string = file_contents(location, p->name, p->version, "PDEPEND");
+ p->metadata->provide_string = file_contents(location, p->name, p->version, "PROVIDE");
+ p->metadata->src_uri = file_contents(location, p->name, p->version, "SRC_URI");
p->metadata->eapi = file_contents(location, p->name, p->version, "EAPI");
p->metadata->homepage = file_contents(location, p->name, p->version, "HOMEPAGE");
p->metadata->description = file_contents(location, p->name, p->version, "DESCRIPTION");
@@ -480,7 +476,7 @@ namespace paludis
std::string repo(file_contents(location, p->name, p->version, "REPOSITORY"));
if (! repo.empty())
- p->metadata->origins.source.assign(new PackageDatabaseEntry(p->name, p->version,
+ p->metadata->source.assign(new PackageDatabaseEntry(p->name, p->version,
RepositoryName(repo)));
std::string raw_use(file_contents(location, p->name, p->version, "USE"));
@@ -1187,16 +1183,14 @@ VDBRepository::provided_packages() const
VersionMetadata::ConstPointer
VDBRepository::provided_package_version_metadata(const RepositoryProvidesEntry & p) const
{
- VersionMetadata::ConstPointer m(version_metadata(p.provided_by_name, p.version));
- VersionMetadata::Virtual::Pointer result(new VersionMetadata::Virtual(
- PortageDepParser::parse_depend, PackageDatabaseEntry(p.provided_by_name,
- p.version, name())));
+ VDBVersionMetadata::ConstPointer m(version_metadata(p.provided_by_name, p.version));
+ VDBVirtualVersionMetadata::Pointer result(new VDBVirtualVersionMetadata(
+ m->slot, PackageDatabaseEntry(p.provided_by_name, p.version, name())));
- result->slot = m->slot;
result->license_string = m->license_string;
result->eapi = m->eapi;
- result->deps = VersionMetadataDeps(&PortageDepParser::parse_depend,
- stringify(p.provided_by_name), stringify(p.provided_by_name), "", "");
+ result->build_depend_string = stringify(p.provided_by_name);
+ result->run_depend_string = stringify(p.provided_by_name);
return result;
}
@@ -1322,7 +1316,7 @@ VDBRepository::load_provided_the_slow_way() const
{
std::string provide_str;
if (e->metadata)
- provide_str = e->metadata->get_ebuild_interface()->provide_string;
+ provide_str = e->metadata->ebuild_interface->provide_string;
else
{
// _imp->load_entry(e); slow
@@ -1407,7 +1401,7 @@ VDBRepository::regenerate_provides_cache() const
{
std::string provide_str;
if (c->metadata)
- provide_str = c->metadata->get_ebuild_interface()->provide_string;
+ provide_str = c->metadata->ebuild_interface->provide_string;
else
provide_str = file_contents(_imp->location, c->name, c->version, "PROVIDE");
diff --git a/paludis/repositories/vdb/vdb_version_metadata.cc b/paludis/repositories/vdb/vdb_version_metadata.cc
new file mode 100644
index 0000000..873d525
--- /dev/null
+++ b/paludis/repositories/vdb/vdb_version_metadata.cc
@@ -0,0 +1,66 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "vdb_version_metadata.hh"
+#include <paludis/portage_dep_parser.hh>
+
+using namespace paludis;
+
+VDBVersionMetadata::VDBVersionMetadata() :
+ VersionMetadata(
+ VersionMetadataBase(SlotName("unset"), "", "", "UNKNOWN"),
+ VersionMetadataCapabilities::create()
+ .deps_interface(this)
+ .origins_interface(this)
+ .ebuild_interface(this)
+ .license_interface(this)
+ .virtual_interface(0)
+ .cran_interface(0)
+ ),
+ VersionMetadataDepsInterface(&PortageDepParser::parse_depend),
+ VersionMetadataLicenseInterface(&PortageDepParser::parse_license)
+{
+}
+
+VDBVersionMetadata::~VDBVersionMetadata()
+{
+}
+
+VDBVirtualVersionMetadata::VDBVirtualVersionMetadata(const SlotName & s,
+ const PackageDatabaseEntry & e) :
+ VersionMetadata(
+ VersionMetadataBase(s, "", "", "UNKNOWN"),
+ VersionMetadataCapabilities::create()
+ .deps_interface(this)
+ .origins_interface(this)
+ .ebuild_interface(this)
+ .license_interface(this)
+ .virtual_interface(this)
+ .cran_interface(0)
+ ),
+ VersionMetadataDepsInterface(&PortageDepParser::parse_depend),
+ VersionMetadataLicenseInterface(&PortageDepParser::parse_license),
+ VersionMetadataVirtualInterface(e)
+{
+}
+
+VDBVirtualVersionMetadata::~VDBVirtualVersionMetadata()
+{
+}
+
diff --git a/paludis/repositories/vdb/vdb_version_metadata.hh b/paludis/repositories/vdb/vdb_version_metadata.hh
new file mode 100644
index 0000000..88fa02e
--- /dev/null
+++ b/paludis/repositories/vdb/vdb_version_metadata.hh
@@ -0,0 +1,59 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PALUDIS_GUARD_PALUDIS_REPOSITORIES_VDB_VDB_VERSION_METADATA_HH
+#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_VDB_VDB_VERSION_METADATA_HH 1
+
+#include <paludis/version_metadata.hh>
+
+namespace paludis
+{
+ class VDBVersionMetadata :
+ public VersionMetadata,
+ public VersionMetadataDepsInterface,
+ public VersionMetadataOriginsInterface,
+ public VersionMetadataEbuildInterface,
+ public VersionMetadataLicenseInterface
+ {
+ public:
+ VDBVersionMetadata();
+ virtual ~VDBVersionMetadata();
+
+ typedef CountedPtr<const VDBVersionMetadata, count_policy::InternalCountTag> ConstPointer;
+ typedef CountedPtr<VDBVersionMetadata, count_policy::InternalCountTag> Pointer;
+ };
+
+ class VDBVirtualVersionMetadata :
+ public VersionMetadata,
+ public VersionMetadataDepsInterface,
+ public VersionMetadataOriginsInterface,
+ public VersionMetadataEbuildInterface,
+ public VersionMetadataLicenseInterface,
+ public VersionMetadataVirtualInterface
+ {
+ public:
+ VDBVirtualVersionMetadata(const SlotName &, const PackageDatabaseEntry &);
+ virtual ~VDBVirtualVersionMetadata();
+
+ typedef CountedPtr<const VDBVirtualVersionMetadata, count_policy::InternalCountTag> ConstPointer;
+ typedef CountedPtr<VDBVirtualVersionMetadata, count_policy::InternalCountTag> Pointer;
+ };
+}
+
+#endif
diff --git a/paludis/tasks/find_unused_packages_task.cc b/paludis/tasks/find_unused_packages_task.cc
index 2ddfb59..2d79d28 100644
--- a/paludis/tasks/find_unused_packages_task.cc
+++ b/paludis/tasks/find_unused_packages_task.cc
@@ -48,7 +48,7 @@ FindUnusedPackagesTask::execute(const QualifiedPackageName & package)
p != p_end ; ++p)
{
VersionMetadata::ConstPointer metadata(_repo->version_metadata(package, p->version));
- if (! metadata->get_ebuild_interface())
+ if (! metadata->ebuild_interface)
continue;
if (metadata->slot != old_slot)
@@ -58,7 +58,7 @@ FindUnusedPackagesTask::execute(const QualifiedPackageName & package)
}
std::set<KeywordName> current_keywords;
- WhitespaceTokeniser::get_instance()->tokenise(metadata->get_ebuild_interface()->keywords,
+ WhitespaceTokeniser::get_instance()->tokenise(metadata->ebuild_interface->keywords,
create_inserter<KeywordName>(std::inserter(current_keywords, current_keywords.end())));
bool used(false);
diff --git a/paludis/tasks/report_task.cc b/paludis/tasks/report_task.cc
index 5d8bf95..01f3607 100644
--- a/paludis/tasks/report_task.cc
+++ b/paludis/tasks/report_task.cc
@@ -190,9 +190,9 @@ ReportTask::execute()
{
VersionMetadata::ConstPointer m(rr->version_metadata(pde.name, pde.version));
- if (m->origins.source)
+ if (m->origins_interface && m->origins_interface->source)
{
- mr = e->mask_reasons(*(m->origins.source));
+ mr = e->mask_reasons(*(m->origins_interface->source));
if (mr.any())
is_masked = true;
}
diff --git a/paludis/version_metadata.cc b/paludis/version_metadata.cc
index cb6a21d..5fa093e 100644
--- a/paludis/version_metadata.cc
+++ b/paludis/version_metadata.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2005, 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -34,137 +34,69 @@ using namespace paludis;
#include <paludis/version_metadata-sr.cc>
DepAtom::ConstPointer
-VersionMetadataDeps::build_depend() const
+VersionMetadataDepsInterface::build_depend() const
{
return parser(build_depend_string);
}
DepAtom::ConstPointer
-VersionMetadataDeps::run_depend() const
+VersionMetadataDepsInterface::run_depend() const
{
return parser(run_depend_string);
}
DepAtom::ConstPointer
-VersionMetadataDeps::post_depend() const
+VersionMetadataDepsInterface::post_depend() const
{
return parser(post_depend_string);
}
DepAtom::ConstPointer
-VersionMetadataDeps::suggested_depend() const
+VersionMetadataDepsInterface::suggested_depend() const
{
return parser(suggested_depend_string);
}
-VersionMetadataDeps::VersionMetadataDeps(const ParserFunction & p) :
+VersionMetadataDepsInterface::VersionMetadataDepsInterface(const ParserFunction & p) :
parser(p)
{
}
-VersionMetadata::CRAN::CRAN(ParserFunction f) :
- VersionMetadata(f, &_c, 0, 0, 0),
- _c(CRANVersionMetadata::create()
- .keywords("")
- .package("")
- .version("")
- .is_bundle(false)
- .is_bundle_member(false))
-{
-}
-
-VersionMetadata::Ebuild::Ebuild(ParserFunction f) :
- VersionMetadata(f, 0, &_e, 0, 0),
- _e()
-{
-}
-
-VersionMetadata::Ebin::Ebin(ParserFunction f) :
- VersionMetadata(f, 0, &_e, &_eb, 0),
- _e(),
- _eb()
-{
-}
-
VersionMetadata::~VersionMetadata()
{
}
-VersionMetadata::VersionMetadata(ParserFunction p) :
- VersionMetadataBase(VersionMetadataBase::create()
- .slot(SlotName("unset"))
- .deps(VersionMetadataDeps(p))
- .origins(VersionMetadataOrigins())
- .homepage("")
- .license_string("")
- .description("")
- .eapi("")),
- _cran_if(0),
- _ebuild_if(0),
- _ebin_if(0),
- _virtual_if(0)
-{
-}
-
-VersionMetadata::VersionMetadata(ParserFunction p,
- CRANVersionMetadata * cran_if,
- EbuildVersionMetadata * ebuild_if,
- EbinVersionMetadata * ebin_if,
- VirtualMetadata * virtual_if) :
- VersionMetadataBase(VersionMetadataBase::create()
- .slot(SlotName("unset"))
- .deps(VersionMetadataDeps(p))
- .origins(VersionMetadataOrigins())
- .homepage("")
- .license_string("")
- .description("")
- .eapi("")),
- _cran_if(cran_if),
- _ebuild_if(ebuild_if),
- _ebin_if(ebin_if),
- _virtual_if(virtual_if)
+VersionMetadata::VersionMetadata(const VersionMetadataBase & base, const VersionMetadataCapabilities & caps) :
+ VersionMetadataBase(base),
+ VersionMetadataCapabilities(caps)
{
}
-EbuildVersionMetadata::EbuildVersionMetadata() :
- provide_string(""),
- src_uri(""),
- restrict_string(""),
- keywords(""),
- iuse(""),
- inherited("")
+DepAtom::ConstPointer
+VersionMetadataEbuildInterface::provide() const
{
+ return PortageDepParser::parse(provide_string, PortageDepParserPolicy<PackageDepAtom,
+ false>::get_instance());
}
-EbinVersionMetadata::EbinVersionMetadata() :
- bin_uri(""),
- src_repository(RepositoryName("unset"))
+VersionMetadataOriginsInterface::VersionMetadataOriginsInterface() :
+ source(0),
+ binary(0)
{
}
-DepAtom::ConstPointer
-EbuildVersionMetadata::provide() const
+VersionMetadataLicenseInterface::VersionMetadataLicenseInterface(const ParserFunction & f) :
+ parser(f)
{
- return PortageDepParser::parse(provide_string, PortageDepParserPolicy<PackageDepAtom,
- false>::get_instance());
}
DepAtom::ConstPointer
-VersionMetadata::license() const
-{
- return PortageDepParser::parse(license_string, PortageDepParserPolicy<PlainTextDepAtom,
- true>::get_instance());
-}
-
-VersionMetadata::Virtual::Virtual(ParserFunction p, const PackageDatabaseEntry & e) :
- VersionMetadata(p, 0, 0, 0, &_v),
- _v(e)
+VersionMetadataLicenseInterface::license() const
{
+ return parser(license_string);
}
-VersionMetadataOrigins::VersionMetadataOrigins() :
- source(0),
- binary(0)
+VersionMetadataEbuildInterface::VersionMetadataEbuildInterface()
{
}
diff --git a/paludis/version_metadata.hh b/paludis/version_metadata.hh
index f5ed155..7d2a802 100644
--- a/paludis/version_metadata.hh
+++ b/paludis/version_metadata.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2005, 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -36,6 +36,13 @@
namespace paludis
{
+ class VersionMetadataEbuildInterface;
+ class VersionMetadataCRANInterface;
+ class VersionMetadataDepsInterface;
+ class VersionMetadataOriginsInterface;
+ class VersionMetadataVirtualInterface;
+ class VersionMetadataLicenseInterface;
+
/**
* A pointer to a parse function.
*
@@ -53,235 +60,15 @@ namespace paludis
class VersionMetadata :
private InstantiationPolicy<VersionMetadata, instantiation_method::NonCopyableTag>,
public VersionMetadataBase,
- public InternalCounted<VersionMetadata>
+ public InternalCounted<VersionMetadata>,
+ public VersionMetadataCapabilities
{
- private:
- CRANVersionMetadata * _cran_if;
- EbuildVersionMetadata * _ebuild_if;
- EbinVersionMetadata * _ebin_if;
- VirtualMetadata * _virtual_if;
-
- protected:
- /**
- * Constructor.
- */
- VersionMetadata(ParserFunction, CRANVersionMetadata * cran_if,
- EbuildVersionMetadata * ebuild_if,
- EbinVersionMetadata * ebin_if,
- VirtualMetadata * virtual_if);
-
public:
- /**
- * Constructor.
- */
- VersionMetadata(ParserFunction);
-
- /**
- * Destructor.
- */
virtual ~VersionMetadata();
- /**
- * Fetch out CRAN interface, or 0.
- */
- CRANVersionMetadata *
- get_cran_interface()
- {
- return _cran_if;
- }
-
- /**
- * Fetch out CRAN interface, or 0.
- */
- const CRANVersionMetadata *
- get_cran_interface() const
- {
- return _cran_if;
- }
-
- class CRAN;
-
- /**
- * Fetch our ebuild interface, or 0.
- */
- EbuildVersionMetadata *
- get_ebuild_interface()
- {
- return _ebuild_if;
- }
-
- /**
- * Fetch our ebuild interface, or 0.
- */
- const EbuildVersionMetadata *
- get_ebuild_interface() const
- {
- return _ebuild_if;
- }
-
- class Ebuild;
-
- /**
- * Fetch our ebin interface, or 0.
- */
- EbinVersionMetadata *
- get_ebin_interface()
- {
- return _ebin_if;
- }
-
- /**
- * Fetch our ebin interface, or 0.
- */
- const EbinVersionMetadata *
- get_ebin_interface() const
- {
- return _ebin_if;
- }
-
- class Ebin;
-
- /**
- * Fetch our virtual interface, or 0.
- */
- VirtualMetadata *
- get_virtual_interface()
- {
- return _virtual_if;
- }
-
- /**
- * Fetch our virtual interface, or 0.
- */
- const VirtualMetadata *
- get_virtual_interface() const
- {
- return _virtual_if;
- }
-
- class Virtual;
-
- /**
- * Fetch our licence, as a dep atom structure.
- */
- DepAtom::ConstPointer license() const;
- };
-
- /**
- * VersionMetadata subclass, for CRAN repositories.
- *
- * \ingroup grpversions
- * \see VersionMetadata
- */
- class VersionMetadata::CRAN :
- public VersionMetadata
- {
- private:
- CRANVersionMetadata _c;
-
- public:
- /**
- * Constructor.
- */
- CRAN(ParserFunction);
-
- /**
- * Pointer to us.
- */
- typedef CountedPtr<VersionMetadata::CRAN, count_policy::InternalCountTag> Pointer;
-
- /**
- * Const pointer to us.
- */
- typedef CountedPtr<const VersionMetadata::Ebuild, count_policy::InternalCountTag> ConstPointer;
- };
-
- /**
- * VersionMetadata subclass, for ebuilds.
- *
- * \ingroup grpversions
- * \see VersionMetadata
- */
- class VersionMetadata::Ebuild :
- public VersionMetadata
- {
- private:
- EbuildVersionMetadata _e;
-
- public:
- /**
- * Constructor.
- */
- Ebuild(ParserFunction);
-
- /**
- * Pointer to us.
- */
- typedef CountedPtr<VersionMetadata::Ebuild, count_policy::InternalCountTag> Pointer;
-
- /**
- * Const pointer to us.
- */
- typedef CountedPtr<const VersionMetadata::Ebuild, count_policy::InternalCountTag> ConstPointer;
- };
-
- /**
- * VersionMetadata subclass, for ebins.
- *
- * \ingroup grpversions
- * \see VersionMetadata
- */
- class VersionMetadata::Ebin :
- public VersionMetadata
- {
- private:
- EbuildVersionMetadata _e;
- EbinVersionMetadata _eb;
-
- public:
- /**
- * Constructor.
- */
- Ebin(ParserFunction);
-
- /**
- * Pointer to us.
- */
- typedef CountedPtr<VersionMetadata::Ebin, count_policy::InternalCountTag> Pointer;
-
- /**
- * Const pointer to us.
- */
- typedef CountedPtr<const VersionMetadata::Ebin, count_policy::InternalCountTag> ConstPointer;
- };
-
- /**
- * VersionMetadata subclass, for virtuals.
- *
- * \ingroup grpversions
- * \see VersionMetadata
- */
- class VersionMetadata::Virtual :
- public VersionMetadata
- {
- private:
- VirtualMetadata _v;
-
- public:
- /**
- * Constructor.
- */
- Virtual(ParserFunction, const PackageDatabaseEntry &);
-
- /**
- * Pointer to us.
- */
- typedef CountedPtr<VersionMetadata::Virtual, count_policy::InternalCountTag> Pointer;
+ protected:
+ VersionMetadata(const VersionMetadataBase &, const VersionMetadataCapabilities &);
- /**
- * Const pointer to us.
- */
- typedef CountedPtr<const VersionMetadata::Virtual, count_policy::InternalCountTag> ConstPointer;
};
}
diff --git a/paludis/version_metadata.sr b/paludis/version_metadata.sr
index 20a13c4..7058fe8 100644
--- a/paludis/version_metadata.sr
+++ b/paludis/version_metadata.sr
@@ -1,16 +1,39 @@
#!/bin/bash
# vim: set sw=4 sts=4 et :
-make_class_VersionMetadataDeps()
+make_class_VersionMetadataCapabilities()
+{
+ key ebuild_interface "VersionMetadataEbuildInterface *"
+ key cran_interface "VersionMetadataCRANInterface *"
+ key deps_interface "VersionMetadataDepsInterface *"
+ key origins_interface "VersionMetadataOriginsInterface *"
+ key virtual_interface "VersionMetadataVirtualInterface *"
+ key license_interface "VersionMetadataLicenseInterface *"
+
+ doxygen_comment << "END"
+ /**
+ * Optional interfaces that may be provided by VersionMetadata.
+ *
+ * \see VersionMetadata
+ * \ingroup grpversions
+ * \nosubgrouping
+ */
+END
+
+ allow_named_args
+}
+
+make_class_VersionMetadataDepsInterface()
{
key parser ParserFunction
+
key build_depend_string std::string
key run_depend_string std::string
key post_depend_string std::string
key suggested_depend_string std::string
extra_constructors <<END
- VersionMetadataDeps(const ParserFunction &);
+ VersionMetadataDepsInterface(const ParserFunction &);
END
extra_methods <<END
@@ -45,13 +68,40 @@ END
END
}
-make_class_VersionMetadataOrigins()
+make_class_VersionMetadataLicenseInterface()
+{
+ key parser ParserFunction
+
+ key license_string std::string
+
+ extra_constructors <<END
+ VersionMetadataLicenseInterface(const ParserFunction &);
+END
+
+ extra_methods <<END
+ /**
+ * Our licences.
+ */
+ DepAtom::ConstPointer license() const;
+END
+
+ doxygen_comment << "END"
+ /**
+ * License data for VersionMetadata.
+ *
+ * \see VersionMetadata
+ * \ingroup grpversions
+ */
+END
+}
+
+make_class_VersionMetadataOriginsInterface()
{
key "source" "CountedPtr<PackageDatabaseEntry, count_policy::ExternalCountTag>"
key "binary" "CountedPtr<PackageDatabaseEntry, count_policy::ExternalCountTag>"
extra_constructors <<END
- VersionMetadataOrigins();
+ VersionMetadataOriginsInterface();
END
doxygen_comment << "END"
@@ -66,13 +116,10 @@ END
make_class_VersionMetadataBase()
{
- key deps VersionMetadataDeps
- key origins VersionMetadataOrigins
key slot SlotName
- key license_string std::string
- key eapi std::string
key homepage std::string
key description std::string
+ key eapi std::string
allow_named_args
@@ -86,7 +133,7 @@ make_class_VersionMetadataBase()
END
}
-make_class_EbuildVersionMetadata()
+make_class_VersionMetadataEbuildInterface()
{
key provide_string std::string
key src_uri std::string
@@ -97,7 +144,7 @@ make_class_EbuildVersionMetadata()
key inherited std::string
extra_constructors <<END
- EbuildVersionMetadata();
+ VersionMetadataEbuildInterface();
END
extra_methods <<END
@@ -119,7 +166,7 @@ END
END
}
-make_class_CRANVersionMetadata()
+make_class_VersionMetadataCRANInterface()
{
key keywords std::string
key package std::string
@@ -127,7 +174,6 @@ make_class_CRANVersionMetadata()
key is_bundle bool
key is_bundle_member bool
-
allow_named_args
doxygen_comment << "END"
@@ -140,26 +186,7 @@ make_class_CRANVersionMetadata()
END
}
-make_class_EbinVersionMetadata()
-{
- key bin_uri std::string
- key src_repository RepositoryName
-
- extra_constructors <<END
- EbinVersionMetadata();
-END
-
- doxygen_comment << "END"
- /**
- * Version metadata for ebin packages.
- *
- * \see VersionMetadata
- * \ingroup grpversions
- */
-END
-}
-
-make_class_VirtualMetadata()
+make_class_VersionMetadataVirtualInterface()
{
key virtual_for PackageDatabaseEntry
diff --git a/ruby/demos/latest_stable.rb b/ruby/demos/latest_stable.rb
index 08d19d6..862f335 100644
--- a/ruby/demos/latest_stable.rb
+++ b/ruby/demos/latest_stable.rb
@@ -67,7 +67,7 @@ def check_one_package(env, search_keywords, repo, pkg)
results = {}
repo.version_specs(pkg).each do |ver|
md = repo.version_metadata(pkg, ver)
- next if md.get_ebuild_interface.nil?
+ next if md.ebuild_interface.nil?
keywords = md.keywords.split(/\s+/)
search_keywords.each do |keyword|
if keywords.include? keyword
diff --git a/ruby/version_metadata.cc b/ruby/version_metadata.cc
index c2d0100..5e0898e 100644
--- a/ruby/version_metadata.cc
+++ b/ruby/version_metadata.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
* Copyright (c) 2007 Alexander H. Færøy <eroyf@gentoo.org>
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -34,86 +34,121 @@ namespace
static VALUE c_version_metadata;
template <typename T_>
- VALUE version_metadata_get_interface(VALUE self, const T_ * (VersionMetadata::* m) () const)
+ VALUE version_metadata_get_interface(VALUE self, T_ * (VersionMetadataCapabilities::* m))
{
VersionMetadata::ConstPointer * self_ptr;
Data_Get_Struct(self, VersionMetadata::ConstPointer, self_ptr);
- return ((**self_ptr).*m)() ? self : Qnil;
+ return ((**self_ptr).*m) ? self : Qnil;
}
/*
* call-seq:
- * get_ebuild_interface -> self or Nil
+ * ebuild_interface -> self or Nil
*
* Returns self if the VersionMetadata supports the interface, otherwise Nil.
*/
- VALUE version_metadata_get_ebuild_interface(VALUE self)
+ VALUE version_metadata_ebuild_interface(VALUE self)
{
- return version_metadata_get_interface(self, &VersionMetadata::get_ebuild_interface);
+ return version_metadata_get_interface(self, &VersionMetadata::ebuild_interface);
}
/*
* call-seq:
- * get_ebin_interface -> self or Nil
+ * cran_interface -> self or Nil
*
* Returns self if the VersionMetadata supports the interface, otherwise Nil.
*/
- VALUE version_metadata_get_ebin_interface(VALUE self)
+ VALUE version_metadata_cran_interface(VALUE self)
{
- return version_metadata_get_interface(self, &VersionMetadata::get_ebin_interface);
+ return version_metadata_get_interface(self, &VersionMetadata::cran_interface);
}
/*
* call-seq:
- * get_cran_interface -> self or Nil
+ * virtual_interface -> self or Nil
*
* Returns self if the VersionMetadata supports the interface, otherwise Nil.
*/
- VALUE version_metadata_get_cran_interface(VALUE self)
+ VALUE version_metadata_virtual_interface(VALUE self)
{
- return version_metadata_get_interface(self, &VersionMetadata::get_cran_interface);
+ return version_metadata_get_interface(self, &VersionMetadata::virtual_interface);
}
/*
* call-seq:
- * get_virtual_interface -> self or Nil
+ * deps_interface -> self or Nil
*
* Returns self if the VersionMetadata supports the interface, otherwise Nil.
*/
- VALUE version_metadata_get_virtual_interface(VALUE self)
+ VALUE version_metadata_deps_interface(VALUE self)
{
- return version_metadata_get_interface(self, &VersionMetadata::get_virtual_interface);
+ return version_metadata_get_interface(self, &VersionMetadata::deps_interface);
+ }
+
+ /*
+ * call-seq:
+ * license_interface -> self or Nil
+ *
+ * Returns self if the VersionMetadata supports the interface, otherwise Nil.
+ */
+ VALUE version_metadata_license_interface(VALUE self)
+ {
+ return version_metadata_get_interface(self, &VersionMetadata::license_interface);
+ }
+
+ /*
+ * call-seq:
+ * origins_interface -> self or Nil
+ *
+ * Returns self if the VersionMetadata supports the interface, otherwise Nil.
+ */
+ VALUE version_metadata_origins_interface(VALUE self)
+ {
+ return version_metadata_get_interface(self, &VersionMetadata::origins_interface);
}
/*
* call-seq:
* license
*
- * Fetch our license, as a DepAtom structure.
+ * Fetch our license, as a DepAtom structure, or Nil if we don't support
+ * license_interface.
*/
VALUE
version_metadata_license(VALUE self)
{
VersionMetadata::ConstPointer * self_ptr;
Data_Get_Struct(self, VersionMetadata::ConstPointer, self_ptr);
- return dep_atom_to_value((*self_ptr)->license());
+ if ((*self_ptr)->license_interface)
+ return dep_atom_to_value((*self_ptr)->license_interface->license());
+ else
+ return Qnil;
}
/*
- * Document-method: slot
- *
* call-seq:
- * slot
+ * license_string
*
- * Our slot
+ * Fetch our license, as a string, or Nil if we don't support license_interface.
*/
+ VALUE
+ version_metadata_license_string(VALUE self)
+ {
+ VersionMetadata::ConstPointer * self_ptr;
+ Data_Get_Struct(self, VersionMetadata::ConstPointer, self_ptr);
+ if ((*self_ptr)->license_interface)
+ return rb_str_new2((*self_ptr)->license_interface->license_string.c_str());
+ else
+ return Qnil;
+ }
+
/*
- * Document-method: license_string
+ * Document-method: slot
*
* call-seq:
- * license_string
+ * slot
*
- * Our license as a String
+ * Our slot
*/
/*
* Document-method: eapi
@@ -157,7 +192,7 @@ namespace
* call-seq:
* provide_string
*
- * Fetches the package provide_string, if get_ebuild_interface is not Nil.
+ * Fetches the package provide_string, if ebuild_interface is not Nil.
*/
/*
* Document-method: src_uri
@@ -165,7 +200,7 @@ namespace
* call-seq:
* src_uri
*
- * Fetches the package src_uri, if get_ebuild_interface is not Nil.
+ * Fetches the package src_uri, if ebuild_interface is not Nil.
*/
/*
* Document-method: restrict_string
@@ -173,7 +208,7 @@ namespace
* call-seq:
* restrict_string
*
- * Fetches the package restrict_string, if get_ebuild_interface is not Nil.
+ * Fetches the package restrict_string, if ebuild_interface is not Nil.
*/
/*
* Document-method: eclass_keywords
@@ -181,7 +216,7 @@ namespace
* call-seq:
* eclass_keywords
*
- * Fetches the package eclass_keywords, if get_ebuild_interface is not Nil.
+ * Fetches the package eclass_keywords, if ebuild_interface is not Nil.
*/
/*
* Document-method: iuse
@@ -189,7 +224,7 @@ namespace
* call-seq:
* iuse
*
- * Fetches the package iuse, if get_ebuild_interface is not Nil.
+ * Fetches the package iuse, if ebuild_interface is not Nil.
*/
/*
* Document-method: inherited
@@ -197,9 +232,9 @@ namespace
* call-seq:
* inherited
*
- * Fetches the package inherited, if get_ebuild_interface is not Nil.
+ * Fetches the package inherited, if ebuild_interface is not Nil.
*/
- template <typename T_, T_ EbuildVersionMetadata::* m_>
+ template <typename T_, T_ VersionMetadataEbuildInterface::* m_>
struct EbuildValue
{
static VALUE
@@ -207,39 +242,8 @@ namespace
{
VersionMetadata::ConstPointer * self_ptr;
Data_Get_Struct(self, VersionMetadata::ConstPointer, self_ptr);
- if ((*self_ptr)->get_ebuild_interface())
- return rb_str_new2(stringify((*self_ptr)->get_ebuild_interface()->*m_).c_str());
- else
- return Qnil;
- }
- };
-
- /*
- * Document-method: bin_uri
- *
- * call-seq:
- * bin_uri -> String
- *
- * Fetches the package bin_uri, if get_ebin_interface is not Nil
- */
- /*
- * Document-method: src_repository
- *
- * call-seq:
- * src_repository -> String
- *
- * Fetches the package src_repository, if get_ebin_interface is not Nil
- */
- template <typename T_, T_ EbinVersionMetadata::* m_>
- struct EbinValue
- {
- static VALUE
- fetch(VALUE self)
- {
- VersionMetadata::ConstPointer * self_ptr;
- Data_Get_Struct(self, VersionMetadata::ConstPointer, self_ptr);
- if ((*self_ptr)->get_ebin_interface())
- return rb_str_new2(stringify((*self_ptr)->get_ebin_interface()->*m_).c_str());
+ if ((*self_ptr)->ebuild_interface)
+ return rb_str_new2(stringify((*self_ptr)->ebuild_interface->*m_).c_str());
else
return Qnil;
}
@@ -251,7 +255,7 @@ namespace
* call-seq:
* package -> String
*
- * Fetches the package name, if get_cran_interface is not Nil
+ * Fetches the package name, if cran_interface is not Nil
*/
/*
* Document-method: version
@@ -259,9 +263,9 @@ namespace
* call-seq:
* version -> String
*
- * Fetches the package version, if get_ebin_interface is not Nil
+ * Fetches the package version, if ebin_interface is not Nil
*/
- template <typename T_, T_ CRANVersionMetadata::* m_>
+ template <typename T_, T_ VersionMetadataCRANInterface::* m_>
struct CRANValue
{
static VALUE
@@ -269,8 +273,8 @@ namespace
{
VersionMetadata::ConstPointer * self_ptr;
Data_Get_Struct(self, VersionMetadata::ConstPointer, self_ptr);
- if ((*self_ptr)->get_cran_interface())
- return rb_str_new2(stringify((*self_ptr)->get_cran_interface()->*m_).c_str());
+ if ((*self_ptr)->cran_interface)
+ return rb_str_new2(stringify((*self_ptr)->cran_interface->*m_).c_str());
else
return Qnil;
}
@@ -282,7 +286,8 @@ namespace
* call-seq:
* build_depend -> DepAtom
*
- * Fetches build_depend information as a DepAtom
+ * Fetches build_depend information as a DepAtom, or Nil if we have no deps
+ * interface.
*/
/*
* Document-method: run_depend
@@ -290,7 +295,8 @@ namespace
* call-seq:
* run_depend -> DepAtom
*
- * Fetches run_depend information as a DepAtom
+ * Fetches run_depend information as a DepAtom, or Nil if we have no deps
+ * interface.
*/
/*
* Document-method: suggested_depend
@@ -298,7 +304,8 @@ namespace
* call-seq:
* suggested_depend -> DepAtom
*
- * Fetches sugest_depend information as a DepAtom
+ * Fetches sugest_depend information as a DepAtom, or Nil if we have no deps
+ * interface.
*/
/*
* Document-method: post_depend
@@ -306,9 +313,10 @@ namespace
* call-seq:
* post_depend -> DepAtom
*
- * Fetches post_depend information as a DepAtom
+ * Fetches post_depend information as a DepAtom, or Nil if we have no deps
+ * interface.
*/
- template <DepAtom::ConstPointer (VersionMetadataDeps::* m_) () const>
+ template <DepAtom::ConstPointer (VersionMetadataDepsInterface::* m_) () const>
struct DependValue
{
static VALUE
@@ -316,8 +324,10 @@ namespace
{
VersionMetadata::ConstPointer * self_ptr;
Data_Get_Struct(self, VersionMetadata::ConstPointer, self_ptr);
- // don't change the line below to something cleaner, it makes g++-4.1 puke
- return dep_atom_to_value(((&(*self_ptr)->deps)->*m_)());
+ if ((*self_ptr)->deps_interface)
+ return dep_atom_to_value(((*self_ptr)->deps_interface->*m_)());
+ else
+ return Qnil;
}
};
@@ -327,7 +337,8 @@ namespace
* call-seq:
* build_depend_string -> String
*
- * Fetches build_depend information as a String
+ * Fetches build_depend information as a String, or Nil if we have no deps
+ * interface
*/
/*
* Document-method: run_depend_string
@@ -335,7 +346,8 @@ namespace
* call-seq:
* run_depend_string -> String
*
- * Fetches run_depend information as a String
+ * Fetches run_depend information as a String, or Nil if we have no deps
+ * interface
*/
/*
* Document-method: suggested_depend_string
@@ -343,7 +355,8 @@ namespace
* call-seq:
* suggested_depend_string -> String
*
- * Fetches suggested_depend information as a String
+ * Fetches suggested_depend information as a String, or Nil if we have no
+ * deps interface
*/
/*
* Document-method: post_depend_string
@@ -351,9 +364,10 @@ namespace
* call-seq:
* post_depend_string -> String
*
- * Fetches post_depend information as a String
+ * Fetches post_depend information as a String, or Nil if we have no deps
+ * interface
*/
- template <std::string VersionMetadataDeps::* m_>
+ template <std::string VersionMetadataDepsInterface::* m_>
struct DependValueString
{
static VALUE
@@ -361,9 +375,13 @@ namespace
{
VersionMetadata::ConstPointer * self_ptr;
Data_Get_Struct(self, VersionMetadata::ConstPointer, self_ptr);
- return rb_str_new2(((&(*self_ptr)->deps)->*m_).c_str());
+ if ((*self_ptr)->deps_interface)
+ return rb_str_new2((((*self_ptr)->deps_interface)->*m_).c_str());
+ else
+ return Qnil;
}
};
+
/*
* Document-method: origin_source
*
@@ -372,7 +390,7 @@ namespace
*
* Returnd the PackageDatabaseEntry from which the package was installed.
*/
- template <CountedPtr<PackageDatabaseEntry, count_policy::ExternalCountTag> VersionMetadataOrigins::* m_>
+ template <CountedPtr<PackageDatabaseEntry, count_policy::ExternalCountTag> VersionMetadataOriginsInterface::* m_>
struct VMOrigins
{
static VALUE
@@ -380,14 +398,10 @@ namespace
{
VersionMetadata::ConstPointer * self_ptr;
Data_Get_Struct(self, VersionMetadata::ConstPointer, self_ptr);
- if ((&(*self_ptr)->origins)->*m_)
- {
- return package_database_entry_to_value(*((&(*self_ptr)->origins)->*m_));
- }
+ if ((*self_ptr)->origins_interface && (((*self_ptr)->origins_interface)->*m_))
+ return package_database_entry_to_value(*(((*self_ptr)->origins_interface)->*m_));
else
- {
return Qnil;
- }
}
};
@@ -395,14 +409,14 @@ namespace
* call-seq:
* virtual_for -> PackageDatabaseEntry
*
- * Fetch package we are a virtual for, if get_virtual_interface is not Nil.
+ * Fetch package we are a virtual for, if virtual_interface is not Nil.
*/
VALUE version_metadata_virtual_for(VALUE self)
{
VersionMetadata::ConstPointer * self_ptr;
Data_Get_Struct(self, VersionMetadata::ConstPointer, self_ptr);
- if ((*self_ptr)->get_virtual_interface())
- return package_database_entry_to_value((*self_ptr)->get_virtual_interface()->virtual_for);
+ if ((*self_ptr)->virtual_interface)
+ return package_database_entry_to_value((*self_ptr)->virtual_interface->virtual_for);
else
return Qnil;
@@ -412,14 +426,14 @@ namespace
* call-seq:
* is_bundle? -> true or false
*
- * Are we a bundle? True or false, if get_virtual_interface is not Nil.
+ * Are we a bundle? True or false, if virtual_interface is not Nil.
*/
VALUE version_metadata_is_bundle(VALUE self)
{
VersionMetadata::ConstPointer * self_ptr;
Data_Get_Struct(self, VersionMetadata::ConstPointer, self_ptr);
- if ((*self_ptr)->get_cran_interface())
- return ((*self_ptr)->get_cran_interface()->is_bundle) ? Qtrue : Qfalse;
+ if ((*self_ptr)->cran_interface)
+ return ((*self_ptr)->cran_interface->is_bundle) ? Qtrue : Qfalse;
else
return Qnil;
@@ -429,16 +443,16 @@ namespace
* call-seq:
* keywords -> String
*
- * Fetches the package keywords, if get_ebuild_interface or get_cran_interface is not Nil.
+ * Fetches the package keywords, if ebuild_interface or cran_interface is not Nil.
*/
VALUE version_metadata_keywords(VALUE self)
{
VersionMetadata::ConstPointer * self_ptr;
Data_Get_Struct(self, VersionMetadata::ConstPointer, self_ptr);
- if ((*self_ptr)->get_ebuild_interface())
- return rb_str_new2(((*self_ptr)->get_ebuild_interface()->keywords).c_str());
- if ((*self_ptr)->get_cran_interface())
- return rb_str_new2(((*self_ptr)->get_cran_interface()->keywords).c_str());
+ if ((*self_ptr)->ebuild_interface)
+ return rb_str_new2(((*self_ptr)->ebuild_interface->keywords).c_str());
+ if ((*self_ptr)->cran_interface)
+ return rb_str_new2(((*self_ptr)->cran_interface->keywords).c_str());
else
return Qnil;
}
@@ -452,68 +466,64 @@ namespace
*/
c_version_metadata = rb_define_class_under(paludis_module(), "VersionMetadata", rb_cObject);
rb_funcall(c_version_metadata, rb_intern("private_class_method"), 1, rb_str_new2("new"));
- rb_define_method(c_version_metadata, "get_ebuild_interface", RUBY_FUNC_CAST(&version_metadata_get_ebuild_interface), 0);
- rb_define_method(c_version_metadata, "get_virtual_interface", RUBY_FUNC_CAST(&version_metadata_get_virtual_interface), 0);
- rb_define_method(c_version_metadata, "get_ebin_interface", RUBY_FUNC_CAST(&version_metadata_get_ebin_interface), 0);
- rb_define_method(c_version_metadata, "get_cran_interface", RUBY_FUNC_CAST(&version_metadata_get_cran_interface), 0);
+ rb_define_method(c_version_metadata, "ebuild_interface", RUBY_FUNC_CAST(&version_metadata_ebuild_interface), 0);
+ rb_define_method(c_version_metadata, "virtual_interface", RUBY_FUNC_CAST(&version_metadata_virtual_interface), 0);
+ rb_define_method(c_version_metadata, "cran_interface", RUBY_FUNC_CAST(&version_metadata_cran_interface), 0);
+ rb_define_method(c_version_metadata, "license_interface", RUBY_FUNC_CAST(&version_metadata_license_interface), 0);
+ rb_define_method(c_version_metadata, "deps_interface", RUBY_FUNC_CAST(&version_metadata_deps_interface), 0);
+ rb_define_method(c_version_metadata, "origins_interface", RUBY_FUNC_CAST(&version_metadata_origins_interface), 0);
rb_define_method(c_version_metadata, "license", RUBY_FUNC_CAST(&version_metadata_license), 0);
+ rb_define_method(c_version_metadata, "license_string", RUBY_FUNC_CAST(&version_metadata_license_string), 0);
rb_define_method(c_version_metadata, "slot", RUBY_FUNC_CAST((&BaseValue<SlotName, &VersionMetadataBase::slot>::fetch)), 0);
- rb_define_method(c_version_metadata, "license_string", RUBY_FUNC_CAST((&BaseValue<std::string,
- &VersionMetadataBase::license_string>::fetch)), 0);
rb_define_method(c_version_metadata, "eapi", RUBY_FUNC_CAST((&BaseValue<std::string, &VersionMetadataBase::eapi>::fetch)), 0);
rb_define_method(c_version_metadata, "homepage", RUBY_FUNC_CAST((&BaseValue<std::string, &VersionMetadataBase::homepage>::fetch)), 0);
rb_define_method(c_version_metadata, "description", RUBY_FUNC_CAST((&BaseValue<std::string,
&VersionMetadataBase::description>::fetch)), 0);
rb_define_method(c_version_metadata, "provide_string", RUBY_FUNC_CAST((&EbuildValue<std::string,
- &EbuildVersionMetadata::provide_string>::fetch)), 0);
+ &VersionMetadataEbuildInterface::provide_string>::fetch)), 0);
rb_define_method(c_version_metadata, "src_uri", RUBY_FUNC_CAST((&EbuildValue<std::string,
- &EbuildVersionMetadata::src_uri>::fetch)), 0);
+ &VersionMetadataEbuildInterface::src_uri>::fetch)), 0);
rb_define_method(c_version_metadata, "restrict_string", RUBY_FUNC_CAST((&EbuildValue<std::string,
- &EbuildVersionMetadata::restrict_string>::fetch)), 0);
+ &VersionMetadataEbuildInterface::restrict_string>::fetch)), 0);
rb_define_method(c_version_metadata, "eclass_keywords", RUBY_FUNC_CAST((&EbuildValue<std::string,
- &EbuildVersionMetadata::eclass_keywords>::fetch)), 0);
+ &VersionMetadataEbuildInterface::eclass_keywords>::fetch)), 0);
rb_define_method(c_version_metadata, "iuse", RUBY_FUNC_CAST((&EbuildValue<std::string,
- &EbuildVersionMetadata::iuse>::fetch)), 0);
+ &VersionMetadataEbuildInterface::iuse>::fetch)), 0);
rb_define_method(c_version_metadata, "inherited", RUBY_FUNC_CAST((&EbuildValue<std::string,
- &EbuildVersionMetadata::inherited>::fetch)), 0);
+ &VersionMetadataEbuildInterface::inherited>::fetch)), 0);
rb_define_method(c_version_metadata, "build_depend", RUBY_FUNC_CAST((&DependValue<
- &VersionMetadataDeps::build_depend>::fetch)), 0);
+ &VersionMetadataDepsInterface::build_depend>::fetch)), 0);
rb_define_method(c_version_metadata, "run_depend", RUBY_FUNC_CAST((&DependValue<
- &VersionMetadataDeps::run_depend>::fetch)), 0);
+ &VersionMetadataDepsInterface::run_depend>::fetch)), 0);
rb_define_method(c_version_metadata, "suggested_depend", RUBY_FUNC_CAST((&DependValue<
- &VersionMetadataDeps::suggested_depend>::fetch)), 0);
+ &VersionMetadataDepsInterface::suggested_depend>::fetch)), 0);
rb_define_method(c_version_metadata, "post_depend", RUBY_FUNC_CAST((&DependValue<
- &VersionMetadataDeps::post_depend>::fetch)), 0);
+ &VersionMetadataDepsInterface::post_depend>::fetch)), 0);
rb_define_method(c_version_metadata, "build_depend_string", RUBY_FUNC_CAST((&DependValueString<
- &VersionMetadataDeps::build_depend_string>::fetch)), 0);
+ &VersionMetadataDepsInterface::build_depend_string>::fetch)), 0);
rb_define_method(c_version_metadata, "run_depend_string", RUBY_FUNC_CAST((&DependValueString<
- &VersionMetadataDeps::run_depend_string>::fetch)), 0);
+ &VersionMetadataDepsInterface::run_depend_string>::fetch)), 0);
rb_define_method(c_version_metadata, "suggested_depend_string", RUBY_FUNC_CAST((&DependValueString<
- &VersionMetadataDeps::suggested_depend_string>::fetch)), 0);
+ &VersionMetadataDepsInterface::suggested_depend_string>::fetch)), 0);
rb_define_method(c_version_metadata, "post_depend_string", RUBY_FUNC_CAST((&DependValueString<
- &VersionMetadataDeps::post_depend_string>::fetch)), 0);
+ &VersionMetadataDepsInterface::post_depend_string>::fetch)), 0);
rb_define_method(c_version_metadata, "origin_source", RUBY_FUNC_CAST((&VMOrigins<
- &VersionMetadataOrigins::source>::fetch)), 0);
+ &VersionMetadataOriginsInterface::source>::fetch)), 0);
rb_define_method(c_version_metadata, "origin_binary", RUBY_FUNC_CAST((&VMOrigins<
- &VersionMetadataOrigins::binary>::fetch)), 0);
+ &VersionMetadataOriginsInterface::binary>::fetch)), 0);
rb_define_method(c_version_metadata, "virtual_for", RUBY_FUNC_CAST(&version_metadata_virtual_for), 0);
- rb_define_method(c_version_metadata, "bin_uri", RUBY_FUNC_CAST((&EbinValue<std::string,
- &EbinVersionMetadata::bin_uri>::fetch)), 0);
- rb_define_method(c_version_metadata, "src_repository", RUBY_FUNC_CAST((&EbinValue<RepositoryName,
- &EbinVersionMetadata::src_repository>::fetch)), 0);
-
rb_define_method(c_version_metadata, "package", RUBY_FUNC_CAST((&CRANValue<std::string,
- &CRANVersionMetadata::package>::fetch)), 0);
+ &VersionMetadataCRANInterface::package>::fetch)), 0);
rb_define_method(c_version_metadata, "version", RUBY_FUNC_CAST((&CRANValue<std::string,
- &CRANVersionMetadata::version>::fetch)), 0);
+ &VersionMetadataCRANInterface::version>::fetch)), 0);
rb_define_method(c_version_metadata, "is_bundle?", RUBY_FUNC_CAST(&version_metadata_is_bundle), 0);
rb_define_method(c_version_metadata, "keywords", RUBY_FUNC_CAST(&version_metadata_keywords), 0);
diff --git a/ruby/version_metadata_TEST.rb b/ruby/version_metadata_TEST.rb
index bfa6a1f..26e3ba0 100644
--- a/ruby/version_metadata_TEST.rb
+++ b/ruby/version_metadata_TEST.rb
@@ -58,10 +58,9 @@ module Paludis
end
def test_interfaces
- assert vmd("1.0").get_ebuild_interface
- assert ! vmd("1.0").get_ebin_interface
- assert ! vmd("1.0").get_cran_interface
- assert ! vmd("1.0").get_virtual_interface
+ assert vmd("1.0").ebuild_interface
+ assert ! vmd("1.0").cran_interface
+ assert ! vmd("1.0").virtual_interface
end
def test_members
diff --git a/src/clients/adjutrix/find_dropped_keywords.cc b/src/clients/adjutrix/find_dropped_keywords.cc
index 217308c..85eb57b 100644
--- a/src/clients/adjutrix/find_dropped_keywords.cc
+++ b/src/clients/adjutrix/find_dropped_keywords.cc
@@ -117,11 +117,11 @@ namespace
v != v_end ; ++v)
{
VersionMetadata::ConstPointer metadata(repo.version_metadata(package, *v));
- if (! metadata->get_ebuild_interface())
+ if (! metadata->ebuild_interface)
continue;
std::set<KeywordName> keywords;
- WhitespaceTokeniser::get_instance()->tokenise(metadata->get_ebuild_interface()->keywords,
+ WhitespaceTokeniser::get_instance()->tokenise(metadata->ebuild_interface->keywords,
create_inserter<KeywordName>(std::inserter(keywords, keywords.end())));
/* ensure that there's an entry for this SLOT */
diff --git a/src/clients/adjutrix/find_reverse_deps.cc b/src/clients/adjutrix/find_reverse_deps.cc
index 2b7d3f6..817067c 100644
--- a/src/clients/adjutrix/find_reverse_deps.cc
+++ b/src/clients/adjutrix/find_reverse_deps.cc
@@ -189,9 +189,13 @@ namespace
ReverseDepChecker checker(env.package_database(), PackageDatabaseEntryCollection::ConstPointer(&entries),
stringify(p) + "-" + stringify(e->version));
- checker.check(metadata->deps.parser(metadata->deps.build_depend_string), std::string("DEPEND"));
- checker.check(metadata->deps.parser(metadata->deps.run_depend_string), std::string("RDEPEND"));
- checker.check(metadata->deps.parser(metadata->deps.post_depend_string), std::string("PDEPEND"));
+ if (metadata->deps_interface)
+ {
+ checker.check(metadata->deps_interface->build_depend(), std::string("DEPEND"));
+ checker.check(metadata->deps_interface->run_depend(), std::string("RDEPEND"));
+ checker.check(metadata->deps_interface->post_depend(), std::string("PDEPEND"));
+ checker.check(metadata->deps_interface->suggested_depend(), std::string("SDEPEND"));
+ }
found_matches |= checker.found_matches();
}
diff --git a/src/clients/adjutrix/find_stable_candidates.cc b/src/clients/adjutrix/find_stable_candidates.cc
index 319d065..dc34812 100644
--- a/src/clients/adjutrix/find_stable_candidates.cc
+++ b/src/clients/adjutrix/find_stable_candidates.cc
@@ -116,11 +116,11 @@ namespace
v != v_end ; ++v)
{
VersionMetadata::ConstPointer metadata(repo.version_metadata(package, *v));
- if (! metadata->get_ebuild_interface())
+ if (! metadata->ebuild_interface)
continue;
std::set<KeywordName> keywords;
- WhitespaceTokeniser::get_instance()->tokenise(metadata->get_ebuild_interface()->keywords,
+ WhitespaceTokeniser::get_instance()->tokenise(metadata->ebuild_interface->keywords,
create_inserter<KeywordName>(std::inserter(keywords, keywords.end())));
if (keywords.end() != keywords.find(keyword))
diff --git a/src/clients/adjutrix/keywords_graph.cc b/src/clients/adjutrix/keywords_graph.cc
index 34dce08..daa5ec1 100644
--- a/src/clients/adjutrix/keywords_graph.cc
+++ b/src/clients/adjutrix/keywords_graph.cc
@@ -125,7 +125,7 @@ namespace
p != p_end ; ++p)
{
VersionMetadata::ConstPointer metadata(repo.version_metadata(package, p->version));
- if (! metadata->get_ebuild_interface())
+ if (! metadata->ebuild_interface)
continue;
if (metadata->slot != old_slot)
@@ -137,7 +137,7 @@ namespace
cout << std::left << std::setw(version_specs_columns_width) << p->version << "| ";
std::set<KeywordName> keywords;
- WhitespaceTokeniser::get_instance()->tokenise(metadata->get_ebuild_interface()->keywords,
+ WhitespaceTokeniser::get_instance()->tokenise(metadata->ebuild_interface->keywords,
create_inserter<KeywordName>(std::inserter(keywords, keywords.end())));
for (UseFlagNameCollection::Iterator a(arch_flags->begin()), a_end(arch_flags->end()) ;
diff --git a/src/clients/adjutrix/what_needs_keywording.cc b/src/clients/adjutrix/what_needs_keywording.cc
index 0598ba8..78d8286 100644
--- a/src/clients/adjutrix/what_needs_keywording.cc
+++ b/src/clients/adjutrix/what_needs_keywording.cc
@@ -86,10 +86,10 @@ int do_what_needs_keywording(NoConfigEnvironment & env)
VersionMetadata::ConstPointer m(env.package_database()->fetch_repository(
p->package.repository)->version_metadata(p->package.name,
p->package.version));
- if (m->get_ebuild_interface())
+ if (m->ebuild_interface)
{
std::set<std::string> keywords;
- WhitespaceTokeniser::get_instance()->tokenise(m->get_ebuild_interface()->keywords,
+ WhitespaceTokeniser::get_instance()->tokenise(m->ebuild_interface->keywords,
std::inserter(keywords, keywords.end()));
for (std::set<std::string>::const_iterator k(keywords.begin()), k_end(keywords.end()) ;
k != k_end ; ++k)
diff --git a/src/clients/contrarius/install.cc b/src/clients/contrarius/install.cc
index 03b7a65..f8e2ba1 100644
--- a/src/clients/contrarius/install.cc
+++ b/src/clients/contrarius/install.cc
@@ -310,13 +310,18 @@ do_install(PackageDepAtom::ConstPointer atom)
}
else if (mr_license == mm)
{
- cerr << " ";
+ VersionMetadata::ConstPointer meta(DefaultEnvironment::get_instance()->
+ package_database()->fetch_repository(
+ pp->repository)->version_metadata(
+ pp->name, pp->version));
- LicenceDisplayer ld(cerr, DefaultEnvironment::get_instance(), &*pp);
- DefaultEnvironment::get_instance()->package_database()->fetch_repository(
- pp->repository)->version_metadata(
- pp->name, pp->version)->license()->
- accept(&ld);
+ if (meta->license_interface)
+ {
+ cerr << " ";
+
+ LicenceDisplayer ld(cerr, DefaultEnvironment::get_instance(), &*pp);
+ meta->license_interface->license()->accept(&ld);
+ }
}
else if (mr_keyword == mm)
{
@@ -324,11 +329,11 @@ do_install(PackageDepAtom::ConstPointer atom)
package_database()->fetch_repository(
pp->repository)->version_metadata(
pp->name, pp->version));
- if (meta->get_ebuild_interface())
+ if (meta->ebuild_interface)
{
std::set<KeywordName> keywords;
WhitespaceTokeniser::get_instance()->tokenise(
- meta->get_ebuild_interface()->keywords,
+ meta->ebuild_interface->keywords,
create_inserter<KeywordName>(
std::inserter(keywords, keywords.end())));
diff --git a/src/clients/gtkpaludis/queue_list.cc b/src/clients/gtkpaludis/queue_list.cc
index 768dc98..b2ba27c 100644
--- a/src/clients/gtkpaludis/queue_list.cc
+++ b/src/clients/gtkpaludis/queue_list.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -83,7 +83,7 @@ namespace
static const std::string cl_flag_on("#00cc00");
static const std::string cl_flag_off("#cc0000");
- if (metadata->get_ebuild_interface())
+ if (metadata->ebuild_interface)
{
std::string use_expand_string;
UseFlagName expand_name("OFTEN_NOT_BEEN_ON_BOATS"), expand_value("MONKEY");
@@ -93,7 +93,7 @@ namespace
fetch_repository(p.repository)->use_interface);
std::set<UseFlagName> iuse;
WhitespaceTokeniser::get_instance()->tokenise(
- metadata->get_ebuild_interface()->iuse,
+ metadata->ebuild_interface->iuse,
create_inserter<UseFlagName>(std::inserter(iuse, iuse.end())));
/* display normal use flags first */
diff --git a/src/clients/paludis/applets.cc b/src/clients/paludis/applets.cc
index 2972cd0..da2a78c 100644
--- a/src/clients/paludis/applets.cc
+++ b/src/clients/paludis/applets.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -77,16 +77,16 @@ int do_best_version()
VersionMetadata::ConstPointer metadata(env->package_database()->fetch_repository(
entries->last()->repository)->version_metadata(entries->last()->name,
entries->last()->version));
- if (! metadata->get_virtual_interface())
+ if (! metadata->virtual_interface)
break;
Log::get_instance()->message(ll_qa, lc_context, "best-version of '" + query +
"' resolves to '" + stringify(*entries->last()) + "', which is a virtual for '"
- + stringify(metadata->get_virtual_interface()->virtual_for) + "'. This will break with "
+ + stringify(metadata->virtual_interface->virtual_for) + "'. This will break with "
"new style virtuals.");
PackageDatabaseEntryCollection::Pointer new_entries(
new PackageDatabaseEntryCollection::Concrete);
- new_entries->push_back(metadata->get_virtual_interface()->virtual_for);
+ new_entries->push_back(metadata->virtual_interface->virtual_for);
entries = new_entries;
}
diff --git a/src/clients/paludis/install.cc b/src/clients/paludis/install.cc
index d6d94f9..82ec91b 100644
--- a/src/clients/paludis/install.cc
+++ b/src/clients/paludis/install.cc
@@ -582,13 +582,18 @@ do_install()
}
else if (mr_license == mm)
{
- cerr << " ";
+ VersionMetadata::ConstPointer meta(DefaultEnvironment::get_instance()->
+ package_database()->fetch_repository(
+ pp->repository)->version_metadata(
+ pp->name, pp->version));
- LicenceDisplayer ld(cerr, DefaultEnvironment::get_instance(), &*pp);
- DefaultEnvironment::get_instance()->package_database()->fetch_repository(
- pp->repository)->version_metadata(
- pp->name, pp->version)->license()->
- accept(&ld);
+ if (meta->license_interface)
+ {
+ cerr << " ";
+
+ LicenceDisplayer ld(cerr, DefaultEnvironment::get_instance(), &*pp);
+ meta->license_interface->license()->accept(&ld);
+ }
}
else if (mr_keyword == mm)
{
@@ -596,11 +601,11 @@ do_install()
package_database()->fetch_repository(
pp->repository)->version_metadata(
pp->name, pp->version));
- if (meta->get_ebuild_interface())
+ if (meta->ebuild_interface)
{
std::set<KeywordName> keywords;
WhitespaceTokeniser::get_instance()->tokenise(
- meta->get_ebuild_interface()->keywords,
+ meta->ebuild_interface->keywords,
create_inserter<KeywordName>(
std::inserter(keywords, keywords.end())));
diff --git a/src/clients/paludis/query.cc b/src/clients/paludis/query.cc
index f3cff4a..7db8ed0 100644
--- a/src/clients/paludis/query.cc
+++ b/src/clients/paludis/query.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -171,60 +171,58 @@ void do_one_package_query(
" " << metadata->description << endl;
cout << " " << std::setw(22) << std::left << "HOMEPAGE:" << std::setw(0) <<
" " << metadata->homepage << endl;
- cout << " " << std::setw(22) << std::left << "LICENSE:" << std::setw(0) <<
- " " << metadata->license_string << endl;
-
- cout << " " << std::setw(22) << std::left << "DEPEND:" << std::setw(0) <<
- " " << metadata->deps.build_depend_string << endl;
- cout << " " << std::setw(22) << std::left << "RDEPEND:" << std::setw(0) <<
- " " << metadata->deps.run_depend_string << endl;
- cout << " " << std::setw(22) << std::left << "PDEPEND:" << std::setw(0) <<
- " " << metadata->deps.post_depend_string << endl;
- cout << " " << std::setw(22) << std::left << "SDEPEND:" << std::setw(0) <<
- " " << metadata->deps.suggested_depend_string << endl;
-
- if (metadata->get_cran_interface())
+
+ if (metadata->license_interface)
+ cout << " " << std::setw(22) << std::left << "LICENSE:" << std::setw(0) <<
+ " " << metadata->license_interface->license_string << endl;
+
+ if (metadata->deps_interface)
+ {
+ cout << " " << std::setw(22) << std::left << "DEPEND:" << std::setw(0) <<
+ " " << metadata->deps_interface->build_depend_string << endl;
+ cout << " " << std::setw(22) << std::left << "RDEPEND:" << std::setw(0) <<
+ " " << metadata->deps_interface->run_depend_string << endl;
+ cout << " " << std::setw(22) << std::left << "PDEPEND:" << std::setw(0) <<
+ " " << metadata->deps_interface->post_depend_string << endl;
+ cout << " " << std::setw(22) << std::left << "SDEPEND:" << std::setw(0) <<
+ " " << metadata->deps_interface->suggested_depend_string << endl;
+ }
+
+ if (metadata->cran_interface)
{
cout << " " << std::setw(22) << std::left << "KEYWORDS:" << std::setw(0) <<
- " " << metadata->get_cran_interface()->keywords << endl;
+ " " << metadata->cran_interface->keywords << endl;
cout << " " << std::setw(22) << std::left << "PACKAGE:" << std::setw(0) <<
- " " << metadata->get_cran_interface()->package << endl;
+ " " << metadata->cran_interface->package << endl;
cout << " " << std::setw(22) << std::left << "VERSION:" << std::setw(0) <<
- " " << metadata->get_cran_interface()->version << endl;
+ " " << metadata->cran_interface->version << endl;
cout << " " << std::setw(22) << std::left << "IS_BUNDLE:" << std::setw(0) <<
- " " << std::boolalpha << metadata->get_cran_interface()->is_bundle << endl;
+ " " << std::boolalpha << metadata->cran_interface->is_bundle << endl;
cout << " " << std::setw(22) << std::left << "IS_BUNDLE_MEMBER:" << std::setw(0) <<
- " " << std::boolalpha << metadata->get_cran_interface()->is_bundle_member << endl;
+ " " << std::boolalpha << metadata->cran_interface->is_bundle_member << endl;
}
- if (metadata->get_ebuild_interface())
+ if (metadata->ebuild_interface)
{
cout << " " << std::setw(22) << std::left << "IUSE:" << std::setw(0) <<
- " " << metadata->get_ebuild_interface()->iuse << endl;
+ " " << metadata->ebuild_interface->iuse << endl;
cout << " " << std::setw(22) << std::left << "KEYWORDS:" << std::setw(0) <<
- " " << metadata->get_ebuild_interface()->keywords << endl;
+ " " << metadata->ebuild_interface->keywords << endl;
cout << " " << std::setw(22) << std::left << "PROVIDE:" << std::setw(0) <<
- " " << metadata->get_ebuild_interface()->provide_string << endl;
+ " " << metadata->ebuild_interface->provide_string << endl;
cout << " " << std::setw(22) << std::left << "RESTRICT:" << std::setw(0) <<
- " " << metadata->get_ebuild_interface()->restrict_string << endl;
+ " " << metadata->ebuild_interface->restrict_string << endl;
cout << " " << std::setw(22) << std::left << "SRC_URI:" << std::setw(0) <<
- " " << metadata->get_ebuild_interface()->src_uri << endl;
+ " " << metadata->ebuild_interface->src_uri << endl;
}
- if (metadata->get_ebin_interface())
- {
- cout << " " << std::setw(22) << std::left << "BIN_URI:" << std::setw(0) <<
- " " << metadata->get_ebin_interface()->bin_uri << endl;
- cout << " " << std::setw(22) << std::left << "SRC_REPOSITORY:" << std::setw(0) <<
- " " << metadata->get_ebin_interface()->src_repository << endl;
- }
-
- if (metadata->origins.source)
+ if (metadata->origins_interface && metadata->origins_interface->source)
cout << " " << std::setw(22) << std::left << "SOURCE_ORIGIN:" << std::setw(0)
- << " " << *metadata->origins.source << endl;
- if (metadata->origins.binary)
+ << " " << *metadata->origins_interface->source << endl;
+ if (metadata->origins_interface && metadata->origins_interface->binary)
cout << " " << std::setw(22) << std::left << "BINARY_ORIGIN::" << std::setw(0)
- << " " << *metadata->origins.binary << endl;
+ << " " << *metadata->origins_interface->binary << endl;
+
if (0 != env->package_database()->fetch_repository(display_entry.repository)->installed_interface)
{
time_t t(env->package_database()->fetch_repository(display_entry.repository
@@ -244,55 +242,56 @@ void do_one_package_query(
cout << " " << std::setw(22) << std::left << "Description:" << std::setw(0) <<
" " << metadata->description << endl;
- if (! metadata->license_string.empty())
+ if (metadata->license_interface && ! metadata->license_interface->license_string.empty())
{
cout << " " << std::setw(22) << std::left << "License:" << std::setw(0) << " ";
LicenceDisplayer d(cout, env, &display_entry);
- metadata->license()->accept(&d);
+ metadata->license_interface->license()->accept(&d);
cout << endl;
}
- if (CommandLine::get_instance()->a_show_deps.specified())
+ if (CommandLine::get_instance()->a_show_deps.specified() && metadata->deps_interface)
{
- if (! metadata->deps.build_depend_string.empty())
+ if (! metadata->deps_interface->build_depend_string.empty())
{
DepAtomPrettyPrinter p_depend(12);
- metadata->deps.build_depend()->accept(&p_depend);
+ metadata->deps_interface->build_depend()->accept(&p_depend);
cout << " " << std::setw(22) << std::left << "Build dependencies:" << std::setw(0)
<< endl << p_depend;
}
- if (! metadata->deps.run_depend_string.empty())
+ if (! metadata->deps_interface->run_depend_string.empty())
{
DepAtomPrettyPrinter p_depend(12);
- metadata->deps.run_depend()->accept(&p_depend);
+ metadata->deps_interface->run_depend()->accept(&p_depend);
cout << " " << std::setw(22) << std::left << "Runtime dependencies:" << std::setw(0)
<< endl << p_depend;
}
- if (! metadata->deps.post_depend_string.empty())
+ if (! metadata->deps_interface->post_depend_string.empty())
{
DepAtomPrettyPrinter p_depend(12);
- metadata->deps.post_depend()->accept(&p_depend);
+ metadata->deps_interface->post_depend()->accept(&p_depend);
cout << " " << std::setw(22) << std::left << "Post dependencies:" << std::setw(0)
<< endl << p_depend;
}
- if (! metadata->deps.suggested_depend_string.empty())
+ if (! metadata->deps_interface->suggested_depend_string.empty())
{
DepAtomPrettyPrinter s_depend(12);
- metadata->deps.suggested_depend()->accept(&s_depend);
+ metadata->deps_interface->suggested_depend()->accept(&s_depend);
cout << " " << std::setw(22) << std::left << "Suggested dependencies:" << std::setw(0)
<< endl << s_depend;
}
}
- if (metadata->origins.source)
+ if (metadata->origins_interface && metadata->origins_interface->source)
cout << " " << std::setw(22) << std::left << "Source origin:" << std::setw(0)
- << " " << colour(cl_package_name, *metadata->origins.source) << endl;
- if (metadata->origins.binary)
+ << " " << colour(cl_package_name, *metadata->origins_interface->source) << endl;
+ if (metadata->origins_interface && metadata->origins_interface->binary)
cout << " " << std::setw(22) << std::left << "Binary origin:" << std::setw(0)
- << " " << colour(cl_package_name, *metadata->origins.binary) << endl;
+ << " " << colour(cl_package_name, *metadata->origins_interface->binary) << endl;
+
if (0 != env->package_database()->fetch_repository(display_entry.repository)->installed_interface)
{
time_t t(env->package_database()->fetch_repository(display_entry.repository
@@ -306,13 +305,13 @@ void do_one_package_query(
}
}
- if (metadata->get_ebuild_interface())
+ if (metadata->ebuild_interface)
{
- if (! metadata->get_ebuild_interface()->provide_string.empty())
+ if (! metadata->ebuild_interface->provide_string.empty())
cout << " " << std::setw(22) << std::left << "Provides:" << std::setw(0) <<
- " " << metadata->get_ebuild_interface()->provide_string << endl;
+ " " << metadata->ebuild_interface->provide_string << endl;
- if (! metadata->get_ebuild_interface()->iuse.empty())
+ if (! metadata->ebuild_interface->iuse.empty())
{
cout << " " << std::setw(22) << std::left << "Use flags:" << std::setw(0) << " ";
UseFlagPrettyPrinter printer(DefaultEnvironment::get_instance());
@@ -321,9 +320,9 @@ void do_one_package_query(
}
}
- if (metadata->get_virtual_interface())
+ if (metadata->virtual_interface)
cout << " " << std::setw(22) << std::left << "Virtual for:" << std::setw(0) <<
- " " << metadata->get_virtual_interface()->virtual_for << endl;
+ " " << metadata->virtual_interface->virtual_for << endl;
}
diff --git a/src/output/console_install_task.cc b/src/output/console_install_task.cc
index 5849b2c..d7bcfb0 100644
--- a/src/output/console_install_task.cc
+++ b/src/output/console_install_task.cc
@@ -1129,20 +1129,25 @@ ConsoleInstallTask::display_merge_list_entry_mask_reasons(const DepListEntry & e
}
else if (mr_license == mm)
{
- output_no_endl(" ");
+ VersionMetadata::ConstPointer metadata(environment()->package_database()->fetch_repository(
+ e.package.repository)->version_metadata(e.package.name, e.package.version));
+
+ if (metadata->license_interface)
+ {
+ output_no_endl(" ");
- LicenceDisplayer ld(output_stream(), environment(), &e.package);
- environment()->package_database()->fetch_repository(
- e.package.repository)->version_metadata(e.package.name, e.package.version)->license()->accept(&ld);
+ LicenceDisplayer ld(output_stream(), environment(), &e.package);
+ metadata->license_interface->license()->accept(&ld);
+ }
}
else if (mr_keyword == mm)
{
VersionMetadata::ConstPointer meta(environment()->package_database()->fetch_repository(
e.package.repository)->version_metadata(e.package.name, e.package.version));
- if (meta->get_ebuild_interface())
+ if (meta->ebuild_interface)
{
std::set<KeywordName> keywords;
- WhitespaceTokeniser::get_instance()->tokenise(meta->get_ebuild_interface()->keywords,
+ WhitespaceTokeniser::get_instance()->tokenise(meta->ebuild_interface->keywords,
create_inserter<KeywordName>(std::inserter(keywords, keywords.end())));
output_no_endl(" ( " + render_as_masked(join(keywords.begin(), keywords.end(), " ")) + " )");
diff --git a/src/output/use_flag_pretty_printer.cc b/src/output/use_flag_pretty_printer.cc
index eef2082..7fa3658 100644
--- a/src/output/use_flag_pretty_printer.cc
+++ b/src/output/use_flag_pretty_printer.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -61,18 +61,18 @@ UseFlagPrettyPrinter::print_package_flags(const PackageDatabaseEntry & pkg,
VersionMetadata::ConstPointer metadata(environment()->package_database()->
fetch_repository(pkg.repository)->version_metadata(pkg.name, pkg.version));
- if (! metadata->get_ebuild_interface())
+ if (! metadata->ebuild_interface)
return;
- WhitespaceTokeniser::get_instance()->tokenise(metadata->get_ebuild_interface()->iuse,
+ WhitespaceTokeniser::get_instance()->tokenise(metadata->ebuild_interface->iuse,
create_inserter<UseFlagName>(std::inserter(iuse, iuse.begin())));
if (old_pkg)
{
VersionMetadata::ConstPointer old_metadata(environment()->package_database()->
fetch_repository(old_pkg->repository)->version_metadata(old_pkg->name, old_pkg->version));
- if (old_metadata->get_ebuild_interface())
- WhitespaceTokeniser::get_instance()->tokenise(old_metadata->get_ebuild_interface()->iuse,
+ if (old_metadata->ebuild_interface)
+ WhitespaceTokeniser::get_instance()->tokenise(old_metadata->ebuild_interface->iuse,
create_inserter<UseFlagName>(std::inserter(old_iuse, old_iuse.begin())));
}