[Yum-devel] RFC: Possible solutions for multiple nevra pkgs with different pkgKey's

James Antill james.antill at redhat.com
Sun Feb 10 21:12:12 UTC 2008


 So atm. it's possible for create repo to create metdata which has the
same nevra pkg (with the same pkgId) multiple times. Eg.

mkdir tmp
mkdir tmp/x tmp/y
for i in x y; cp pkg.rpm tmp/$i
createrepo tmp

...this is specifically causing problems with excludes, as
parsePackages() uses misc.unique on it's return values, which uses
pkg.__hash__ which just uses repoid and envra. This means we only
exclude one of the packages, and so then see the other one later.

 So here's my list of "obvious" possible solutions:

1. Add an argument to parsePackages() to give "unique" results based on
just repo.id and pkg.pkgKey, used just be excludes atm.

2. Change createrepo to unique based on pkgId.

3. Change YumSqlitePackageSack.delPackage() to be based on pkgId (but
still be a set).

4. Change YumSqlitePackageSack.delPackage() to be based on pkg.__hash__.

5. Change pkg.__hash__ to use repo.id and pkg.pkgKey, and deal with the
fallout.


...now I think #5 is a bad idea (read a lot of work). It's possible that
people can have two packages in the same repo. with the same envra data
that have different pkgKey's and pkgId's (due to signing). So I don't
think _just_ #2 fixes the problem, or #3. #4 might work, but means we
need a pkg object -- or at least full repo/envra.

 I've done #1, and it's available:

http://people.redhat.com/jantill/yum/yum-exclude-all-pkgs.patch

...and I think it's also worth doing #2 as well, because it just seems
like a waste to have repeated data in the MD.

 Anyone else have any ideas? Or any different preferences to #1 and #2?


[1] Can anyone think of a reason you'd have different pkgId/pkgKey but
same envra and want to distinguish?

-- 
James Antill <james.antill at redhat.com>
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.baseurl.org/pipermail/yum-devel/attachments/20080210/a581ea6f/attachment.pgp 


More information about the Yum-devel mailing list