diff options
author | Chris Lumens <clumens@redhat.com> | 2009-02-27 14:29:59 -0500 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2009-03-04 15:37:04 -0500 |
commit | 1e73575ca9dbc1a3a02d977956a20413dd8ec0bb (patch) | |
tree | f292dd29db943ae107b059e7d409e005da524579 /booty | |
parent | ca9d5901228243c02e5db5ae9fe6faa0f9f37bc9 (diff) | |
download | anaconda-1e73575ca9dbc1a3a02d977956a20413dd8ec0bb.tar.gz anaconda-1e73575ca9dbc1a3a02d977956a20413dd8ec0bb.tar.xz anaconda-1e73575ca9dbc1a3a02d977956a20413dd8ec0bb.zip |
There's no need to paste together the full path over and over again.
Diffstat (limited to 'booty')
-rw-r--r-- | booty/alpha.py | 13 | ||||
-rw-r--r-- | booty/bootloaderInfo.py | 17 | ||||
-rw-r--r-- | booty/s390.py | 11 |
3 files changed, 21 insertions, 20 deletions
diff --git a/booty/alpha.py b/booty/alpha.py index 8dfb005ca..977e17ea6 100644 --- a/booty/alpha.py +++ b/booty/alpha.py @@ -25,12 +25,13 @@ class alphaBootloaderInfo(bootloaderInfo): bootnotroot = bootDevice != rootDevice + confFile = instRoot + self.configfile + # If /etc/aboot.conf already exists we rename it # /etc/aboot.conf.rpmsave. - if os.path.isfile(instRoot + self.configfile): - os.rename (instRoot + self.configfile, - instRoot + self.configfile + ".rpmsave") - + if os.path.isfile(confFile): + os.rename (confFile, confFile + ".rpmsave") + # Then we create the necessary files. If the root device isn't # the boot device, we create /boot/etc/ where the aboot.conf # will live, and we create /etc/aboot.conf as a symlink to it. @@ -41,7 +42,7 @@ class alphaBootloaderInfo(bootloaderInfo): # We install the symlink (/etc/aboot.conf has already been # renamed in necessary.) - os.symlink("../boot" + self.configfile, instRoot + self.configfile) + os.symlink("../boot" + self.configfile, confFile) cfPath = instRoot + "/boot" + self.configfile # Kernel path is set to / because a boot partition will @@ -49,7 +50,7 @@ class alphaBootloaderInfo(bootloaderInfo): kernelPath = '/' # Otherwise, we just need to create /etc/aboot.conf. else: - cfPath = instRoot + self.configfile + cfPath = confFile kernelPath = self.kernelLocation # If we already have an aboot.conf, rename it diff --git a/booty/bootloaderInfo.py b/booty/bootloaderInfo.py index befefa0d0..c149a5461 100644 --- a/booty/bootloaderInfo.py +++ b/booty/bootloaderInfo.py @@ -318,19 +318,18 @@ class bootloaderInfo: chainList, defaultDev): images = bl.images.getImages() + confFile = instRoot + self.configfile + # on upgrade read in the lilo config file lilo = LiloConfigFile () self.perms = 0600 - if os.access (instRoot + self.configfile, os.R_OK): - self.perms = os.stat(instRoot + self.configfile)[0] & 0777 - lilo.read (instRoot + self.configfile) - os.rename(instRoot + self.configfile, - instRoot + self.configfile + '.rpmsave') + if os.access (confFile, os.R_OK): + self.perms = os.stat(confFile)[0] & 0777 + lilo.read(confFile) + os.rename(confFile, confFile + ".rpmsave") # if it's an absolute symlink, just get it out of our way - elif (os.path.islink(instRoot + self.configfile) and - os.readlink(instRoot + self.configfile)[0] == '/'): - os.rename(instRoot + self.configfile, - instRoot + self.configfile + '.rpmsave') + elif (os.path.islink(confFile) and os.readlink(confFile)[0] == '/'): + os.rename(confFile, confFile + ".rpmsave") # Remove any invalid entries that are in the file; we probably # just removed those kernels. diff --git a/booty/s390.py b/booty/s390.py index 92f640d9d..a96ac0033 100644 --- a/booty/s390.py +++ b/booty/s390.py @@ -11,11 +11,12 @@ class s390BootloaderInfo(bootloaderInfo): # on upgrade read in the lilo config file lilo = LiloConfigFile () self.perms = 0600 - if os.access (instRoot + self.configfile, os.R_OK): - self.perms = os.stat(instRoot + self.configfile)[0] & 0777 - lilo.read (instRoot + self.configfile) - os.rename(instRoot + self.configfile, - instRoot + self.configfile + '.rpmsave') + confFile = instRoot + self.configfile + + if os.access (confFile, os.R_OK): + self.perms = os.stat(confFile)[0] & 0777 + lilo.read(confFile) + os.rename(confFile, confFile + ".rpmsave") # Remove any invalid entries that are in the file; we probably # just removed those kernels. |