Package: libapt-pkg-perl
Version: 0.1.22
Severity: wishlist
Tags: patch

It'd be good if the Size and Installed size fields from a package
"Version" object were available at the perl level as say $ver->{Size}
and $ver->{InstalledSize}, perhaps along the lines below.


-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i586)

Kernel: Linux 2.6.26-1-486
Locale: LANG=en_AU, LC_CTYPE=en_AU (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/dash

Versions of packages libapt-pkg-perl depends on:
ii  apt [libapt-pkg-libc6.7-6-4.6 0.7.20.2   Advanced front-end for dpkg
ii  libc6                         2.9-4      GNU C Library: Shared libraries
ii  libgcc1                       1:4.3.3-5  GCC support library
ii  libstdc++6                    4.3.3-5    The GNU Standard C++ Library v3
ii  perl-base [perlapi-5.10.0]    5.10.0-19  minimal Perl system

libapt-pkg-perl recommends no packages.

libapt-pkg-perl suggests no packages.

-- no debconf information


diff -ur libapt-pkg-perl-0.1.22.orig/AptPkg/Cache.pm libapt-pkg-perl-0.1.22/AptPkg/Cache.pm
--- libapt-pkg-perl-0.1.22.orig/AptPkg/Cache.pm	2008-02-06 00:57:58.000000000 +1100
+++ libapt-pkg-perl-0.1.22/AptPkg/Cache.pm	2009-04-04 12:57:37.000000000 +1100
@@ -131,7 +131,7 @@
 our @ISA = qw(AptPkg::hash::method);
 our @KEYS = qw(
     VerStr Section Arch ParentPkg DependsList ProvidesList FileList
-    Index Priority
+    InstalledSize Size Index Priority
 );
 
 sub ParentPkg
@@ -381,6 +381,14 @@
 A reference to an array of AptPkg::Cache::VerFile objects describing
 the packages files which include the current version.
 
+=item Size
+
+The F<.deb> file size, in bytes.
+
+=item InstalledSize
+
+The disk space used when installed, in bytes.
+
 =item Index
 
 Internal B<APT> unique reference for the version record.
diff -ur libapt-pkg-perl-0.1.22.orig/AptPkg.xs libapt-pkg-perl-0.1.22/AptPkg.xs
--- libapt-pkg-perl-0.1.22.orig/AptPkg.xs	2007-06-17 22:08:59.000000000 +1000
+++ libapt-pkg-perl-0.1.22/AptPkg.xs	2009-04-04 12:58:24.000000000 +1100
@@ -788,6 +788,22 @@
     }
 
 unsigned long
+pkgCache_VerIterator_p::InstalledSize()
+  CODE:
+    RETVAL = (*THIS->obj)->InstalledSize;
+
+  OUTPUT:
+    RETVAL
+
+unsigned long
+pkgCache_VerIterator_p::Size()
+  CODE:
+    RETVAL = (*THIS->obj)->Size;
+
+  OUTPUT:
+    RETVAL
+
+unsigned long
 pkgCache_VerIterator_p::Index()
   CODE:
     RETVAL = THIS->obj->Index();

Reply via email to