[Yum-devel] yum-downloader RFE

Panu Matilainen pmatilai at laiskiainen.org
Mon Jun 13 22:07:53 UTC 2005


On Mon, 2005-06-13 at 16:46 -0400, seth vidal wrote:
> On Mon, 2005-06-13 at 21:01 +0200, Gijs Hollestelle wrote:
> > On 6/13/05, Panu Matilainen <pmatilai at laiskiainen.org> wrote:
> > > To fix this we'll need to populate the pkgSack on source operations with
> > > binaries as well, not just src.rpm info, which IIRC will cause some
> > > complications: if memory serves there was some place in yum which will
> > > refuse to give out src.rpm if binary packages are present in the sack but
> > > don't remember the exact details right now.
> > Hi all,
> > 
> > To ease the discussion let me summarize the RFE and the problem. The
> > RFE asks for yumdownloader to be smart enough to figure out that
> > yumdownloader --source nscd should download the glibc source rpm
> > because that is what the the nscd package is built from.
> > 
> > The problem here is that when we use src for the archtiecture there is
> > no nscd package, or any implied relation between the glibc src package
> > and the nscd package (if the glibc src package would provide the nscd
> > src package things would be easy, but unfortunately this is not the
> > case).
> > 
> > So we will need binary package information in order to find out what
> > src rpm nscd comes from. Even if we have that information there is a
> > second problem, namely that the binary nscd package lists the source
> > rpm by its filename, not by its nevra info (we can probably parse that
> > out of the filename 99% of the time)
> > 
> > My idea to solve this is as follows (the following only holds for when
> > --source is present):
> > 
> > 1. Setup yum with architecture all allowed architectures + ['src']
> > 2. For every package see if there is a package with architecture src in matched
> > 3. If 2 is not true, then for every package binary package in matched
> > that has no matching src package try to do the match again, this time
> > not using the package name itself but using the package name in the
> > sourcerpm header field of the matched packages.
> > 
> > If people can think of a better / easier way please let me know if not
> > I'll try and hack up the above 'algorithm' later today or tomorrow.

Mm.. why step 2? It is possible to reliably parse the n-v-r out of the
sourcerpm tag, so just look up the sourcerpm name from the given binary
and then try to locate that. But see my earlier comments, last I looked
there were some complications there with yum refusing to give out
src.rpm's if there are binaries of that name in pkgSack because packages
with 'src' arch get excluded or something like that. Need to recheck
what was the exact issue, it's been a while since I looked at this
thingy...

> > 
> 
> Another option is to say 'this is a silly request and break up the info
> into two commands'
> 
> repoquery --source nscd
> yum-downloader --src output_of_the_above.src.rpm

Except that repoquery will fail there exactly like yum-downloader, and
precisely for the same reason: when called with --source, it only
populates the sack with info from src.rpm's, and there is no nscd
src.rpm.
This will however work:

repoquery --qf "%{sourcerpm}" nscd
yum-downloader --src output_of_the_above.src.rpm


	- Panu -




More information about the Yum-devel mailing list