Bug 325922

Summary: Zypper shows wrong overall download size when delta rpms are used
Product: [openSUSE] openSUSE 11.2 Reporter: Robin Knapp <robin.knapp>
Component: libzyppAssignee: E-mail List <zypp-maintainers>
Status: RESOLVED INVALID QA Contact: Stanislav Visnovsky <visnov>
Severity: Minor    
Priority: P3 - Medium CC: kkaempf, ma
Version: unspecified   
Target Milestone: unspecified   
Hardware: Other   
OS: Other   
Whiteboard: patches-welcome
Found By: Beta-Customer Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on: 410897    
Bug Blocks:    

Description Robin Knapp 2007-09-18 09:22:39 UTC
The overall download size reported by zypper does not consider delta rpm size (and maybe patch rpms size, too):


vmware:~ # zypper in -t patch kernel
* Reading repository 'openSUSE-10.3-Updates' cache
* Reading repository 'FACTORY - Main Repository (DEBUG)' cache
* Reading repository 'openSUSE-10.3-OSS-KDE 10.3' cache
* Reading repository 'KDE4' cache
* Reading installed packages [100%]


The following package is going to be upgraded:
  kernel-default

The following NEW patch is going to be installed:
  kernel

Overall download size: 20.1 M. After the operation, 155.0 B will be freed.
Continue? [yes/no]: y
[...]

Downloading package kernel-default-2.6.22.5-12.i586, 20.1 M (62.5 M unpacked)
Downloading delta: ./rpm/i586/kernel-default-2.6.22.5-10_12.i586.delta.rpm, 4.4 M
Downloading: kernel-default-2.6.22.5-10_12.i586.delta.rpm
* Downloading [100%]
Applying delta: /var/adm/mount/AP_0x0000000d/rpm/i586/kernel-default-2.6.22.5-10_12.i586.delta.rpm
* Installing: kernel-default-2.6.22.5-12 [100%]
WARNING: One of installed patches requires a reboot of your machine. Please do it as soon as possible.
Comment 1 Klaus Kämpf 2007-09-18 09:31:03 UTC
Michael, please have a look. I assume the "Downloading" output is triggered by a callback. Why is the 'full package download' callback triggered at all ?
Comment 2 Michael Andres 2007-09-18 10:59:51 UTC
There are no different kinds of 'package download' callbacks. 
In fact there is one and it is called 'provide package'.

Starting to provide a package, we don't know what will be downloaded. If we find a delta candidate, we may give it a try and download it. If applydeltarpm fails for some reason, we try another delta or look for a patch. And if all fails we try the full package. 

'provide package start' is reported, and each file we download is reported.

So it should be:

Providing package kernel-default-2.6.22.5-12.i586
  Downloading delta: kernel-default-2.6.22.5-10_12.i586.delta.rpm, 4.4 M
   Applying delta: ...
    Delta failed. Try next:
  Downloading patch: kernel-default-2.6.22.5-12, 8 M
   Patch failed. Try next:
  Downloading package kernel-default-2.6.22.5-12.i586, 20.1 M 

Comment 3 Jan Kupec 2007-09-18 13:32:35 UTC
Comment #1 #2, thanx for the clarification. Question of integrating of the media callbacks into the rest of libzypp is something we should certainly have a look at.

About the original bug, hmm.., having this patch/delta stuff around, it will be a bit tricky to determine the download size. But at least for the success scenario (applying delta succeded) it could be accurate.

Zypper will need to determine which file will zypp try to download to do this. Do we already have something to get that info from zypp?
Comment 6 Jan Kupec 2009-07-13 18:05:52 UTC
Still happens in 11.2
Comment 8 Michael Andres 2016-01-29 15:15:27 UTC
As it can't be predicted whether application of the delta will actually be possible, overall download size will always assume the worst case; i.e. download the full package.