[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Synaptic-devel] Distribution selection
From: |
Panu Matilainen |
Subject: |
Re: [Synaptic-devel] Distribution selection |
Date: |
01 Oct 2003 19:16:50 +0300 |
On Tue, 2003-09-30 at 19:48, Michael Vogt wrote:
> On Tue, Sep 30, 2003 at 10:42:52AM +0300, Panu Matilainen wrote:
> > Quoting Sebastian heinlein <address@hidden>:
> [..]
> > > I was wrong on this. I haven't considered that this is actually apt
> > > pining.
> >
> > Exactly. We should pay some careful attention - here's a chance to get an
> > understandable GUI presesntation/configuration of apt pinning which by
> > fiddling
> > with apt preferences file and looking at apt-cache policy output (did it
> > understand what I did) is anything but nice.
>
> Yes, I think so as well. There are some problems inside libapt that
> makes this a bit clumsy sometimes (libapt is not really designed for
> interactive use). We have a function in the policy engine of apt to
> create a pin, but not to remove it (which is importend if we want to
> chage the default release without rereading the whole cache). I'll ask
> on the debian-deity ML and Gustaco and see if we can get something
> like this.
>
> I know that the "release" scheme is more flexible than just having
> "stable/testing/unstable" :) My problem was that I wanted to see if it
> works and I have no idea right now how I can make libapt to tell me
> what releases are available (and what origions, that might be nice as
> well). Do you have any idea Panu? Or maybe Gustavo?
Hmm, surprisingly straightforward actually :) The following code snippet
(tested in apt-cache policy routine) prints out the known components
along with their associated releases (archives) and origins:
for (pkgCache::PkgFileIterator F = Cache.FileBegin(); F.end() == false;
F++)
{
pkgIndexFile *Indx;
SrcList->FindIndex(F,Indx);
_system->FindIndex(F,Indx);
if (! F.RelStr().empty())
printf("Archive: %s, Origin: %s, Component: %s\n", F.Archive(),
F.Origin(), F.Component());
}
In my config (using www.fedora.us repository) this looks like:
Archive: stable, Origin: Fedora, Component: stable
Archive: stable, Origin: Red Hat, Component: updates
Archive: stable, Origin: Red Hat, Component: os
Archive: unstable, Origin: Fedora, Component: unstable
Archive: testing, Origin: Fedora, Component: testing
Archive: stable, Origin: Fedora, Component: stable
Archive: unstable, Origin: Fedora, Component: unstable
Archive: testing, Origin: Fedora, Component: testing
Archive: stable, Origin: Fedora, Component: stable
Archive: unstable, Origin: Fedora, Component: unstable
Archive: testing, Origin: Fedora, Component: testing
Archive: stable, Origin: Fedora, Component: stable
Archive: stable, Origin: Red Hat, Component: updates
Archive: stable, Origin: Red Hat, Component: os
- Panu -