diff options
author | Erik Troan <ewt@redhat.com> | 1999-05-05 19:36:27 +0000 |
---|---|---|
committer | Erik Troan <ewt@redhat.com> | 1999-05-05 19:36:27 +0000 |
commit | c9126c5176174f855a21fd2e429c708a466f70a0 (patch) | |
tree | e94cf8bce3fad0c925f9acc0470f7600316e7bbf | |
parent | b488e51d7e29d0ba395777f7c0b53e22820e0d25 (diff) | |
download | anaconda-c9126c5176174f855a21fd2e429c708a466f70a0.tar.gz anaconda-c9126c5176174f855a21fd2e429c708a466f70a0.tar.xz anaconda-c9126c5176174f855a21fd2e429c708a466f70a0.zip |
reworked install flags
-rwxr-xr-x | anaconda | 33 | ||||
-rw-r--r-- | todo.py | 25 |
2 files changed, 41 insertions, 17 deletions
@@ -2,14 +2,16 @@ import sys, getopt, os -(args, extra) = getopt.getopt(sys.argv[1:], 'p:gTtdr:', [ 'gui', 'text', 'test', 'force', 'debug', 'rootpath=', 'testpath=' ]) +(args, extra) = getopt.getopt(sys.argv[1:], 'p:gTtdr:f', + [ 'gui', 'text', 'test', 'debug', 'rootpath=', + 'testpath=', 'mountfs' ]) mode = None test = 0 -force = 0 debug = 0 rootPath = '/mnt/sysimage' -runLive = 0 +localInstall = 0 +forceMount = 0 for n in args: (str, arg) = n @@ -23,21 +25,21 @@ for n in args: debug = 1 elif (str == '-r' or str == '--rootpath'): rootPath = arg - runLive = 1 + localInstall = 1 elif (str == '-p' or str == '--imagepath'): imagepath = arg - elif (str == '--force'): - force = 1 + elif (str == '--mountfs'): + forceMount = 1 if (debug): import pdb pdb.set_trace() -if (not test and os.getpid() > 10 and not force): +if (not test and not localInstall and os.getpid() > 10): print "you're running me on a live system! that's incredibly stupid." sys.exit(1) -if (test): +if (os.path.exists('rpmmodule')): sys.path.append('balkan') sys.path.append('rpmmodule') sys.path.append('isys') @@ -78,9 +80,20 @@ else: method = InstallMethod(imagepath) intf = InstallInterface() -todo = ToDo(intf, method, rootPath, runLive) + +if localInstall: + installPackages = 1 + setupFilesystems = 0 +if test: + installPackages = 0 + setupFilesystems = 0 +if forceMount: + setupFilesystems = 1 + +todo = ToDo(intf, method, rootPath, installSystem = installPackages, + setupFilesystems = setupFilesystems) intf.run(todo) -todo.installSystem() +todo.doInstall() del intf @@ -21,12 +21,16 @@ def instCallback(what, amount, total, key, data): class ToDo: def umountFilesystems(self): + if (not self.setupFilesystems): return + self.mounts.sort(mountListCmp) self.mounts.reverse() for n in self.mounts: isys.umount(n) def makeFilesystems(self): + if (not self.setupFilesystems): return + self.mounts.sort(mountListCmp) for n in self.mounts: (device, mntpoint, format) = n @@ -38,11 +42,13 @@ class ToDo: w.pop() def mountFilesystems(self): + if (not self.setupFilesystems): return + for n in self.mounts: (device, mntpoint, format) = n isys.mount(device, self.instPath + mntpoint) - def installSystem(self): + def doInstall(self): # make sure we have the header list and comps file self.headerList() self.compsList() @@ -50,9 +56,12 @@ class ToDo: self.makeFilesystems() self.mountFilesystems() - #os.mkdir(self.instPath + '/var') - #os.mkdir(self.instPath + '/var/lib') - #os.mkdir(self.instPath + '/var/lib/rpm') + if not self.installSystem: + return + + os.mkdir(self.instPath + '/var') + os.mkdir(self.instPath + '/var/lib') + os.mkdir(self.instPath + '/var/lib/rpm') db = rpm.opendb(1, self.instPath) ts = rpm.TransactionSet(self.instPath, db) @@ -62,7 +71,7 @@ class ToDo: ts.order() p = self.intf.packageProgessWindow() - #ts.run(0, 0, instCallback, p) + ts.run(0, 0, instCallback, p) self.installLilo() @@ -122,14 +131,16 @@ class ToDo: return self.comps - def __init__(self, intf, method, rootPath, runLive): + def __init__(self, intf, method, rootPath, setupFilesystems = 1, + installSystem = 1, create): self.intf = intf self.method = method self.mounts = [] self.hdList = None self.comps = None self.instPath = rootPath - self.runLive = runLive + self.setupFilesystems = setupFilesystems + self.installSystem = installSystem pass def mountListCmp(first, second): |