[Yum-devel] [PATCH] add variable $distroname to config (updated)

Bastiaan Bakker Bastiaan.Bakker at enovation.nl
Mon Aug 28 22:48:26 UTC 2006


Hi,

Included is an updated version of a small patch I originally submitted in May. It adds a config option 'distroname' and a variable $distroname to yum's config. By default $distroname will contain 'fedora' (to align with distroverpkg), but that can be modified with the option. Primary purpose of this is to allow identical repo definitions to be used across multiple distro's.
Please let me know whether this patch or a similar one is acceptable for merging.

Cheers,

Bastiaan Bakker
E.Novation LifeLine Networks bv

Index: docs/yum.conf.5
===================================================================
RCS file: /cvsroot/yum/cvs/yum/docs/yum.conf.5,v
retrieving revision 1.42
diff -u -r1.42 yum.conf.5
--- docs/yum.conf.5     16 Jun 2006 14:56:53 -0000      1.42
+++ docs/yum.conf.5     28 Aug 2006 21:52:02 -0000
@@ -126,6 +126,9 @@
 .br
 Commmand-line option: \fB\-\-installroot\fP

+.IP \fBdistroname\fR
+Name of the distribution. Default is `fedora'.
+
 .IP \fBdistroverpkg\fR
 The package used by yum to determine the "version" of the distribution. This
 can be any installed package. Default is `redhat-release'.
@@ -379,6 +382,10 @@
 including \fBname\fR, \fBbaseurl\fR and \fBcommands\fB.
 .LP

+.IP \fB$distroname\fR
+This will be replaced with the value of option \fBdistroname\fR. This defaults
+to `fedora'.
+
 .IP \fB$releasever\fR
 This will be replaced with the value of the version of the package listed
 in \fBdistroverpkg\fR. This defaults to the version of `redhat-release'
Index: yum/config.py
===================================================================
RCS file: /cvsroot/yum/cvs/yum/yum/config.py,v
retrieving revision 1.99
diff -u -r1.99 config.py
--- yum/config.py       15 Jun 2006 09:59:14 -0000      1.99
+++ yum/config.py       28 Aug 2006 21:52:02 -0000
@@ -475,6 +475,7 @@
     errorlevel = IntOption(2)

     distroverpkg = Option('fedora-release')
+    distroname = Option('fedora')
     installroot = Option('/')

     plugins = BoolOption(False)
@@ -610,6 +611,7 @@
     vars['basearch'] = rpmUtils.arch.getBaseArch()          # FIXME make this configurable??
     vars['arch'] = rpmUtils.arch.getCanonArch()             # FIXME make this configurable??
     vars['releasever'] = _getsysver(startupconf.installroot, startupconf.distroverpkg)
+    vars['distroname'] = startupconf.distroname

     # Read [main] section
     yumconf = YumConf()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.baseurl.org/pipermail/yum-devel/attachments/20060829/0cc43e72/attachment.htm 


More information about the Yum-devel mailing list