kadischi/livecd_generator kadischi.py,1.16,1.17

Jasper O'neal Hartline (autopsy) fedora-extras-commits at redhat.com
Mon Jul 3 18:48:32 UTC 2006


Author: autopsy

Update of /cvs/devel/kadischi/livecd_generator
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21268/kadischi/livecd_generator

Modified Files:
	kadischi.py 
Log Message:
User data and configuration dialog menu, calculate expected ISO size


Index: kadischi.py
===================================================================
RCS file: /cvs/devel/kadischi/livecd_generator/kadischi.py,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- kadischi.py	3 Jul 2006 01:17:11 -0000	1.16
+++ kadischi.py	3 Jul 2006 18:48:30 -0000	1.17
@@ -5,10 +5,11 @@
 import string
 import optparse
 import shutil
+import rpm
 from shvar import shvarFile
 from functions import *
 
-version = '0.1'
+version = '2.4'
 
 builddir = ''
 confdir = ''
@@ -220,6 +221,32 @@
 flc_log ('\n  ***  anaconda has finished the job ***  \n')
 
 
+###
+### Calculate size of result ISO image by known ratios for SquashFS (anywhere from 2.6 to 2.8)
+size = 0
+stepsize = 0
+
+
+ts = rpm.TransactionSet(sysdir)
+
+mi = ts.dbMatch()
+for hdr in mi:
+    size = (hdr['size'])
+    stepsize = (size + stepsize)
+
+totalsize = stepsize
+estimate0 = (totalsize / 2.6) ## Observed ratio for SquashFS
+estimate1 = (totalsize / 2.8) ## Observed ratio for SquashFS
+
+print ("Estimated %s size is between %s and %s bytes" % (isoimage, estimate1, estimate0))
+if anaconda_args.find("--kickstart") or anaconda_args.find("--cmdline") or anaconda_args.find("-C"):
+    print ("Continuing anyway, using kickstart or cmdline methods..")
+else:
+    print ("Press <enter> to continue, or ctrl-c to quit")
+    raw_input()
+
+
+
 # now`s the time to pickup kernel version cause when we move files arround, it will be late
 # Borrow some functions to do logic processing
 kernel_version = get_kernel_version (sysdir)




More information about the fedora-extras-commits mailing list