[pacman-dev] [PATCH 2/2] ensure package download sizes are invalidated when an error occurs
Jonathan Conder
j at skurvy.no-ip.org
Sun May 16 16:22:01 EDT 2010
Hi
On Sun, 2010-05-16 at 14:54 +0200, Nagy Gabor wrote:
> The spirit of this patch is better, but it is still not perfect, because
> of the -Sw (PM_TRANS_FLAG_DOWNLOADONLY) case. That return(0) can also be
> changed to goto error, and I can see one more RET_ERR in the function.
See my other patch for the -Sw case. I seem to have a tendency to
overlook the RET_ERR ones though...
> I just note that in case of error-free -S commit operation, this
> code-part is needless/overkill, because the target pkgcache packages are
> replaced in the integrity-check part by the pmpkg_t of pkg.tar.xz file
> (line 949), and then every download_size is either 0 or unset.
Ok, good point, I didn't notice that. In that case I think we should
move this back to where it was originally, but make sure only packages
for the current repo get unset. This might be a good time to introduce a
pmpkg_t parameter to the download callback as well.
> An other side note:
> I have some bad feelings when I see many foo->download_size in this
> codepart. We have a good access function for this. I know that atm all
> download_sizes are filled in correctly at the end of sync_prepare, but
> that may be changed later. But this direct access causes some nanosec
> speedup, so I dunno. :-)
I agree, but I don't mind either way. Since PM_ERR_PKG_INVALID_NAME is
checked in the commit I'm not sure we even need the pre-computation any
more. I'll have a closer look when I get the chance.
Jonathan
More information about the pacman-dev
mailing list