Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Fedora SELinux Support (http://www.linux-archive.org/fedora-selinux-support/)
-   -   Add a property to return the id of the base repo. (http://www.linux-archive.org/fedora-selinux-support/641542-add-property-return-id-base-repo.html)

David Lehman 03-06-2012 02:55 PM

Add a property to return the id of the base repo.
 
---
pyanaconda/packaging/yumpayload.py | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py
index 350a5e4..03085e3 100644
--- a/pyanaconda/packaging/yumpayload.py
+++ b/pyanaconda/packaging/yumpayload.py
@@ -144,9 +144,20 @@ reposdir=/etc/yum.repos.d,/etc/anaconda.repos.d,/tmp/updates/anaconda.repos.d,/t
###
@property
def repos(self):
- # FIXME: should this return pykickstart Repo or YumRepo?
return self._yum.repos.repos.keys()

+ @property
+ def baseRepo(self):
+ repo_names = [BASE_REPO_NAME, productName.lower(), "rawhide"]
+ base_repo_name = None
+ for repo_name in repo_names:
+ if repo_name in self.repos and
+ self._yum.repos.getRepo(repo_name).enabled:
+ base_repo_name = repo_name
+ break
+
+ return base_repo_name
+
def _repoNeedsNetwork(self, repo):
""" Returns True if the ksdata repo requires networking. """
urls = [repo.baseurl] + repo.mirrorlist
--
1.7.9.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

Chris Lumens 03-06-2012 03:09 PM

Add a property to return the id of the base repo.
 
> pyanaconda/packaging/yumpayload.py | 13 ++++++++++++-
> 1 files changed, 12 insertions(+), 1 deletions(-)

Looks okay.

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


All times are GMT. The time now is 04:43 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.