aboutsummaryrefslogtreecommitdiff
path: root/doc/api/ruby
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-13 18:02:44 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-13 18:02:44 +0100
commit68f2de2c2c795832607bfbe9249affd36faac431 (patch)
tree69be5cbe7045cca9ba271c732411f29fd750f8ce /doc/api/ruby
parentef75cff538e62392f02391329bad533ce9adf662 (diff)
downloadpaludis-68f2de2c2c795832607bfbe9249affd36faac431.tar.gz
paludis-68f2de2c2c795832607bfbe9249affd36faac431.tar.xz
Kill InstalledAction
Diffstat (limited to 'doc/api/ruby')
-rw-r--r--doc/api/ruby/example_contents.rb18
-rw-r--r--doc/api/ruby/example_dep_tree.rb2
-rw-r--r--doc/api/ruby/example_match_package.rb2
-rw-r--r--doc/api/ruby/example_package_id.rb1
-rw-r--r--doc/api/ruby/example_selection.rb2
5 files changed, 9 insertions, 16 deletions
diff --git a/doc/api/ruby/example_contents.rb b/doc/api/ruby/example_contents.rb
index c748c5ce0..82c758d28 100644
--- a/doc/api/ruby/example_contents.rb
+++ b/doc/api/ruby/example_contents.rb
@@ -19,7 +19,7 @@ env = EnvironmentFactory.instance.create(ExampleCommandLine.instance.environment
# Fetch package IDs for installed 'sys-apps/paludis'
ids = env[Selection::AllVersionsSorted.new(
Generator::Matches.new(Paludis::parse_user_package_dep_spec("sys-apps/paludis", env, []), []) |
- Filter::SupportsAction.new(InstalledAction))]
+ Filter::InstalledAtRoot.new("/"))]
# For each ID:
ids.each do | id |
@@ -33,23 +33,17 @@ ids.each do | id |
id.contents_key.value.each do | c |
# Some ContentsEntry subclasses contain more information than others
- if c.kind_of? ContentsDevEntry
- puts "device #{c.name}"
-
- elsif c.kind_of? ContentsMiscEntry
- puts "misc #{c.name}"
+ if c.kind_of? ContentsOtherEntry
+ puts "other #{c.location_key.value}"
elsif c.kind_of? ContentsFileEntry
- puts "file #{c.name}"
+ puts "file #{c.location_key.value}"
elsif c.kind_of? ContentsDirEntry
- puts "dir #{c.name}"
-
- elsif c.kind_of? ContentsFifoEntry
- puts "fifo #{c.name}"
+ puts "dir #{c.location_key.value}"
elsif c.kind_of? ContentsSymEntry
- puts "sym #{c.name} -> #{c.target}"
+ puts "sym #{c.location_key.value} -> #{c.target_key.value}"
else
puts "unknown #{c}"
diff --git a/doc/api/ruby/example_dep_tree.rb b/doc/api/ruby/example_dep_tree.rb
index db8c298d7..53d3a4817 100644
--- a/doc/api/ruby/example_dep_tree.rb
+++ b/doc/api/ruby/example_dep_tree.rb
@@ -116,7 +116,7 @@ env = EnvironmentFactory.instance.create(ExampleCommandLine.instance.environment
# Fetch package IDs for all installed packages.
ids = env[Selection::AllVersionsSorted.new(
- Generator::All.new | Filter::SupportsAction.new(InstalledAction))]
+ Generator::All.new | Filter::InstalledAtRoot.new("/"))]
# Our results table, mapping the ID to { :has_dep => ?, :has_ext => ? }
results = { }
diff --git a/doc/api/ruby/example_match_package.rb b/doc/api/ruby/example_match_package.rb
index 293eb7bc3..7a448be03 100644
--- a/doc/api/ruby/example_match_package.rb
+++ b/doc/api/ruby/example_match_package.rb
@@ -18,7 +18,7 @@ env = EnvironmentFactory.instance.create(ExampleCommandLine.instance.environment
# Fetch all installed packages
ids = env[Selection::AllVersionsSorted.new(
- Generator::All.new | Filter::SupportsAction.new(InstalledAction))]
+ Generator::All.new | Filter::InstalledAtRoot.new("/"))]
# Fetch the 'system' and 'world' sets. Ordinarily we should check for
# Nil here, but these two sets will always exist.
diff --git a/doc/api/ruby/example_package_id.rb b/doc/api/ruby/example_package_id.rb
index 112f4af9a..0d3b2f3a8 100644
--- a/doc/api/ruby/example_package_id.rb
+++ b/doc/api/ruby/example_package_id.rb
@@ -58,7 +58,6 @@ ids.each do | id |
# doing.
actions = []
actions << "install" if id.supports_action(SupportsActionTest.new(InstallAction))
- actions << "installed" if id.supports_action(SupportsActionTest.new(InstalledAction))
actions << "uninstall" if id.supports_action(SupportsActionTest.new(UninstallAction))
actions << "pretend" if id.supports_action(SupportsActionTest.new(PretendAction))
actions << "config" if id.supports_action(SupportsActionTest.new(ConfigAction))
diff --git a/doc/api/ruby/example_selection.rb b/doc/api/ruby/example_selection.rb
index 67ea70749..7a61030bc 100644
--- a/doc/api/ruby/example_selection.rb
+++ b/doc/api/ruby/example_selection.rb
@@ -40,7 +40,7 @@ show_selection(env, Selection::AllVersionsSorted.new(
# the code internally to avoid doing excess work.
show_selection(env, Selection::AllVersionsSorted.new(
Generator::Matches.new(parse_user_package_dep_spec("sys-apps/paludis", env, []), []) |
- Filter::SupportsAction.new(InstalledAction)))
+ Filter::InstalledAtRoot.new("/")))
# Filters can be combined. Usually Filter::NotMasked should be combined
# with Filter::SupportsAction.new(InstallAction), since installed packages