Blob Blame History Raw
From 855d3f35fe6c4b303ccd1ac796771d056a225e29 Mon Sep 17 00:00:00 2001
From: Seth Vidal <skvidal@fedoraproject.org>
Date: Mon, 14 Sep 2009 16:22:07 -0400
Subject: [PATCH] os.path.normpath() over the installroot dir

apparently opening a path NOT starting with '/' inside the chroot
that rpm makes for the transaction will open a file OUTSIDE of the chroot
no, I'm not sure I get it either.
---
 yum/rpmtrans.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/yum/rpmtrans.py b/yum/rpmtrans.py
index 77b06a2..4542e03 100644
--- a/yum/rpmtrans.py
+++ b/yum/rpmtrans.py
@@ -339,7 +339,7 @@ class RPMTransaction:
         # we hand back the right path to those 'outside' of the chroot() calls
         # but we're using the right path inside.
         if self.base.conf.installroot != '/':
-            tsfn = tsfn.replace(self.base.conf.installroot,'')
+            tsfn = tsfn.replace(os.path.normpath(self.base.conf.installroot),'')
         try:
             if not os.path.exists(os.path.dirname(tsfn)):
                 os.makedirs(os.path.dirname(tsfn)) # make the dir,
-- 
1.6.2.5