summaryrefslogtreecommitdiffstats
path: root/whiteout.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2004-02-10 19:22:44 +0000
committerJeremy Katz <katzj@redhat.com>2004-02-10 19:22:44 +0000
commit7f4325124cd3745eee35b134acf4600b3d00692a (patch)
treefa9d98fa19419c6b648532118e0760c4fd3b3319 /whiteout.py
parentb7808a07b6bc58417355d6c8a8dbde4adaec7861 (diff)
downloadanaconda-7f4325124cd3745eee35b134acf4600b3d00692a.tar.gz
anaconda-7f4325124cd3745eee35b134acf4600b3d00692a.tar.xz
anaconda-7f4325124cd3745eee35b134acf4600b3d00692a.zip
make the file_context finding smarter... look in updates paths, don't do it
for selinux=0, etc
Diffstat (limited to 'whiteout.py')
-rw-r--r--whiteout.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/whiteout.py b/whiteout.py
index f947cb911..405eaaf89 100644
--- a/whiteout.py
+++ b/whiteout.py
@@ -1,9 +1,10 @@
#
# whiteout.py - dependency whiteout setup
#
-# Copyright 2002 Red Hat, Inc.
+# Copyright 2002-2004 Red Hat, Inc.
#
+import os
import rpm
import rhpl.arch
@@ -11,9 +12,17 @@ import rhpl.arch
# this with all of the useful rpm bits
rpm.addMacro("__dbi_cdb", "create private mpool mp_mmapsize=16Mb mp_size=1Mb")
-# and set where we should have the file contexts come from
-rpm.addMacro("__file_context_path",
- "/mnt/runtime/etc/security/selinux/src/policy/file_contexts/file_contexts")
+# assuming that SELinux is set up, tell rpm where to pull file contexts from
+f = open("/proc/cmdline", "r")
+line = f.readline()
+f.close()
+if os.path.exists("/selinux/load") and line.find(" selinux=0") == -1:
+ for fn in ("/tmp/updates/file_contexts",
+ "/mnt/source/RHupdates/file_contexts",
+ "/mnt/runtime/etc/security/selinux/src/policy/file_contexts/file_contexts"):
+ if os.access(fn, os.R_OK):
+ break
+ rpm.addMacro("__file_context_path", fn)
whiteout="""
pango-gtkbeta-devel>pango-gtkbeta\