aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAvatar Mike Kelly <pioto@pioto.org> 2008-01-02 02:24:25 +0000
committerAvatar Mike Kelly <pioto@pioto.org> 2008-01-02 02:24:25 +0000
commit13c157b52c95e211da4aa1bbdca88ceb623915a9 (patch)
treee67d3c62ece62aa140b9b7af95031e6146c4e227 /src
parent5a7715734ec60a267d06347cca40c1223dd9d539 (diff)
downloadpaludis-13c157b52c95e211da4aa1bbdca88ceb623915a9.tar.gz
paludis-13c157b52c95e211da4aa1bbdca88ceb623915a9.tar.xz
Squashed commit of the following:
commit 9937f3649f907f15dda40ab89918be0e5c55aedd Author: Mike Kelly <pioto@pioto.org> Date: Tue Jan 1 21:10:14 2008 -0500 Rename things in ruby properly. commit dff06bbcb4f604a49e5627230bc32c921684144a Author: Mike Kelly <pioto@pioto.org> Date: Tue Jan 1 21:01:18 2008 -0500 Fix doxygen for size_of_all_distfiles_key(). commit f19edca2fbc6542eb81874091096f83544a578d3 Author: Mike Kelly <pioto@pioto.org> Date: Tue Jan 1 19:57:12 2008 -0500 Show stuff even with --compact. commit 1fc4e6c2071dbc110b353407a1bdb4811c66b7f1 Author: Mike Kelly <pioto@pioto.org> Date: Tue Jan 1 18:54:45 2008 -0500 Don't make size keys if Manifest doesn't exist. commit 4c98106f7a4ff074549418c49290bbbf5655bca9 Author: Mike Kelly <pioto@pioto.org> Date: Tue Jan 1 18:22:39 2008 -0500 Add some test cases. Fix a bug where we'd segfault for malformed ebuilds/unknown EAPIs. commit 27ccfbf29642a4f73f320d385c9d92d7d3938659 Author: Mike Kelly <pioto@pioto.org> Date: Mon Dec 31 17:38:13 2007 -0500 More tweaking based on feedback from ciaranm and dleverton. commit 3258519520edde4b4e894ef7729ed367f413d120 Author: Mike Kelly <pioto@pioto.org> Date: Mon Dec 31 16:01:23 2007 -0500 Make a separate pretty_print() member of MetadataSizeKey. Add info to the --install --pretend output. commit 4cae2bee90585f95037ba3412482f6e4aeedbe87 Author: Mike Kelly <pioto@pioto.org> Date: Mon Dec 31 03:49:49 2007 -0500 fix precision stuff commit 3c01abd5963e25184ce4da2d2d06feab9f8af37f Author: Mike Kelly <pioto@pioto.org> Date: Mon Dec 31 03:39:15 2007 -0500 REALLY fix it, i think... commit 5514cb538ade381710ddfbeb58c7427636a267c4 Author: Mike Kelly <pioto@pioto.org> Date: Mon Dec 31 03:36:35 2007 -0500 forgot the .hh file commit c4605c064eddd23f224cc81a2df1b6782417fdfd Author: Mike Kelly <pioto@pioto.org> Date: Mon Dec 31 03:35:21 2007 -0500 Don't use mirror stuff, that just makes us double count things... commit 6d29e492b11bebba37edd3bf056af72a02d3194e Author: Mike Kelly <pioto@pioto.org> Date: Mon Dec 31 02:43:21 2007 -0500 More cleanup. Make us have spiffy decimal point output. commit 9916a82c8a07922a6a08f14c0b7837b760f646fa Author: Mike Kelly <pioto@pioto.org> Date: Mon Dec 31 01:04:28 2007 -0500 Change MetadataLongKey to MetadataSizeKey. Add spiffy formatting for paludis --query. commit 7e794e3ef7f6429e61866b30db3b3a81e2be99d2 Author: Mike Kelly <pioto@pioto.org> Date: Sun Dec 30 23:43:53 2007 -0500 Redo stuff so that keys are only populated on demand. commit 31200c83ce7c9eac88dbfe1c0cc537abc6c3df28 Author: Mike Kelly <pioto@pioto.org> Date: Sun Dec 30 20:03:38 2007 -0500 D'oh! We need to add_metadata_key() our keys! commit 471180b0c95dff38ba634550db93912b47f145dc Author: Mike Kelly <pioto@pioto.org> Date: Sun Dec 30 18:21:38 2007 -0500 Properly label the key for all distfiles. commit c4f0d383eefd018531cc9b57eed2df8ccb6c5ff9 Author: Mike Kelly <pioto@pioto.org> Date: Sun Dec 30 01:40:35 2007 -0500 Fix a typo. commit 8339d89700701f1fda71d515015b6c67f8ab5b04 Author: Mike Kelly <pioto@pioto.org> Date: Sun Dec 30 01:25:40 2007 -0500 Add the rest of the _key() stuff, probably... commit cdf94795912d4f04a99ca93de6ca3063879d8567 Author: Mike Kelly <pioto@pioto.org> Date: Sun Dec 30 00:12:06 2007 -0500 Fixes from ciaranm and rbrown. commit f04f5cc62f5be499b5e1865b12aea871cc48daec Author: Mike Kelly <pioto@pioto.org> Date: Sat Dec 29 00:02:43 2007 -0500 Further work. Add visit() functions to the Visitor<MetadataKeyVisitorTypes> visitirs. commit 4251eef7d451ce89b05dbb671a19f05005a2e3bd Author: Mike Kelly <pioto@pioto.org> Date: Fri Dec 28 01:13:53 2007 -0500 More work... almost there, maybe? commit 6da4cf9ba492f4435dbc5a04c4b6978a99edd7d6 Author: Mike Kelly <pioto@pioto.org> Date: Thu Dec 27 22:33:03 2007 -0500 add stub funcs so things build commit d6136e2c2ba4a2075ab36e9ab54a97460692f208 Author: Mike Kelly <pioto@pioto.org> Date: Thu Dec 27 16:16:07 2007 -0500 Add do-nothing implementations to every PackageID implementation other than EbuildID. commit 4a54dca0d88f846e58f5ce0a78a35e1771805f1a Author: Mike Kelly <pioto@pioto.org> Date: Thu Dec 27 02:20:56 2007 -0500 Clean some stuff up, remove unneeded stuff, add some other stuff. commit 4b3824d2cc3a6178e5976d2c0a78e180a4f7c4a8 Author: Mike Kelly <pioto@pioto.org> Date: Wed Dec 26 11:06:40 2007 -0500 Continued work w/ after some comments from ciaranm. * Using a MetadataLongKey instead of a special one for size_t. * Renamed MetadataDistfilesSizeKeyVisitor to DistfilesSizeVisitor. * Always getting our size from Manifest2. commit d84cf9144b49566895457209b80fa0c634a9b749 Author: Mike Kelly <pioto@pioto.org> Date: Mon Dec 24 18:26:43 2007 -0500 Initial work on distfile size metadata key stuff.
Diffstat (limited to 'src')
-rw-r--r--src/clients/gtkpaludis/libgtkpaludis/version_info_model.cc5
-rw-r--r--src/clients/inquisitio/key_extractor.cc5
-rw-r--r--src/clients/instruo/instruo.cc5
-rw-r--r--src/clients/paludis/applets.cc5
-rw-r--r--src/clients/paludis/info.cc5
-rw-r--r--src/clients/qualudis/qualudis.cc5
-rw-r--r--src/output/console_install_task.cc23
-rw-r--r--src/output/console_install_task.hh1
-rw-r--r--src/output/console_query_task.cc17
-rw-r--r--src/output/mask_displayer.cc5
10 files changed, 76 insertions, 0 deletions
diff --git a/src/clients/gtkpaludis/libgtkpaludis/version_info_model.cc b/src/clients/gtkpaludis/libgtkpaludis/version_info_model.cc
index 155cd6223..bf154ee6d 100644
--- a/src/clients/gtkpaludis/libgtkpaludis/version_info_model.cc
+++ b/src/clients/gtkpaludis/libgtkpaludis/version_info_model.cc
@@ -174,6 +174,11 @@ namespace gtkpaludis
got_key(k, markup_escape(stringify(k.value())));
}
+ void visit(const MetadataSizeKey & k)
+ {
+ got_key(k, markup_escape(stringify(k.value())));
+ }
+
void visit(const MetadataTimeKey & k)
{
char buf[255];
diff --git a/src/clients/inquisitio/key_extractor.cc b/src/clients/inquisitio/key_extractor.cc
index ccdfa74dd..250d59855 100644
--- a/src/clients/inquisitio/key_extractor.cc
+++ b/src/clients/inquisitio/key_extractor.cc
@@ -202,6 +202,11 @@ namespace
result = _m(s.value());
}
+ void visit(const MetadataSizeKey & s)
+ {
+ result = _m(stringify(s.value()));
+ }
+
void visit(const MetadataTimeKey & s)
{
result = _m(stringify(s.value()));
diff --git a/src/clients/instruo/instruo.cc b/src/clients/instruo/instruo.cc
index 231a169b7..1813f3da0 100644
--- a/src/clients/instruo/instruo.cc
+++ b/src/clients/instruo/instruo.cc
@@ -55,6 +55,11 @@ namespace
const std::string & PALUDIS_ATTRIBUTE((unused)) s(k.value());
}
+ void visit(const MetadataSizeKey & k)
+ {
+ long PALUDIS_ATTRIBUTE((unused)) t(k.value());
+ }
+
void visit(const MetadataPackageIDKey & k)
{
const tr1::shared_ptr<const PackageID> & PALUDIS_ATTRIBUTE((unused)) p(k.value());
diff --git a/src/clients/paludis/applets.cc b/src/clients/paludis/applets.cc
index 5c32a1a88..f439113c6 100644
--- a/src/clients/paludis/applets.cc
+++ b/src/clients/paludis/applets.cc
@@ -57,6 +57,11 @@ namespace
std::cout << k.value() << std::endl;
}
+ void visit(const MetadataSizeKey & k)
+ {
+ std::cout << k.value() << std::endl;
+ }
+
void visit(const MetadataFSEntryKey & k)
{
std::cout << k.value() << std::endl;
diff --git a/src/clients/paludis/info.cc b/src/clients/paludis/info.cc
index 3ae98fb47..7bc2696a0 100644
--- a/src/clients/paludis/info.cc
+++ b/src/clients/paludis/info.cc
@@ -82,6 +82,11 @@ namespace
cout << std::setw(30) << (indent + k.human_name() + ":") << " " << k.value() << endl;
}
+ void visit(const MetadataSizeKey & k)
+ {
+ cout << std::setw(30) << (indent + k.human_name() + ":") << " " << k.value() << endl;
+ }
+
void visit(const MetadataFSEntryKey & k)
{
cout << std::setw(30) << (indent + k.human_name() + ":") << " " << k.value() << endl;
diff --git a/src/clients/qualudis/qualudis.cc b/src/clients/qualudis/qualudis.cc
index 37b6e50b4..eae8324c3 100644
--- a/src/clients/qualudis/qualudis.cc
+++ b/src/clients/qualudis/qualudis.cc
@@ -130,6 +130,11 @@ namespace
stream << k.raw_name() << ": " << k.value() << "\n";
}
+ void visit(const MetadataSizeKey & k)
+ {
+ stream << k.raw_name() << ": " << k.value() << "\n";
+ }
+
void visit(const MetadataTimeKey & k)
{
stream << k.raw_name() << ": " << k.value() << "\n";
diff --git a/src/output/console_install_task.cc b/src/output/console_install_task.cc
index 84b15eb73..9de4e6cb6 100644
--- a/src/output/console_install_task.cc
+++ b/src/output/console_install_task.cc
@@ -370,6 +370,7 @@ ConsoleInstallTask::on_display_merge_list_entry(const DepListEntry & d)
display_merge_list_entry_package_tags(d, m);
display_merge_list_entry_description(d, existing_repo, existing_slot_repo, m);
display_merge_list_entry_use(d, existing_repo, existing_slot_repo, m);
+ display_merge_list_entry_distsize(d, m);
if (want_compact())
display_merge_list_entry_package_tags(d, m);
display_merge_list_entry_end(d, m);
@@ -1158,6 +1159,28 @@ ConsoleInstallTask::display_merge_list_entry_use(const DepListEntry & d,
}
void
+ConsoleInstallTask::display_merge_list_entry_distsize(const DepListEntry & d,
+ const DisplayMode m)
+{
+ if (normal_entry != m && suggested_entry != m)
+ return;
+
+ if (! d.package_id->size_of_download_required_key() || d.package_id->size_of_download_required_key()->value() == 0)
+ return;
+
+ if (want_compact())
+ output_no_endl(" ");
+ else
+ {
+ output_endl();
+ output_no_endl(" ");
+ }
+
+ output_stream() << d.package_id->size_of_download_required_key()->pretty_print()
+ << " to download";
+}
+
+void
ConsoleInstallTask::display_merge_list_entry_non_package_tags(const DepListEntry & d, const DisplayMode m)
{
if (d.tags->empty())
diff --git a/src/output/console_install_task.hh b/src/output/console_install_task.hh
index f18ed8644..cb80ac6a6 100644
--- a/src/output/console_install_task.hh
+++ b/src/output/console_install_task.hh
@@ -226,6 +226,7 @@ namespace paludis
virtual void display_merge_list_entry_use(const DepListEntry &,
tr1::shared_ptr<const PackageIDSequence>,
tr1::shared_ptr<const PackageIDSequence>, const DisplayMode);
+ virtual void display_merge_list_entry_distsize(const DepListEntry &, const DisplayMode);
virtual void display_merge_list_entry_non_package_tags(const DepListEntry &, const DisplayMode);
virtual void display_merge_list_entry_package_tags(const DepListEntry &, const DisplayMode);
virtual void display_merge_list_entry_end(const DepListEntry &, const DisplayMode);
diff --git a/src/output/console_query_task.cc b/src/output/console_query_task.cc
index 50e0c2238..dbd0d7f3b 100644
--- a/src/output/console_query_task.cc
+++ b/src/output/console_query_task.cc
@@ -519,6 +519,23 @@ namespace
}
}
+ void visit(const MetadataSizeKey & k)
+ {
+ if (k.type() == type)
+ {
+ if (task->want_raw())
+ {
+ task->output_left_column(k.raw_name() + ":", in);
+ task->output_right_column(stringify(k.value()));
+ }
+ else
+ {
+ task->output_left_column(k.human_name() + ":", in);
+ task->output_right_column(k.pretty_print());
+ }
+ }
+ }
+
void visit(const MetadataSectionKey & k)
{
if (k.type() == type)
diff --git a/src/output/mask_displayer.cc b/src/output/mask_displayer.cc
index a1d0e4988..7e4c83fd2 100644
--- a/src/output/mask_displayer.cc
+++ b/src/output/mask_displayer.cc
@@ -69,6 +69,11 @@ namespace
s << k.value();
}
+ void visit(const MetadataSizeKey & k)
+ {
+ s << k.value();
+ }
+
void visit(const MetadataSectionKey & k)
{
s << "(";