aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-11 21:43:56 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-11 21:43:56 +0000
commitb8307ce912f20187536f5b6980065d0601d27f34 (patch)
tree3ad1722b93e7b68c6d474eb4c93ae9435aafa8c7
parent0338bfc39a4a1c9d04cb5077d65edd8019785c50 (diff)
downloadpaludis-b8307ce912f20187536f5b6980065d0601d27f34.tar.gz
paludis-b8307ce912f20187536f5b6980065d0601d27f34.tar.xz
Add everything target
-rw-r--r--paludis/fake_repository.cc2
-rw-r--r--paludis/fake_repository.hh2
-rw-r--r--paludis/portage_repository.cc19
-rw-r--r--paludis/portage_repository.hh2
-rw-r--r--paludis/repository.hh10
-rw-r--r--paludis/vdb_repository.cc12
-rw-r--r--paludis/vdb_repository.hh2
-rw-r--r--src/install.cc7
8 files changed, 37 insertions, 19 deletions
diff --git a/paludis/fake_repository.cc b/paludis/fake_repository.cc
index 03d8edc..54c5beb 100644
--- a/paludis/fake_repository.cc
+++ b/paludis/fake_repository.cc
@@ -222,7 +222,7 @@ FakeRepository::do_uninstall(const QualifiedPackageName &, const VersionSpec &)
}
DepAtom::Pointer
-FakeRepository::do_system_packages() const
+FakeRepository::do_package_set(const std::string &) const
{
AllDepAtom::Pointer result(new AllDepAtom);
diff --git a/paludis/fake_repository.hh b/paludis/fake_repository.hh
index edc3cef..7e10e85 100644
--- a/paludis/fake_repository.hh
+++ b/paludis/fake_repository.hh
@@ -83,7 +83,7 @@ namespace paludis
virtual void do_uninstall(const QualifiedPackageName &, const VersionSpec &) const;
- virtual DepAtom::Pointer do_system_packages() const;
+ virtual DepAtom::Pointer do_package_set(const std::string & s) const;
virtual bool do_sync() const;
diff --git a/paludis/portage_repository.cc b/paludis/portage_repository.cc
index 7ee0880..1477a12 100644
--- a/paludis/portage_repository.cc
+++ b/paludis/portage_repository.cc
@@ -1174,16 +1174,21 @@ PortageRepository::do_install(const QualifiedPackageName & q, const VersionSpec
}
DepAtom::Pointer
-PortageRepository::do_system_packages() const
+PortageRepository::do_package_set(const std::string & s) const
{
- if (! _imp->has_profile)
+ if ("system" == s)
{
- Context c("When loading system packages list:");
- _imp->add_profile(_imp->profile.realpath());
- _imp->has_profile = true;
- }
+ if (! _imp->has_profile)
+ {
+ Context c("When loading system packages list:");
+ _imp->add_profile(_imp->profile.realpath());
+ _imp->has_profile = true;
+ }
- return _imp->system_packages;
+ return _imp->system_packages;
+ }
+ else
+ return DepAtom::Pointer(new AllDepAtom);
}
bool
diff --git a/paludis/portage_repository.hh b/paludis/portage_repository.hh
index fe613ff..2340a41 100644
--- a/paludis/portage_repository.hh
+++ b/paludis/portage_repository.hh
@@ -95,7 +95,7 @@ namespace paludis
virtual void do_uninstall(const QualifiedPackageName &,
const VersionSpec &) const PALUDIS_ATTRIBUTE((noreturn));
- virtual DepAtom::Pointer do_system_packages() const;
+ virtual DepAtom::Pointer do_package_set(const std::string & s) const;
virtual bool do_sync() const;
diff --git a/paludis/repository.hh b/paludis/repository.hh
index fa64c9b..f3f4d5a 100644
--- a/paludis/repository.hh
+++ b/paludis/repository.hh
@@ -159,9 +159,9 @@ namespace paludis
virtual void do_uninstall(const QualifiedPackageName &, const VersionSpec &) const = 0;
/**
- * Override in descendents: system package list.
+ * Override in descendents: package list.
*/
- virtual DepAtom::Pointer do_system_packages() const = 0;
+ virtual DepAtom::Pointer do_package_set(const std::string & id) const = 0;
/**
* Override in descendents: sync, if needed (true) or do nothing (false).
@@ -417,11 +417,11 @@ namespace paludis
}
/**
- * Fetch our system packages list.
+ * Fetch a package set.
*/
- virtual DepAtom::Pointer system_packages() const
+ virtual DepAtom::Pointer package_set(const std::string & s) const
{
- return do_system_packages();
+ return do_package_set(s);
}
};
diff --git a/paludis/vdb_repository.cc b/paludis/vdb_repository.cc
index 2aa1855..a544ca0 100644
--- a/paludis/vdb_repository.cc
+++ b/paludis/vdb_repository.cc
@@ -532,10 +532,20 @@ VDBRepository::do_uninstall(const QualifiedPackageName & q, const VersionSpec &
}
DepAtom::Pointer
-VDBRepository::do_system_packages() const
+VDBRepository::do_package_set(const std::string & s) const
{
AllDepAtom::Pointer result(new AllDepAtom);
+ if ("everything" == s)
+ {
+ if (! _imp->entries_valid)
+ _imp->load_entries();
+
+ for (std::vector<VDBEntry>::const_iterator p(_imp->entries.begin()),
+ p_end(_imp->entries.end()) ; p != p_end ; ++p)
+ result->add_child(PackageDepAtom::Pointer(new PackageDepAtom(p->name)));
+ }
+
return result;
}
diff --git a/paludis/vdb_repository.hh b/paludis/vdb_repository.hh
index 8570d05..cda08d3 100644
--- a/paludis/vdb_repository.hh
+++ b/paludis/vdb_repository.hh
@@ -74,7 +74,7 @@ namespace paludis
virtual void do_uninstall(const QualifiedPackageName &, const VersionSpec &) const;
- virtual DepAtom::Pointer do_system_packages() const;
+ virtual DepAtom::Pointer do_package_set(const std::string &) const;
virtual bool do_sync() const;
diff --git a/src/install.cc b/src/install.cc
index fc4af0d..d140287 100644
--- a/src/install.cc
+++ b/src/install.cc
@@ -54,14 +54,17 @@ do_install()
bool had_set_targets(false), had_pkg_targets(false);
for ( ; q != q_end ; ++q)
{
- if (*q == "system")
+ if (*q == "system" || *q == "everything")
{
+ if (had_set_targets)
+ throw DoHelp("You should not specify more than one set target.");
+
had_set_targets = true;
for (p::PackageDatabase::RepositoryIterator r(
env->package_database()->begin_repositories()),
r_end(env->package_database()->end_repositories()) ; r != r_end ; ++r)
- targets->add_child((*r)->system_packages());
+ targets->add_child((*r)->package_set(*q));
}
else
{