[pacman-dev] [PATCH] get_filename : use the FILENAME field from the db.

Xavier shiningxc at gmail.com
Thu Feb 14 03:07:49 EST 2008


Dan McGee wrote:
>>          return pkg->filename;
>> diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
>> index ced20c5..e03a757 100644
>> --- a/lib/libalpm/sync.c
>> +++ b/lib/libalpm/sync.c
>> @@ -689,6 +689,7 @@ static alpm_list_t *pkg_upgrade_delta_path(pmpkg_t *newpkg, pmdb_t *db_local)
>>
>>          if(oldpkg) {
>>                  const char *oldname = alpm_pkg_get_filename(oldpkg);
>> +               ASSERT(oldname[0] != '\0', RET_ERR(PM_ERR_PKG_INVALID_NAME, NULL));
> Hmm. I wonder if we need some more testing here. Did this never return
> the empty string in any pactests, or anything else? I also don't know
> that a locally installed package will store what filename it was
> installed from. I wonder if we just broke all of the delta
> assumptions. Or what is 'oldpkg' here?
>

Oh crap, but that means we have a bigger issue here. The delta code 
needs the filename of the locally installed package, and we don't store 
that filename in the local db. So it actually relies on the broken way 
to construct the filename.
Well, it looks like it works in a default database generated by repo-add 
(where filename = name-version-arch.pkgext), so that probably explains 
why it worked fine with pacman-git and delta-test repo.
However, all official databases (core,extra,testing,unstable,community) 
breaks this assumption for most packages.




More information about the pacman-dev mailing list