wpkg --install-size
Options | Comments |
---|---|
--admindir | Define the administration directory, where the database of the installed packages resides. |
--debug | Define a set of flags of things to print out for debug purposes. |
--instdir | Define the installation directory, where the data files are installed on the target. |
--quiet | Request for warning messages to not be displayed. |
--root | Define the installation root path. |
--verbose | Display log information of level INFO. |
The --install-size command computes the total byte size that one or more packages take once installed. Note that the size does not include the space taken in the wpkg database which is often quite significant too (at this point we keep the data tarball so consider a little more than x2!)
This command does not recompute the size. Instead it retrieves the Installed-Size field of the package and uses that size while computing the sum of all the specified packages. The output is the total only.
IMPORTANT NOTE
A package that does not include the Installed-Size field is not sized at all by this function (i.e. its size is considered to be zero.) Note that wpkg always creates the Installed-Size field whether or not you had such a field in your control file when creating a binary package. It is actually expected that you do not create the Installed-Size field yourself. If you use another tool to create the field it may not get added automatically.
If the database and the package are both on the same hard drive, then the size should be multiplied by 2 to ensure enough space is available before installing a package. (Although the control and data tarballs remain compressed, the scripts and the control file get extracted. Plus some other files get created. So x2 will generally give you a good result. Another method would be to use the size of the package + 10% + the result of the --install-size command.)
Note that this command is similar to getting the Installed-Size field of each package using --field and summing them up.