aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-05-19 14:20:48 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-05-19 20:52:24 +0100
commite52571861104efe6139b78b22557211f08025f11 (patch)
tree634bec98491886d12f8f5a25b24f4cacf8d69de5 /doc
parent80bf4ad14bfd8ab74a9c0d5f203ad5a370351def (diff)
downloadpaludis-e52571861104efe6139b78b22557211f08025f11.tar.gz
paludis-e52571861104efe6139b78b22557211f08025f11.tar.xz
Revert the package dep spec changes
Diffstat (limited to 'doc')
-rw-r--r--doc/api/cplusplus/examples/example_dep_spec.cc86
-rw-r--r--doc/api/cplusplus/examples/example_match_package.cc2
-rw-r--r--doc/api/cplusplus/examples/example_selection.cc8
-rw-r--r--doc/configuration/specs.html.part11
4 files changed, 76 insertions, 31 deletions
diff --git a/doc/api/cplusplus/examples/example_dep_spec.cc b/doc/api/cplusplus/examples/example_dep_spec.cc
index 3a2cc5476..081b201ed 100644
--- a/doc/api/cplusplus/examples/example_dep_spec.cc
+++ b/doc/api/cplusplus/examples/example_dep_spec.cc
@@ -59,39 +59,85 @@ int main(int argc, char * argv[])
/* Display information about the PackageDepSpec. */
cout << "Information about '" << spec << "':" << endl;
- if (spec.package_name_requirement())
- cout << " " << left << setw(24) << "Package:" << " " << spec.package_name_requirement()->name() << endl;
+ if (spec.package_ptr())
+ cout << " " << left << setw(24) << "Package:" << " " << *spec.package_ptr() << endl;
- if (spec.category_name_part_requirement())
- cout << " " << left << setw(24) << "Category part:" << " " << spec.category_name_part_requirement()->name_part() << endl;
+ if (spec.category_name_part_ptr())
+ cout << " " << left << setw(24) << "Category part:" << " " << *spec.category_name_part_ptr() << endl;
- if (spec.package_name_part_requirement())
- cout << " " << left << setw(24) << "Package part:" << " " << spec.package_name_part_requirement()->name_part() << endl;
+ if (spec.package_name_part_ptr())
+ cout << " " << left << setw(24) << "Package part:" << " " << *spec.package_name_part_ptr() << endl;
- if (spec.exact_slot_requirement())
- cout << " " << left << setw(24) << "Slot:" << " " << spec.exact_slot_requirement()->name() << endl;
+ if (spec.version_requirements_ptr() && ! spec.version_requirements_ptr()->empty())
+ {
+ cout << " " << left << setw(24) << "Version requirements:" << " ";
+ bool need_join(false);
+ for (VersionRequirements::ConstIterator r(spec.version_requirements_ptr()->begin()),
+ r_end(spec.version_requirements_ptr()->end()) ; r != r_end ; ++r)
+ {
+ if (need_join)
+ {
+ switch (spec.version_requirements_mode())
+ {
+ case vr_and:
+ cout << " and ";
+ break;
+
+ case vr_or:
+ cout << " or ";
+ break;
+
+ case last_vr:
+ throw InternalError(PALUDIS_HERE, "Bad version_requirements_mode");
+ }
+ }
+
+ cout << r->version_operator() << r->version_spec();
+ need_join = true;
+ }
+ cout << endl;
+ }
+
+ if (spec.slot_requirement_ptr())
+ cout << " " << left << setw(24) << "Slot:" << " " << *spec.slot_requirement_ptr() << endl;
- if (spec.in_repository_requirement())
+ if (spec.in_repository_ptr())
cout << " " << left << setw(24) << "In repository:" << " " <<
- spec.in_repository_requirement()->name() << endl;
+ *spec.in_repository_ptr() << endl;
- if (spec.from_repository_requirement())
+ if (spec.from_repository_ptr())
cout << " " << left << setw(24) << "From repository:" << " " <<
- spec.from_repository_requirement()->name() << endl;
+ *spec.from_repository_ptr() << endl;
- if (spec.installed_at_path_requirement())
+ if (spec.installed_at_path_ptr())
cout << " " << left << setw(24) << "Installed at path:" << " " <<
- spec.installed_at_path_requirement()->path() << endl;
+ *spec.installed_at_path_ptr() << endl;
- if (spec.installable_to_path_requirement())
+ if (spec.installable_to_path_ptr())
cout << " " << left << setw(24) << "Installable to path:" << " " <<
- spec.installable_to_path_requirement()->path() << ", " <<
- spec.installable_to_path_requirement()->include_masked() << endl;
+ spec.installable_to_path_ptr()->path() << ", " <<
+ spec.installable_to_path_ptr()->include_masked() << endl;
- if (spec.installable_to_repository_requirement())
+ if (spec.installable_to_repository_ptr())
cout << " " << left << setw(24) << "Installable to repository:" << " " <<
- spec.installable_to_repository_requirement()->name() << ", " <<
- spec.installable_to_repository_requirement()->include_masked() << endl;
+ spec.installable_to_repository_ptr()->repository() << ", " <<
+ spec.installable_to_repository_ptr()->include_masked() << endl;
+
+ if (spec.additional_requirements_ptr() && ! spec.additional_requirements_ptr()->empty())
+ {
+ cout << " " << left << setw(24) << "Additional requirements:" << " ";
+ bool need_join(false);
+ for (AdditionalPackageDepSpecRequirements::ConstIterator u(spec.additional_requirements_ptr()->begin()),
+ u_end(spec.additional_requirements_ptr()->end()) ; u != u_end ; ++u)
+ {
+ if (need_join)
+ cout << " and ";
+
+ cout << (*u)->as_raw_string() + " (meaning: " + (*u)->as_human_string(make_null_shared_ptr()) + ")";
+ need_join = true;
+ }
+ cout << endl;
+ }
/* And display packages matching that spec */
cout << " " << left << setw(24) << "Matches:" << " ";
diff --git a/doc/api/cplusplus/examples/example_match_package.cc b/doc/api/cplusplus/examples/example_match_package.cc
index 94abb4cfc..c308f8dcd 100644
--- a/doc/api/cplusplus/examples/example_match_package.cc
+++ b/doc/api/cplusplus/examples/example_match_package.cc
@@ -54,7 +54,7 @@ int main(int argc, char * argv[])
i != i_end ; ++i)
{
/* Is it paludis? */
- if (match_package(*env, MutablePackageDepSpecData({ }).require_package(
+ if (match_package(*env, make_package_dep_spec({ }).package(
QualifiedPackageName("sys-apps/paludis")), *i, make_null_shared_ptr(), { }))
cout << left << setw(50) << (stringify(**i) + ":") << " " << "paludis" << endl;
diff --git a/doc/api/cplusplus/examples/example_selection.cc b/doc/api/cplusplus/examples/example_selection.cc
index f71a6ba0c..ad60e36b0 100644
--- a/doc/api/cplusplus/examples/example_selection.cc
+++ b/doc/api/cplusplus/examples/example_selection.cc
@@ -62,13 +62,13 @@ int main(int argc, char * argv[])
* object used determines the number and ordering of results. In the
* simplest form, it takes a Generator as a parameter. */
show_selection(env, selection::AllVersionsSorted(
- generator::Matches(MutablePackageDepSpecData({ }).require_package(
+ generator::Matches(make_package_dep_spec({ }).package(
QualifiedPackageName("sys-apps/paludis")), make_null_shared_ptr(), { })));
/* Generators can be passed through a Filter. The Selection optimises
* the code internally to avoid doing excess work. */
show_selection(env, selection::AllVersionsSorted(
- generator::Matches(MutablePackageDepSpecData({ }).require_package(
+ generator::Matches(make_package_dep_spec({ }).package(
QualifiedPackageName("sys-apps/paludis")), make_null_shared_ptr(), { }) |
filter::InstalledAtSlash()));
@@ -76,7 +76,7 @@ int main(int argc, char * argv[])
* with filter::SupportsAction<InstallAction>, since installed packages
* aren't masked. */
show_selection(env, selection::AllVersionsSorted(
- generator::Matches(MutablePackageDepSpecData({ }).require_package(
+ generator::Matches(make_package_dep_spec({ }).package(
QualifiedPackageName("sys-apps/paludis")), make_null_shared_ptr(), { }) |
filter::SupportsAction<InstallAction>() |
filter::NotMasked()));
@@ -85,7 +85,7 @@ int main(int argc, char * argv[])
* is no metadata cache. Consider using other Selection objects if
* you only need the best matching or some arbitrary matching ID. */
show_selection(env, selection::BestVersionOnly(
- generator::Matches(MutablePackageDepSpecData({ }).require_package(
+ generator::Matches(make_package_dep_spec({ }).package(
QualifiedPackageName("sys-apps/paludis")), make_null_shared_ptr(), { }) |
filter::SupportsAction<InstallAction>() |
filter::NotMasked()));
diff --git a/doc/configuration/specs.html.part b/doc/configuration/specs.html.part
index 40833f3de..ed376066f 100644
--- a/doc/configuration/specs.html.part
+++ b/doc/configuration/specs.html.part
@@ -40,16 +40,15 @@ the following order:</p>
<li><code>[.key?]</code>: Match only if the specified metadata key exists. <code>key</code> may be a key's raw
name (e.g. <code>DESCRIPTION</code>, <code>DEPEND</code>) or a role prefixed with a dollar sign (e.g.
<code>$short_description</code>, <code>$build_dependencies</code>). If the key's name is prefixed with
- <code>::</code>, metadata from the repository rather than the package ID is checked. If the key is in
- <code>(parens)</code>, matches masks by role, token or associated key (and <code>(*)</code> matches any mask).</li>
+ <code>::</code>, metadata from the repository rather than the package ID is checked.</li>
<li><code>[.key=value]</code>: Match only if the specified metadata key has a particular exact value. Only works for
simple values, sets and sequences, not spec trees and other complex compound keys. If <code>&lt;</code> is used in
place of <code>=</code>, for numeric values a less-than comparison is used, and for sets, sequences and spec trees,
- a match occurs if any member of the set or sequence is equal to the value. If <code>&gt;</code> is used,
- for numeric values a greater-than comparison is used; it does not match for other types of values. If <code>~</code>
- is used, a substring match is performed. As above, the key may be a raw name or a dollar-prefixed role name, and
- may be prefixed with <code>::</code> for checking repository metadata.</li>
+ a match occurs if any member of the set or sequence is equal to the value. Similarly if <code>&gt;</code> is used,
+ for numeric values a greater-than comparison is used; it does not match for other types of values. As above, the key
+ may be a raw name or a dollar-prefixed role name, and may be prefixed with <code>::</code> for checking repository
+ metadata.</li>
</ul>
<p>Repository requirements are in the form <code>to</code>, <code>from-&gt;</code> or <code>::from-&gt;to</code>. The