summaryrefslogtreecommitdiffstats
path: root/harddrive.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2002-08-09 07:24:00 +0000
committerJeremy Katz <katzj@redhat.com>2002-08-09 07:24:00 +0000
commit6cd5fcbf64508f9851419b7fbf47800dcd91e0a0 (patch)
tree23836641609fbf151a95f11b5392f07630e2e7b8 /harddrive.py
parent373155c22468af5fc91c66c490faf1e00854a9ff (diff)
downloadanaconda-6cd5fcbf64508f9851419b7fbf47800dcd91e0a0.tar.gz
anaconda-6cd5fcbf64508f9851419b7fbf47800dcd91e0a0.tar.xz
anaconda-6cd5fcbf64508f9851419b7fbf47800dcd91e0a0.zip
get the basename of the right thing in HardDrive copyFileToTemp. also, make sure we have things mounted and return to the state we were in. comps.rpm should get installed for hard drive installs now
Diffstat (limited to 'harddrive.py')
-rw-r--r--harddrive.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/harddrive.py b/harddrive.py
index c50c62bc4..e2627f45c 100644
--- a/harddrive.py
+++ b/harddrive.py
@@ -15,6 +15,7 @@
from comps import ComponentSet, HeaderList, HeaderListFromFile
from installmethod import InstallMethod
from image import findIsoImages
+import shutil
import os
import isys
import iutil
@@ -27,9 +28,16 @@ FILENAME = 1000000
# Install from a set of files laid out on the hard drive like a CD
class OldHardDriveInstallMethod(InstallMethod):
def copyFileToTemp(self, filename):
+ wasmounted = self.isMounted
+
+ if not wasmounted:
+ self.mountMedia()
tmppath = self.getTempPath()
path = tmppath + os.path.basename(filename)
shutil.copy(self.tree + "/" + filename, path)
+
+ if not wasmounted:
+ self.umountMedia()
return path
@@ -102,9 +110,16 @@ class OldHardDriveInstallMethod(InstallMethod):
# Install from one or more iso images
class HardDriveInstallMethod(InstallMethod):
def copyFileToTemp(self, filename):
+ wasmounted = self.mediaIsMounted
+
+ if not wasmounted:
+ self.mountMedia(1)
tmppath = self.getTempPath()
- path = tmppath + os.path.basename(tmppath)
+ path = tmppath + os.path.basename(filename)
shutil.copy(self.tree + "/" + filename, path)
+
+ if not wasmounted:
+ self.umountMedia()
return path