aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Richard Brown <rbrown@exherbo.org> 2007-02-27 20:11:44 +0000
committerAvatar Richard Brown <rbrown@exherbo.org> 2007-02-27 20:11:44 +0000
commit963d98b02b60b3cd48e4dd4dec4c59d9790ec8ce (patch)
tree5a41beb958e0a848485b17f425ad7680ef00f38b
parentcd142ee33cbb62666c820d07d67b0de9413b4804 (diff)
downloadpaludis-963d98b02b60b3cd48e4dd4dec4c59d9790ec8ce.tar.gz
paludis-963d98b02b60b3cd48e4dd4dec4c59d9790ec8ce.tar.xz
Update ruby demos again.
-rw-r--r--doc/examples/pwp_basic_ruby_app.rb2
-rw-r--r--ruby/demos/check_linkage.rb12
-rw-r--r--ruby/demos/find_unmanaged_files.rb12
-rw-r--r--ruby/demos/find_unused_distfiles.rb13
4 files changed, 19 insertions, 20 deletions
diff --git a/doc/examples/pwp_basic_ruby_app.rb b/doc/examples/pwp_basic_ruby_app.rb
index 13e1144..7f47558 100644
--- a/doc/examples/pwp_basic_ruby_app.rb
+++ b/doc/examples/pwp_basic_ruby_app.rb
@@ -3,7 +3,7 @@
require 'Paludis'
-packages = Paludis::DefaultEnvironment.instance.package_database.query(
+packages = Paludis::EnvironmentMaker.instance.make_from_spec('').package_database.query(
"app-editors/vim", Paludis::InstallState::InstalledOnly, Paludis::QueryOrder::OrderByVersion)
if packages.empty?
diff --git a/ruby/demos/check_linkage.rb b/ruby/demos/check_linkage.rb
index 6f17e36..6dc0876 100644
--- a/ruby/demos/check_linkage.rb
+++ b/ruby/demos/check_linkage.rb
@@ -11,10 +11,10 @@ opts = GetoptLong.new(
[ '--help', '-h', GetoptLong::NO_ARGUMENT ],
[ '--version', '-V', GetoptLong::NO_ARGUMENT ],
[ '--log-level', GetoptLong::REQUIRED_ARGUMENT ],
- [ '--config-suffix', '-c', GetoptLong::REQUIRED_ARGUMENT ],
+ [ '--environment', '-E', GetoptLong::REQUIRED_ARGUMENT ],
[ '--pretend', '-p', GetoptLong::NO_ARGUMENT ] )
-config_suffix = ""
+env_spec = ""
override_directory = []
pretend = false
opts.each do | opt, arg |
@@ -29,7 +29,7 @@ opts.each do | opt, arg |
puts " --pretend Stop before reinstalling"
puts
puts " --log-level level Set log level (debug, qa, warning, silent)"
- puts " --config-suffix suffix Set configuration suffix"
+ puts " --environment env Environment specification (class:suffix, both parts optional)"
exit 0
when '--version'
@@ -51,8 +51,8 @@ opts.each do | opt, arg |
exit 1
end
- when '--config-suffix'
- config_suffix = arg
+ when '--environment'
+ env_spec = arg
when '--directory'
override_directory << arg
@@ -101,7 +101,7 @@ def check_file file
end
end
-env = Paludis::EnvironmentMaker.instance.make_from_spec config_suffix
+env = Paludis::EnvironmentMaker.instance.make_from_spec env_spec
status "Checking linkage for package-manager installed files"
diff --git a/ruby/demos/find_unmanaged_files.rb b/ruby/demos/find_unmanaged_files.rb
index 86666d4..2f1c5c5 100644
--- a/ruby/demos/find_unmanaged_files.rb
+++ b/ruby/demos/find_unmanaged_files.rb
@@ -33,9 +33,9 @@ opts = GetoptLong.new(
[ '--help', '-h', GetoptLong::NO_ARGUMENT ],
[ '--version', '-V', GetoptLong::NO_ARGUMENT ],
[ '--log-level', GetoptLong::REQUIRED_ARGUMENT ],
- [ '--config-suffix', '-c', GetoptLong::REQUIRED_ARGUMENT ])
+ [ '--environment', '-E', GetoptLong::REQUIRED_ARGUMENT ])
-config_suffix = ""
+env_spec = ""
opts.each do | opt, arg |
case opt
when '--help'
@@ -46,7 +46,7 @@ opts.each do | opt, arg |
puts " --version Display program version"
puts
puts " --log-level level Set log level (debug, qa, warning, silent)"
- puts " --config-suffix suffix Set configuration suffix)"
+ puts " --environment env Environment specification (class:suffix, both parts optional)"
exit 0
when '--version'
@@ -68,8 +68,8 @@ opts.each do | opt, arg |
exit 1
end
- when '--config-suffix'
- config_suffix = arg
+ when '--environment'
+ env_spec = arg
end
end
@@ -92,7 +92,7 @@ end
in_fs = []
Find.find(*files) {|file| in_fs << file}
-env = Paludis::EnvironmentMaker.instance.make_from_spec config_suffix
+env = Paludis::EnvironmentMaker.instance.make_from_spec env_spec
db = env.package_database
db.repositories do |repo|
diff --git a/ruby/demos/find_unused_distfiles.rb b/ruby/demos/find_unused_distfiles.rb
index 97d5f8c..87b570f 100644
--- a/ruby/demos/find_unused_distfiles.rb
+++ b/ruby/demos/find_unused_distfiles.rb
@@ -11,9 +11,9 @@ opts = GetoptLong.new(
[ '--help', '-h', GetoptLong::NO_ARGUMENT ],
[ '--version', '-V', GetoptLong::NO_ARGUMENT ],
[ '--log-level', GetoptLong::REQUIRED_ARGUMENT ],
- [ '--config-suffix', '-c', GetoptLong::REQUIRED_ARGUMENT ])
+ [ '--environment', '-E', GetoptLong::REQUIRED_ARGUMENT ])
-config_suffix = ""
+env_spec = ""
opts.each do | opt, arg |
case opt
when '--help'
@@ -24,7 +24,7 @@ opts.each do | opt, arg |
puts " --version Display program version"
puts
puts " --log-level level Set log level (debug, qa, warning, silent)"
- puts " --config-suffix suffix Set configuration suffix)"
+ puts " --environment env Environment specification (class:suffix, both parts optional)"
exit 0
when '--version'
@@ -46,14 +46,13 @@ opts.each do | opt, arg |
exit 1
end
- when '--config-suffix'
- config_suffix = arg
+ when '--environment'
+ env_spec = arg
end
end
-Paludis::DefaultConfig::config_suffix = config_suffix
-env = Paludis::DefaultEnvironment.instance
+env = Paludis::EnvironmentMaker.instance.make_from_spec env_spec
# build up a list of all src_uri things that're used by installed packages
parts = Hash.new