[pacman-dev] Disk Space

Aaron Griffin aaronmgriffin at gmail.com
Thu Feb 26 12:06:55 EST 2009


On Wed, Feb 25, 2009 at 8:34 PM, Matthew Wood <ybotspawn at gmail.com> wrote:
> I'm a little new to package management coding, so forgive my stupid
> question, but I'm wondering if there is a way to get the current package
> size.  For example, like Aarons example, if foobar-1.0 is installed, and we
> got the size of foobar then we should have a reasonable size estimate of
> foobar-1.1.  If we took that estimate, multiply by 10% and compare that
> number to the disk space remaining, would that catch 99% of the errors?  If
> there isn't a current mechanism we could have a function that adds the total
> size of all the installed apps files and return that to the upgrade
> function.  What about that coupled with a prompt if disk space seems low,
> say below 100-200 mb?  I'd be willing to help with whatever patches are
> necessary for this.

See lib/libalpm/package.h for the package structure:

struct __pmpkg_t {
...snip...
  off_t size;
  off_t isize;
...snip...
};

size is the size of the package (compressed size), isize is the
"installed size" (uncompressed size)


More information about the pacman-dev mailing list