From 137b229b33189c173e383684808f4dea9fe1f235 Mon Sep 17 00:00:00 2001 From: Enrico Zini Date: Mon, 10 May 2010 11:33:37 +0100 Subject: Big debtags code simplification no more indices to maintain, just read the text files no more int IDs and conversions to/from strings --- tools/ept-cache.cc | 6 +++--- tools/filters.h | 2 +- tools/info.cc | 4 ++-- tools/info.h | 6 ++---- tools/utils.h | 4 ++-- 5 files changed, 10 insertions(+), 12 deletions(-) (limited to 'tools') diff --git a/tools/ept-cache.cc b/tools/ept-cache.cc index 2b28eec..6ee3205 100644 --- a/tools/ept-cache.cc +++ b/tools/ept-cache.cc @@ -1,7 +1,7 @@ /* * ept-cache - Commandline interface to the ept library * - * Copyright (C) 2007 Enrico Zini + * Copyright (C) 2007--2010 Enrico Zini * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include @@ -568,7 +568,7 @@ struct Generator generateRecords(out); } - void debtagsSearch(const set& wantedTags, Consumer& out) + void debtagsSearch(const set& wantedTags, Consumer& out) { debug("Generate by querying debtags\n"); env().debtags().outputHavingTags(wantedTags, OutputInfo(filters, out)); diff --git a/tools/filters.h b/tools/filters.h index fa8c2b0..050172a 100644 --- a/tools/filters.h +++ b/tools/filters.h @@ -24,7 +24,7 @@ #include #include -#include +#include /* * * For packages diff --git a/tools/info.cc b/tools/info.cc index cd9966d..64aff2e 100644 --- a/tools/info.cc +++ b/tools/info.cc @@ -1,7 +1,7 @@ /* * ept-cache - Commandline interface to the ept library * - * Copyright (C) 2007 Enrico Zini + * Copyright (C) 2007--2010 Enrico Zini * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -101,7 +101,7 @@ void Info::wantTags() set stags = record->tag(); for (set::const_iterator i = stags.begin(); i != stags.end(); ++i) - tags.insert(env().voc().tagByName(*i)); + tags.insert(*i); } has_tags = true; } diff --git a/tools/info.h b/tools/info.h index 2cbe249..7fe6d0b 100644 --- a/tools/info.h +++ b/tools/info.h @@ -1,7 +1,7 @@ /* * ept-cache - Commandline interface to the ept library * - * Copyright (C) 2007 Enrico Zini + * Copyright (C) 2007--2010 Enrico Zini * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,8 +21,6 @@ #ifndef EPTCACHE_INFO_H #define EPTCACHE_INFO_H -#include - #include #include @@ -57,7 +55,7 @@ struct Info ept::apt::PackageRecord* record; bool has_tags; - std::set tags; + std::set tags; bool has_popcon; float popcon; diff --git a/tools/utils.h b/tools/utils.h index 3e4b283..d0e7034 100644 --- a/tools/utils.h +++ b/tools/utils.h @@ -36,9 +36,9 @@ basic_ostream& operator<<(basic_ostream& out, cons for (typename std::set::const_iterator i = tags.begin(); i != tags.end(); i++) if (i == tags.begin()) - out << i->fullname(); + out << *i; else - out << ", " << i->fullname(); + out << ", " << *i; return out; } -- cgit v1.2.3