summaryrefslogtreecommitdiffstats
path: root/harddrive.py
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>1999-08-21 01:05:37 +0000
committerErik Troan <ewt@redhat.com>1999-08-21 01:05:37 +0000
commitd973d2bb55c017cfda4c74e5b67513b144e2005b (patch)
tree48a03c8b898cfbffbc63c71869c069e32bd4bfee /harddrive.py
parent3597dc276979f56be1d5b9b5bc933c95a102b8a4 (diff)
downloadanaconda-d973d2bb55c017cfda4c74e5b67513b144e2005b.tar.gz
anaconda-d973d2bb55c017cfda4c74e5b67513b144e2005b.tar.xz
anaconda-d973d2bb55c017cfda4c74e5b67513b144e2005b.zip
works now :-)
Diffstat (limited to 'harddrive.py')
-rw-r--r--harddrive.py30
1 files changed, 24 insertions, 6 deletions
diff --git a/harddrive.py b/harddrive.py
index ec892eb64..a8489a207 100644
--- a/harddrive.py
+++ b/harddrive.py
@@ -1,32 +1,46 @@
# Install method for disk image installs (CD & NFS)
from comps import ComponentSet, HeaderList
+import os
import isys
+import rpm
+
+import todo
+
+FILENAME = 1000000
class InstallMethod:
def readComps(self, hdlist):
isys.mount('/tmp/' + self.device, "/tmp/hdimage");
- cs = ComponentSet('i386', "/tmp/hdimage/" + self.tree +
+ cs = ComponentSet('i386', "/tmp/hdimage/" + self.path +
'/RedHat/base/comps', hdlist)
isys.umount("/tmp/hdimage")
return cs
def getFilename(self, h):
- return self.tree + "/RedHat/RPMS/" + h[1000000]
+ return self.tree + "/RedHat/RPMS/" + h[FILENAME]
def readHeaders(self):
isys.mount('/tmp/' + self.device, "/tmp/hdimage");
- hl = HeaderList("/tmp/hdimage/" + self.path + "/RedHat/base/hdlist")
+ hl = []
+ path = "/tmp/hdimage" + self.path + "/RedHat/RPMS"
+ for n in os.listdir(path):
+ if (n[len(n) - 4:] == '.rpm'):
+ fd = os.open(path + "/" + n, 0)
+ (h, isSource) = rpm.headerFromPackage(fd)
+ hl.append(h)
+ os.close(fd)
+
isys.umount("/tmp/hdimage")
- return hl
+ return HeaderList(hl)
def targetFstab(self, fstab):
self.isMounted = 0
- for (device, fsystem, reformat) in fstab.items():
+ for (mntpoint, (device, fsystem, reformat)) in fstab.items():
if (device == self.device):
self.isMounted = 1
- self.tree = "/mnt/sysimage" + fsystem + "/" + self.path
+ self.tree = "/mnt/sysimage" + mntpoint + "/" + self.path
self.needsUnmount = 0
if (not self.isMounted):
@@ -37,7 +51,11 @@ class InstallMethod:
def filesDone(self):
if (self.needsUnmount):
isys.umount("/tmp/hdimage")
+
+ def unlinkFilename(self, fullName):
+ pass
def __init__(self, device, path):
self.device = device
self.path = path
+ isys.makeDevInode(device, '/tmp/' + device)