[Yum-devel] [PATCH] Deal with relative installroot paths.

James Antill james at and.org
Tue Sep 28 19:28:07 UTC 2010


---
 cli.py |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/cli.py b/cli.py
index 0accd35..006fe71 100644
--- a/cli.py
+++ b/cli.py
@@ -1396,6 +1396,7 @@ class YumOptionParser(OptionParser):
                 self.base.conf.obsoletes = 1
 
             if opts.installroot:
+                self._setupAbsInstallRoot(opts)
                 self.base.conf.installroot = opts.installroot
                 
             if opts.skipbroken:
@@ -1475,7 +1476,16 @@ class YumOptionParser(OptionParser):
          
         return opts, cmds
 
+    def _setupAbsInstallRoot(self, opts):
+        if not opts.installroot:
+            return
+        if opts.installroot[0] == '/':
+            return
+        # We have a relative installroot ... haha
+        opts.installroot = os.path.realpath(opts.installroot)
+
     def getRoot(self,opts):
+        self._setupAbsInstallRoot(opts)
         # If the conf file is inside the  installroot - use that.
         # otherwise look for it in the normal root
         if opts.installroot:
-- 
1.7.2.3



More information about the Yum-devel mailing list