[PATCH 3/3] Fix an issue in the previous pre-existing repo kickstart patch.

Chris Lumens clumens at redhat.com
Mon Jan 19 15:22:24 UTC 2015


> > diff --git a/pyanaconda/packaging/dnfpayload.py b/pyanaconda/packaging/dnfpayload.py
> > index 21c68b8..214988e 100644
> > --- a/pyanaconda/packaging/dnfpayload.py
> > +++ b/pyanaconda/packaging/dnfpayload.py
> > @@ -227,8 +227,23 @@ class DNFPayload(packaging.PackagePayload):
> >          if mirrorlist:
> >              repo.mirrorlist = mirrorlist
> >          repo.sslverify = not (ksrepo.noverifyssl or flags.noverifyssl)
> > -        repo.enable()
> > -        self._base.repos.add(repo)
> > +
> > +        # If this repo is already known, it's one of two things:
> > +        # (1) The user is trying to do "repo --name=updates" in a kickstart file
> > +        #     and we should just know to enable the already existing on-disk
> > +        #     repo config.
> > +        # (2) It's a duplicate, and we need to delete the existing definition
> > +        #     and use this new one.  The highest profile user of this is livecd
> > +        #     kickstarts.
> > +        if repo.id in self._base.repos:
> > +            if not url and not mirrorlist:
> > +                self._base.repos[repo.id].enable()
> > +            else:
> > +                self._base.repos.pop(repo.id)
> I must admit I don't understand this line. How does the new repo become
> enabled? It's not really obvious and I think it deserves a comment in
> the code.

Ugh, yeah, I think I need to duplicate the two lines in the else just
below this point, here.  I'm sick of this code.

- Chris


More information about the anaconda-patches mailing list