aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-15 17:55:52 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-15 17:55:52 +0000
commit66eda5854ce31b32280f34bd60708dd57def7957 (patch)
treec2545e7a97830ba8adbbd6fd35b59fcf2814fc3e
parent2b223ef16cb52f52c8cceac58dc5aefabb437079 (diff)
downloadpaludis-66eda5854ce31b32280f34bd60708dd57def7957.tar.gz
paludis-66eda5854ce31b32280f34bd60708dd57def7957.tar.xz
Dep atom, dep list entry tagging. Tag set packages.
-rw-r--r--paludis/dep_atom.hh17
-rw-r--r--paludis/dep_list.cc16
-rw-r--r--paludis/dep_list.hh5
-rw-r--r--paludis/portage_repository.cc5
-rw-r--r--paludis/util/smart_record.hh.m42
-rw-r--r--paludis/vdb_repository.cc13
-rw-r--r--src/colour.hh3
-rw-r--r--src/install.cc5
8 files changed, 55 insertions, 11 deletions
diff --git a/paludis/dep_atom.hh b/paludis/dep_atom.hh
index 258aa94..bd3db6f 100644
--- a/paludis/dep_atom.hh
+++ b/paludis/dep_atom.hh
@@ -234,6 +234,7 @@ namespace paludis
VersionOperator _version_operator;
CountedPtr<VersionSpec, count_policy::ExternalCountTag> _version_spec;
CountedPtr<SlotName, count_policy::ExternalCountTag> _slot;
+ std::string _tag;
public:
/**
@@ -285,6 +286,22 @@ namespace paludis
typedef CountedPtr<PackageDepAtom, count_policy::InternalCountTag> Pointer;
typedef CountedPtr<const PackageDepAtom, count_policy::InternalCountTag> ConstPointer;
+
+ /**
+ * Fetch our tag.
+ */
+ const std::string & tag() const
+ {
+ return _tag;
+ }
+
+ /**
+ * Set our tag.
+ */
+ void set_tag(const std::string & s)
+ {
+ _tag = s;
+ }
};
/**
diff --git a/paludis/dep_list.cc b/paludis/dep_list.cc
index 30830b0..c53aaf8 100644
--- a/paludis/dep_list.cc
+++ b/paludis/dep_list.cc
@@ -361,6 +361,12 @@ DepList::visit(const PackageDepAtom * const p)
throw CircularDependencyError(i, next(i));
}
+ if (! p->tag().empty())
+ {
+ std::set<std::string> new_tags(i->get<dle_tag>());
+ new_tags.insert(p->tag());
+ i->set<dle_tag>(new_tags);
+ }
return;
}
}
@@ -399,6 +405,9 @@ DepList::visit(const PackageDepAtom * const p)
}
std::list<DepListEntry>::iterator merge_entry;
+ std::set<std::string> tags;
+ if (! p->tag().empty())
+ tags.insert(p->tag());
if (! match)
{
if (! installed->empty())
@@ -411,7 +420,7 @@ DepList::visit(const PackageDepAtom * const p)
DepListEntry(installed->last()->get<pde_name>(),
installed->last()->get<pde_version>(), metadata,
installed->last()->get<pde_repository>(),
- true, false, false, true));
+ true, false, false, true, tags));
}
else
return;
@@ -423,7 +432,7 @@ DepList::visit(const PackageDepAtom * const p)
merge_entry = _imp->merge_list.insert(_imp->merge_list_insert_pos,
DepListEntry(match->get<pde_name>(), match->get<pde_version>(),
metadata, match->get<pde_repository>(),
- false, false, false, false));
+ false, false, false, false, tags));
/* if we provide things, also insert them. */
if ((! metadata->get(vmk_provide).empty()) && ! merge_entry->get<dle_skip_install>())
@@ -456,7 +465,8 @@ DepList::visit(const PackageDepAtom * const p)
p_metadata->set(vmk_virtual, stringify(merge_entry->get<dle_name>()));
_imp->merge_list.insert(next(merge_entry),
DepListEntry(pp.package(), merge_entry->get<dle_version>(),
- p_metadata, merge_entry->get<dle_repository>(), true, true, true, false));
+ p_metadata, merge_entry->get<dle_repository>(), true, true, true, false,
+ std::set<std::string>()));
}
}
diff --git a/paludis/dep_list.hh b/paludis/dep_list.hh
index d5bec97..471f815 100644
--- a/paludis/dep_list.hh
+++ b/paludis/dep_list.hh
@@ -25,6 +25,7 @@
#include <iterator>
#include <list>
#include <ostream>
+#include <set>
#include <paludis/dep_atom.hh>
#include <paludis/name.hh>
#include <paludis/qa/environment.hh>
@@ -48,6 +49,7 @@ namespace paludis
dle_has_trypredeps, ///< RDEPEND (if rdepend_post) done?
dle_has_postdeps, ///< PDEPEND done?
dle_skip_install, ///< Skip installing this?
+ dle_tag, ///< Our tag
last_dle ///< Number of entries
};
@@ -64,7 +66,8 @@ namespace paludis
SmartRecordKey<dle_has_predeps, bool>,
SmartRecordKey<dle_has_trypredeps, bool>,
SmartRecordKey<dle_has_postdeps, bool>,
- SmartRecordKey<dle_skip_install, bool>
+ SmartRecordKey<dle_skip_install, bool>,
+ SmartRecordKey<dle_tag, std::set<std::string> >
{
};
diff --git a/paludis/portage_repository.cc b/paludis/portage_repository.cc
index da48138..2abf377 100644
--- a/paludis/portage_repository.cc
+++ b/paludis/portage_repository.cc
@@ -351,8 +351,9 @@ Implementation<PortageRepository>::add_profile_r(const FSEntry & f) const
continue;
Context context_line("When parsing line '" + *line + "':");
- system_packages->add_child(PackageDepAtom::Pointer(new PackageDepAtom(
- line->substr(1))));
+ PackageDepAtom::Pointer atom(new PackageDepAtom(line->substr(1)));
+ atom->set_tag("system");
+ system_packages->add_child(atom);
}
}
}
diff --git a/paludis/util/smart_record.hh.m4 b/paludis/util/smart_record.hh.m4
index 9feafb7..6fd7f72 100644
--- a/paludis/util/smart_record.hh.m4
+++ b/paludis/util/smart_record.hh.m4
@@ -20,7 +20,7 @@ dnl vim: set ft=cpp et sw=4 sts=4 :
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-define(`max_record_size', `8')
+define(`max_record_size', `10')
define(`forloop', `pushdef(`$1', `$2')_forloop(`$1', `$2', `$3', `$4')popdef(`$1')')
define(`_forloop', `$4`'ifelse($1, `$3', , `define(`$1', incr($1))_forloop(`$1', `$2', `$3', `$4')')')
#endif
diff --git a/paludis/vdb_repository.cc b/paludis/vdb_repository.cc
index e2dee40..e8d08a2 100644
--- a/paludis/vdb_repository.cc
+++ b/paludis/vdb_repository.cc
@@ -591,7 +591,11 @@ VDBRepository::do_package_set(const std::string & s) const
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)));
+ {
+ PackageDepAtom::Pointer atom(new PackageDepAtom(p->name));
+ atom->set_tag("everything");
+ result->add_child(atom);
+ }
return result;
}
@@ -605,8 +609,11 @@ VDBRepository::do_package_set(const std::string & s) const
for (LineConfigFile::Iterator line(world.begin()), line_end(world.end()) ;
line != line_end ; ++line)
- result->add_child(PackageDepAtom::Pointer(new PackageDepAtom(
- QualifiedPackageName(*line))));
+ {
+ PackageDepAtom::Pointer atom(new PackageDepAtom(QualifiedPackageName(*line)));
+ atom->set_tag("world");
+ result->add_child(atom);
+ }
}
else
Log::get_instance()->message(ll_warning, "World file '" + stringify(_imp->world_file) +
diff --git a/src/colour.hh b/src/colour.hh
index 463941a..615201d 100644
--- a/src/colour.hh
+++ b/src/colour.hh
@@ -44,7 +44,8 @@ enum Colour
cl_visible = cl_flag_on,
cl_masked = cl_flag_off,
cl_heading = cl_bold_green,
- cl_updatemode = cl_yellow
+ cl_updatemode = cl_yellow,
+ cl_tag = cl_yellow
};
bool use_colour() PALUDIS_ATTRIBUTE((pure));
diff --git a/src/install.cc b/src/install.cc
index 684d9f5..ad8300c 100644
--- a/src/install.cc
+++ b/src/install.cc
@@ -243,6 +243,11 @@ do_install()
cout << " " << colour(cl_flag_off, "-" + p::stringify(*i));
}
+ /* display tag */
+ if (! dep->get<p::dle_tag>().empty())
+ cout << " " << colour(cl_tag, "<" + p::join(dep->get<p::dle_tag>().begin(),
+ dep->get<p::dle_tag>().end(), ",") + ">");
+
cout << endl;
}