summaryrefslogtreecommitdiffstats
path: root/iutil.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2003-06-06 16:33:31 +0000
committerJeremy Katz <katzj@redhat.com>2003-06-06 16:33:31 +0000
commite0779b7bf137a60bf6e6cd3adee4aabffcd28c73 (patch)
tree20b8340a621390a3fc967ef5fb3723c78b4033c7 /iutil.py
parent91d5fc40d23a5fb5b225287090e8074d0054fa6e (diff)
downloadanaconda-e0779b7bf137a60bf6e6cd3adee4aabffcd28c73.tar.gz
anaconda-e0779b7bf137a60bf6e6cd3adee4aabffcd28c73.tar.xz
anaconda-e0779b7bf137a60bf6e6cd3adee4aabffcd28c73.zip
merge taroon branch. mostly package bits, but a lot of other misc stuff
and cleanups in here too
Diffstat (limited to 'iutil.py')
-rw-r--r--iutil.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/iutil.py b/iutil.py
index 0d99a8dd3..d394cc3f3 100644
--- a/iutil.py
+++ b/iutil.py
@@ -16,6 +16,7 @@
import types, os, sys, isys, select, string, stat, signal
import os.path
from rhpl.log import log
+from flags import flags
def getArch ():
arch = os.uname ()[4]
@@ -560,3 +561,27 @@ def getPPCMacBook():
if not string.find(string.lower(line), 'book') == -1:
return 1
return 0
+
+def writeRpmPlatform(root="/"):
+ import rhpl.arch
+
+ if flags.test:
+ return
+ if os.access("%s/etc/rpm/platform" %(root,), os.R_OK):
+ return
+ if not os.access("%s/etc/rpm" %(root,), os.X_OK):
+ os.mkdir("%s/etc/rpm" %(root,))
+ f = open("%s/etc/rpm/platform" %(root,), 'w+')
+ f.write("%s-redhat-linux\n" %(rhpl.arch.canonArch,))
+ f.close()
+
+ # FIXME: writing /etc/rpm/macros feels wrong somehow
+ # temporary workaround for #92285
+ if os.access("%s/etc/rpm/macros" %(root,), os.R_OK):
+ return
+ if not (rhpl.arch.canonArch.startswith("ppc64") or
+ rhpl.arch.canonArch in ("s390x", "sparc64", "x86_64")):
+ return
+ f = open("%s/etc/rpm/macros" %(root,), 'w+')
+ f.write("_transaction_color 3\n")
+ f.close()