aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-25 18:05:34 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-25 18:05:34 +0000
commit394ca5b5149869e774c8664c034dd9d35c75273f (patch)
treebad35cf42b1a033746599c7d14396da21872dc7d
parentbf3ada970ee7a445868c6763d2e6e2d036aea608 (diff)
downloadpaludis-394ca5b5149869e774c8664c034dd9d35c75273f.tar.gz
paludis-394ca5b5149869e774c8664c034dd9d35c75273f.tar.xz
No need for favourite_repository
-rw-r--r--doc/api/cplusplus/examples/example_package_database.cc5
-rw-r--r--doc/api/ruby/example_package_database.rb2
-rw-r--r--paludis/package_database.cc11
-rw-r--r--paludis/package_database.hh11
-rw-r--r--python/package_database.cc5
-rwxr-xr-xpython/package_database_TEST.py4
-rw-r--r--ruby/package_database.cc24
-rw-r--r--ruby/package_database_TEST.rb12
8 files changed, 2 insertions, 72 deletions
diff --git a/doc/api/cplusplus/examples/example_package_database.cc b/doc/api/cplusplus/examples/example_package_database.cc
index 87ab20f..ddbc38e 100644
--- a/doc/api/cplusplus/examples/example_package_database.cc
+++ b/doc/api/cplusplus/examples/example_package_database.cc
@@ -48,11 +48,6 @@ int main(int argc, char * argv[])
(repo->format_key() ? repo->format_key()->value() : "") << "'" << endl;
}
- /* Our favourite repository is the least important non-special (e.g.
- * virtual) installable repository. Some clients use this as a hint to
- * not display a ::repository suffix for things from this repository. */
- cout << "Our favourite repository is '" << env->package_database()->favourite_repository() << "'" << endl;
-
/* Users often expect to be able to refer to a package by its name part
* only (e.g. 'foo' rather than 'app-misc/foo'). This has to be
* disambiguated as follows: */
diff --git a/doc/api/ruby/example_package_database.rb b/doc/api/ruby/example_package_database.rb
index d5b3028..6c7a17e 100644
--- a/doc/api/ruby/example_package_database.rb
+++ b/doc/api/ruby/example_package_database.rb
@@ -23,8 +23,6 @@ if env.package_database.has_repository_named?('gentoo')
(repo.format_key ? repo.format_key.value : '') + "'"
end
-puts "Our favourite repository is '#{env.package_database.favourite_repository}'"
-
begin
name = env.package_database.fetch_unique_qualified_package_name('git')
puts "The only package named 'git' is '#{name}'"
diff --git a/paludis/package_database.cc b/paludis/package_database.cc
index 12f3c4b..9fe051d 100644
--- a/paludis/package_database.cc
+++ b/paludis/package_database.cc
@@ -394,17 +394,6 @@ PackageDatabase::has_repository_named(const RepositoryName & n) const
return false;
}
-RepositoryName
-PackageDatabase::favourite_repository() const
-{
- for (RepositoryConstIterator r(begin_repositories()), r_end(end_repositories()) ;
- r != r_end ; ++r)
- if ((*r)->can_be_favourite_repository())
- return (*r)->name();
-
- return RepositoryName("unnamed");
-}
-
bool
PackageDatabase::more_important_than(const RepositoryName & lhs,
const RepositoryName & rhs) const
diff --git a/paludis/package_database.hh b/paludis/package_database.hh
index 63424f2..f1fc47b 100644
--- a/paludis/package_database.hh
+++ b/paludis/package_database.hh
@@ -265,17 +265,6 @@ namespace paludis
PALUDIS_ATTRIBUTE((warn_unused_result));
/**
- * Fetch the name of our 'favourite' repository (if a repository's
- * name matches this when doing a graphical display, the repository
- * name part may be omitted).
- *
- * Note that this is the repository with the <i>lowest</i> importance
- * that is not a virtuals or installed_virtuals repository.
- */
- RepositoryName favourite_repository() const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- /**
* Disambiguate a package name. If a filter is specified,
* limit the potential results to packages that match.
*
diff --git a/python/package_database.cc b/python/package_database.cc
index 25993c6..f14b412 100644
--- a/python/package_database.cc
+++ b/python/package_database.cc
@@ -72,11 +72,6 @@ void expose_package_database()
bp::no_init
)
- .add_property("favourite_repository", &PackageDatabase::favourite_repository,
- "[ro] RepositoryName\n"
- "Name of our 'favourite' repository"
- )
-
.def("fetch_repository", fetch_repository_ptr, bp::with_custodian_and_ward_postcall<0, 1>(),
"fetch_repository(RepositoryName) -> Repository\n"
"Fetch a named repository."
diff --git a/python/package_database_TEST.py b/python/package_database_TEST.py
index c811070..d5598f9 100755
--- a/python/package_database_TEST.py
+++ b/python/package_database_TEST.py
@@ -35,10 +35,6 @@ class TestCase_PackageDatabase(unittest.TestCase):
def test_01_create_error(self):
self.assertRaises(Exception, PackageDatabase)
- def test_02_favourite_repo(self):
- self.get_db()
- self.assertEqual(str(self.db.favourite_repository), "testrepo")
-
def test_03_fech_unique_qpn(self):
self.get_db()
self.assertEqual(str(QualifiedPackageName("foo/bar")), str(self.db.fetch_unique_qualified_package_name("bar")))
diff --git a/ruby/package_database.cc b/ruby/package_database.cc
index 16f9ad5..2b59680 100644
--- a/ruby/package_database.cc
+++ b/ruby/package_database.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009, 2011 Ciaran McCreesh
*
* 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
@@ -33,27 +33,6 @@ namespace
/*
* call-seq:
- * favourite_repository -> String
- *
- * Fetch the name of our 'favourite' repository
- */
- VALUE
- package_database_favourite_repository(VALUE self)
- {
- try
- {
- std::shared_ptr<PackageDatabase> * self_ptr;
- Data_Get_Struct(self, std::shared_ptr<PackageDatabase>, self_ptr);
- return rb_str_new2(stringify((*self_ptr)->favourite_repository()).c_str());
- }
- catch (const std::exception & e)
- {
- exception_to_ruby_exception(e);
- }
- }
-
- /*
- * call-seq:
* fetch_unique_qualified_package_name(package_name) -> QualifiedPackageName
* fetch_unique_qualified_package_name(package_name, filter) -> QualifiedPackageName
*
@@ -218,7 +197,6 @@ namespace
*/
c_package_database = rb_define_class_under(paludis_module(), "PackageDatabase", rb_cObject);
rb_funcall(c_package_database, rb_intern("private_class_method"), 1, rb_str_new2("new"));
- rb_define_method(c_package_database, "favourite_repository", RUBY_FUNC_CAST(&package_database_favourite_repository), 0);
rb_define_method(c_package_database, "fetch_unique_qualified_package_name",
RUBY_FUNC_CAST(&package_database_fetch_unique_qualified_package_name), -1);
rb_define_method(c_package_database, "repositories",
diff --git a/ruby/package_database_TEST.rb b/ruby/package_database_TEST.rb
index a15f8af..fe4087f 100644
--- a/ruby/package_database_TEST.rb
+++ b/ruby/package_database_TEST.rb
@@ -2,7 +2,7 @@
# vim: set sw=4 sts=4 et tw=80 :
#
-# Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
+# Copyright (c) 2006, 2007, 2008, 2009, 2011 Ciaran McCreesh
# Copyright (c) 2007 Richard Brown
#
# This file is part of the Paludis package manager. Paludis is free software;
@@ -35,16 +35,6 @@ module Paludis
end
end
- class TestCase_PackageDatabaseFavouriteRepository < Test::Unit::TestCase
- def env
- @env or @env = EnvironmentFactory.instance.create("")
- end
-
- def test_package_database_favourite_repository
- assert_equal "testrepo", env.package_database.favourite_repository
- end
- end
-
class TestCase_PackageDatabaseFetchUniqueQualifiedPackageName < Test::Unit::TestCase
def env
@env or @env = EnvironmentFactory.instance.create("")