aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-12-02 00:45:40 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-12-02 00:45:40 +0000
commit1c22d3e80fc3c4cd50e163fc2ae9f0f75de6db1a (patch)
tree306f97b9a1d8e7f5d24e674bb1e1ff623bd52402 /doc
parentcfde917750de96cf0c5d660f87e0e8e514b20cc0 (diff)
downloadpaludis-1c22d3e80fc3c4cd50e163fc2ae9f0f75de6db1a.tar.gz
paludis-1c22d3e80fc3c4cd50e163fc2ae9f0f75de6db1a.tar.xz
Abstractify PackageDepSpec, to allow repositories to display deps in their native formats. Fixes: ticket:333
Diffstat (limited to 'doc')
-rw-r--r--doc/api/cplusplus/examples/example_action.cc2
-rw-r--r--doc/api/cplusplus/examples/example_contents.cc2
-rw-r--r--doc/api/cplusplus/examples/example_dep_spec.cc9
-rw-r--r--doc/api/cplusplus/examples/example_environment.cc2
-rw-r--r--doc/api/cplusplus/examples/example_formatter.cc2
-rw-r--r--doc/api/cplusplus/examples/example_mask.cc2
-rw-r--r--doc/api/cplusplus/examples/example_match_package.cc2
-rw-r--r--doc/api/cplusplus/examples/example_metadata_key.cc2
-rw-r--r--doc/api/cplusplus/examples/example_package_id.cc2
-rw-r--r--doc/api/cplusplus/examples/example_query.cc6
-rw-r--r--doc/api/cplusplus/examples/example_stringify_formatter.cc2
-rw-r--r--doc/api/ruby/example_action.rb2
-rw-r--r--doc/api/ruby/example_contents.rb2
-rw-r--r--doc/api/ruby/example_dep_spec.rb7
-rw-r--r--doc/api/ruby/example_environment.rb2
-rw-r--r--doc/api/ruby/example_query.rb6
16 files changed, 27 insertions, 25 deletions
diff --git a/doc/api/cplusplus/examples/example_action.cc b/doc/api/cplusplus/examples/example_action.cc
index e00f42f61..f00c58ada 100644
--- a/doc/api/cplusplus/examples/example_action.cc
+++ b/doc/api/cplusplus/examples/example_action.cc
@@ -38,7 +38,7 @@ int main(int argc, char * argv[])
/* Fetch package IDs for 'sys-apps/paludis'. */
tr1::shared_ptr<const PackageIDSequence> ids(env->package_database()->query(
- query::Matches(PackageDepSpec("sys-apps/paludis", pds_pm_permissive)),
+ query::Matches(make_package_dep_spec().package(QualifiedPackageName("sys-apps/paludis"))),
qo_order_by_version));
/* For each ID: */
diff --git a/doc/api/cplusplus/examples/example_contents.cc b/doc/api/cplusplus/examples/example_contents.cc
index f728c24a9..6bfae6890 100644
--- a/doc/api/cplusplus/examples/example_contents.cc
+++ b/doc/api/cplusplus/examples/example_contents.cc
@@ -80,7 +80,7 @@ int main(int argc, char * argv[])
/* Fetch package IDs for installed 'sys-apps/paludis'. */
tr1::shared_ptr<const PackageIDSequence> ids(env->package_database()->query(
- query::Matches(PackageDepSpec("sys-apps/paludis", pds_pm_permissive)) &
+ query::Matches(make_package_dep_spec().package(QualifiedPackageName("sys-apps/paludis"))) &
query::SupportsAction<InstalledAction>(),
qo_order_by_version));
diff --git a/doc/api/cplusplus/examples/example_dep_spec.cc b/doc/api/cplusplus/examples/example_dep_spec.cc
index 129c2b3df..f21bdb840 100644
--- a/doc/api/cplusplus/examples/example_dep_spec.cc
+++ b/doc/api/cplusplus/examples/example_dep_spec.cc
@@ -48,9 +48,12 @@ int main(int argc, char * argv[])
q_end(CommandLine::get_instance()->end_parameters()) ; q != q_end ; ++q)
{
/* Create a PackageDepSpec from the parameter. For user-inputted
- * data, pds_pm_permissive or pds_pm_unspecific should be used (only
- * the latter allows wildcards). */
- PackageDepSpec spec(*q, pds_pm_unspecific);
+ * data, parse_user_package_dep_spec() should be used. If wildcards
+ * are to be permitted, the updso_allow_wildcards option should be
+ * included. If data about the spec is known at compile time,
+ * make_package_dep_spec() should be used instead. */
+ PackageDepSpec spec(parse_user_package_dep_spec(
+ *q, UserPackageDepSpecOptions() + updso_allow_wildcards));
/* Display information about the PackageDepSpec. */
cout << "Information about '" << spec << "':" << endl;
diff --git a/doc/api/cplusplus/examples/example_environment.cc b/doc/api/cplusplus/examples/example_environment.cc
index 5b092358a..4c91afd91 100644
--- a/doc/api/cplusplus/examples/example_environment.cc
+++ b/doc/api/cplusplus/examples/example_environment.cc
@@ -66,7 +66,7 @@ int main(int argc, char * argv[])
/* And use flags, for which we need a package IDs: */
tr1::shared_ptr<const PackageIDSequence> ids(env->package_database()->query(
- query::Matches(PackageDepSpec("sys-apps/paludis", pds_pm_permissive)) &
+ query::Matches(make_package_dep_spec().package(QualifiedPackageName("sys-apps/paludis"))) &
query::SupportsAction<InstalledAction>(),
qo_order_by_version));
diff --git a/doc/api/cplusplus/examples/example_formatter.cc b/doc/api/cplusplus/examples/example_formatter.cc
index 51582a806..bc6aafbec 100644
--- a/doc/api/cplusplus/examples/example_formatter.cc
+++ b/doc/api/cplusplus/examples/example_formatter.cc
@@ -160,7 +160,7 @@ int main(int argc, char * argv[])
/* Fetch package IDs for installable 'sys-apps/paludis'. */
tr1::shared_ptr<const PackageIDSequence> ids(env->package_database()->query(
- query::Matches(PackageDepSpec("sys-apps/paludis", pds_pm_permissive)) &
+ query::Matches(make_package_dep_spec().package(QualifiedPackageName("sys-apps/paludis"))) &
query::SupportsAction<InstallAction>(),
qo_order_by_version));
diff --git a/doc/api/cplusplus/examples/example_mask.cc b/doc/api/cplusplus/examples/example_mask.cc
index 1b60e77a5..c8fd2d872 100644
--- a/doc/api/cplusplus/examples/example_mask.cc
+++ b/doc/api/cplusplus/examples/example_mask.cc
@@ -85,7 +85,7 @@ int main(int argc, char * argv[])
/* Fetch package IDs for 'sys-apps/paludis'. */
tr1::shared_ptr<const PackageIDSequence> ids(env->package_database()->query(
- query::Matches(PackageDepSpec("sys-apps/paludis", pds_pm_permissive)),
+ query::Matches(make_package_dep_spec().package(QualifiedPackageName("sys-apps/paludis"))),
qo_order_by_version));
/* For each ID: */
diff --git a/doc/api/cplusplus/examples/example_match_package.cc b/doc/api/cplusplus/examples/example_match_package.cc
index dbe540466..90fdd6dab 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, PackageDepSpec("sys-apps/paludis", pds_pm_permissive), **i))
+ if (match_package(*env, make_package_dep_spec().package(QualifiedPackageName("sys-apps/paludis")), **i))
cout << left << setw(50) << (stringify(**i) + ":") << " " << "paludis" << endl;
/* No. Is it in system or world? */
diff --git a/doc/api/cplusplus/examples/example_metadata_key.cc b/doc/api/cplusplus/examples/example_metadata_key.cc
index c4b9662eb..8de9f39a3 100644
--- a/doc/api/cplusplus/examples/example_metadata_key.cc
+++ b/doc/api/cplusplus/examples/example_metadata_key.cc
@@ -245,7 +245,7 @@ int main(int argc, char * argv[])
/* Fetch package IDs for 'sys-apps/paludis'. */
tr1::shared_ptr<const PackageIDSequence> ids(env->package_database()->query(
- query::Matches(PackageDepSpec("sys-apps/paludis", pds_pm_permissive)),
+ query::Matches(make_package_dep_spec().package(QualifiedPackageName("sys-apps/paludis"))),
qo_order_by_version));
/* For each ID: */
diff --git a/doc/api/cplusplus/examples/example_package_id.cc b/doc/api/cplusplus/examples/example_package_id.cc
index b684e3a08..71b5a949f 100644
--- a/doc/api/cplusplus/examples/example_package_id.cc
+++ b/doc/api/cplusplus/examples/example_package_id.cc
@@ -47,7 +47,7 @@ int main(int argc, char * argv[])
/* Fetch package IDs for 'sys-apps/paludis'. */
tr1::shared_ptr<const PackageIDSequence> ids(env->package_database()->query(
- query::Matches(PackageDepSpec("sys-apps/paludis", pds_pm_permissive)),
+ query::Matches(make_package_dep_spec().package(QualifiedPackageName("sys-apps/paludis"))),
qo_order_by_version));
/* For each ID: */
diff --git a/doc/api/cplusplus/examples/example_query.cc b/doc/api/cplusplus/examples/example_query.cc
index 161e8cc28..9e96ed77c 100644
--- a/doc/api/cplusplus/examples/example_query.cc
+++ b/doc/api/cplusplus/examples/example_query.cc
@@ -60,19 +60,19 @@ int main(int argc, char * argv[])
CommandLine::get_instance()->a_environment.argument()));
/* Make some queries, and display what they give. */
- show_query(env, query::Matches(PackageDepSpec("sys-apps/paludis", pds_pm_permissive)));
+ show_query(env, query::Matches(make_package_dep_spec().package(QualifiedPackageName("sys-apps/paludis"))));
/* Queries can be combined. The resulting query is optimised internally,
* potentially giving better performance than doing things by hand. */
show_query(env,
- query::Matches(PackageDepSpec("sys-apps/paludis", pds_pm_permissive)) &
+ query::Matches(make_package_dep_spec().package(QualifiedPackageName("sys-apps/paludis"))) &
query::SupportsAction<InstalledAction>());
/* Usually query::NotMasked should be combined with
* query::SupportsAction<InstallAction>, since installed packages aren't
* masked. */
show_query(env,
- query::Matches(PackageDepSpec("sys-apps/paludis", pds_pm_permissive)) &
+ query::Matches(make_package_dep_spec().package(QualifiedPackageName("sys-apps/paludis"))) &
query::SupportsAction<InstallAction>() &
query::NotMasked());
diff --git a/doc/api/cplusplus/examples/example_stringify_formatter.cc b/doc/api/cplusplus/examples/example_stringify_formatter.cc
index 6f5d3b671..150de4e8d 100644
--- a/doc/api/cplusplus/examples/example_stringify_formatter.cc
+++ b/doc/api/cplusplus/examples/example_stringify_formatter.cc
@@ -39,7 +39,7 @@ int main(int argc, char * argv[])
/* Fetch package IDs for installable 'sys-apps/paludis'. */
tr1::shared_ptr<const PackageIDSequence> ids(env->package_database()->query(
- query::Matches(PackageDepSpec("sys-apps/paludis", pds_pm_permissive)) &
+ query::Matches(make_package_dep_spec().package(QualifiedPackageName("sys-apps/paludis"))) &
query::SupportsAction<InstallAction>(),
qo_order_by_version));
diff --git a/doc/api/ruby/example_action.rb b/doc/api/ruby/example_action.rb
index 21197b4df..ca299c2f1 100644
--- a/doc/api/ruby/example_action.rb
+++ b/doc/api/ruby/example_action.rb
@@ -18,7 +18,7 @@ env = EnvironmentMaker.instance.make_from_spec(ExampleCommandLine.instance.envir
# Fetch package IDs for 'sys-apps/paludis'
ids = env.package_database.query(
- Query::Matches.new(PackageDepSpec.new("sys-apps/paludis", PackageDepSpecParseMode::Permissive)),
+ Query::Matches.new(Paludis::parse_user_package_dep_spec("sys-apps/paludis", [])),
QueryOrder::OrderByVersion)
# For each ID:
diff --git a/doc/api/ruby/example_contents.rb b/doc/api/ruby/example_contents.rb
index 26f2f9ef6..702085067 100644
--- a/doc/api/ruby/example_contents.rb
+++ b/doc/api/ruby/example_contents.rb
@@ -18,7 +18,7 @@ env = EnvironmentMaker.instance.make_from_spec(ExampleCommandLine.instance.envir
# Fetch package IDs for installed 'sys-apps/paludis'
ids = env.package_database.query(
- Query::Matches.new(PackageDepSpec.new("sys-apps/paludis", PackageDepSpecParseMode::Permissive)) &
+ Query::Matches.new(Paludis::parse_user_package_dep_spec("sys-apps/paludis", [])) &
Query::SupportsInstalledAction.new,
QueryOrder::OrderByVersion)
diff --git a/doc/api/ruby/example_dep_spec.rb b/doc/api/ruby/example_dep_spec.rb
index 5103b93f2..29b0e4acd 100644
--- a/doc/api/ruby/example_dep_spec.rb
+++ b/doc/api/ruby/example_dep_spec.rb
@@ -17,10 +17,9 @@ env = EnvironmentMaker.instance.make_from_spec(ExampleCommandLine.instance.envir
# For each command line parameter:
ARGV.each do | arg |
- # Create a PackageDepSpec from the parameter. For user-inputted data,
- # PackageDepSpecParseMode::Permissive or PackageDepSpecParseMode::Unspecific should be used
- # (only the latter allows wildcards).
- spec = PackageDepSpec.new(arg, PackageDepSpecParseMode::Unspecific)
+ # Create a PackageDepSpec from the parameter. The second parameter should be either
+ # an empty array or [:allow_wildcards].
+ spec = Paludis::parse_user_package_dep_spec(arg, [:allow_wildcards])
# Display information about the PackageDepSpec.
puts "Information about '#{spec}':"
diff --git a/doc/api/ruby/example_environment.rb b/doc/api/ruby/example_environment.rb
index 6732162cf..888522eb1 100644
--- a/doc/api/ruby/example_environment.rb
+++ b/doc/api/ruby/example_environment.rb
@@ -42,7 +42,7 @@ end
# And use flags, for which we need package IDs:
ids = env.package_database.query(
- Query::Matches.new(PackageDepSpec.new('sys-apps/paludis', PackageDepSpecParseMode::Permissive)) &
+ Query::Matches.new(Paludis::parse_user_package_dep_spec('sys-apps/paludis', [])) &
Query::SupportsInstalledAction.new,
QueryOrder::OrderByVersion)
diff --git a/doc/api/ruby/example_query.rb b/doc/api/ruby/example_query.rb
index 00cecbdb7..3eecc0b8a 100644
--- a/doc/api/ruby/example_query.rb
+++ b/doc/api/ruby/example_query.rb
@@ -30,18 +30,18 @@ end
env = EnvironmentMaker.instance.make_from_spec(ExampleCommandLine.instance.environment)
# Make some queries, and display what they give.
-show_query(env, Query::Matches.new(PackageDepSpec.new("sys-apps/paludis", PackageDepSpecParseMode::Permissive)))
+show_query(env, Query::Matches.new(Paludis::parse_user_package_dep_spec("sys-apps/paludis", [])))
# Queries can be combined. The resulting query is optimised internally,
# potentially giving better performance than doing things by hand.
show_query(env,
- Query::Matches.new(PackageDepSpec.new("sys-apps/paludis", PackageDepSpecParseMode::Permissive)) &
+ Query::Matches.new(Paludis::parse_user_package_dep_spec("sys-apps/paludis", [])) &
Query::SupportsInstalledAction.new)
# Usually Query::NotMasked should be combined with Query::SupportsInstallAction,
# since installed packages aren't masked.
show_query(env,
- Query::Matches.new(PackageDepSpec.new("sys-apps/paludis", PackageDepSpecParseMode::Permissive)) &
+ Query::Matches.new(Paludis::parse_user_package_dep_spec("sys-apps/paludis", [])) &
Query::SupportsInstallAction.new &
Query::NotMasked.new)