[PATCH 2/9] Add override_install_langs configuration, for container install needs.

James Antill james at and.org
Wed Feb 12 23:27:08 UTC 2014


---
 docs/yum.conf.5 |    6 ++++++
 yum/config.py   |    1 +
 yum/depsolve.py |    7 +++++++
 3 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/docs/yum.conf.5 b/docs/yum.conf.5
index c66eba8..bf3c442 100644
--- a/docs/yum.conf.5
+++ b/docs/yum.conf.5
@@ -329,6 +329,12 @@ context of an rpm transaction set you're best leaving it alone. Default is
 an empty list.
 
 .IP
+\fBoverride_install_langs\fR
+This is a way to override rpm's _install_langs macro. without having to change
+it within rpm's macro file.
+Default is nothing (so does nothing).
+
+.IP
 \fBrecent\fR
 Number of days back to look for `recent' packages added to a repository.
 Used by the \fBlist recent\fR command. Default is `7'.
diff --git a/yum/config.py b/yum/config.py
index c38d574..09a4dcc 100644
--- a/yum/config.py
+++ b/yum/config.py
@@ -768,6 +768,7 @@ class YumConf(StartupConf):
             'kernel-hugemem', 'kernel-enterprise', 'kernel-bigmem',
             'kernel-devel', 'kernel-PAE', 'kernel-PAE-debug'])
     tsflags = ListOption()
+    override_install_langs = Option()
 
     assumeyes = BoolOption(False)
     assumeno  = BoolOption(False)
diff --git a/yum/depsolve.py b/yum/depsolve.py
index 8a675eb..1840b43 100644
--- a/yum/depsolve.py
+++ b/yum/depsolve.py
@@ -180,6 +180,13 @@ class Depsolve(object):
     def initActionTs(self):
         """Set up the transaction set that will be used for all the work."""
         
+        # LOL, override rpm transaction macro.
+        # Must be done before rpmtsCreate()
+        if self.conf.override_install_langs:
+            old_install_langs = rpm.expandMacro("%_install_langs")
+            rpm.expandMacro("%define _install_langs " +
+                            self.conf.override_install_langs)
+
         self._ts = rpmUtils.transaction.TransactionWrapper(self.conf.installroot)
         ts_flags_to_rpm = { 'noscripts': rpm.RPMTRANS_FLAG_NOSCRIPTS,
                             'notriggers': rpm.RPMTRANS_FLAG_NOTRIGGERS,
-- 
1.7.7.6



More information about the Yum-devel mailing list