kadischi/post_install_scripts 03fstab.py, 1.2, 1.3 05fsclean.py, 1.2, 1.3 06sysconfig.py, 1.2, 1.3

Jasper O'neal Hartline (autopsy) fedora-extras-commits at redhat.com
Fri Mar 31 21:03:44 UTC 2006


Author: autopsy

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

Modified Files:
	03fstab.py 05fsclean.py 06sysconfig.py 
Log Message:
Contributor: Toshio Kuratomi (Consistency between spaces vs. tabs), commit


Index: 03fstab.py
===================================================================
RCS file: /cvs/devel/kadischi/post_install_scripts/03fstab.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- 03fstab.py	13 Oct 2005 01:05:55 -0000	1.2
+++ 03fstab.py	31 Mar 2006 21:03:41 -0000	1.3
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python -tt
 
 import os
 import sys
@@ -9,12 +9,12 @@
 list = []
 fstab = open (normalize_path ([sysdir,'/etc/fstab']) , 'r')
 for line in fstab:
-	if (line[0] != '#') and (line != '\n') and (line.find('swap') == -1) and (line.split() [1] != '/'):
-		list.append (line)
+    if (line[0] != '#') and (line != '\n') and (line.find('swap') == -1) and (line.split() [1] != '/'):
+        list.append (line)
 fstab.close()
 
 list[:0] = '/dev/loop1\t\t/\t\t\text2\tdefaults\t1 1\n'
 
 fstab = open (normalize_path ([sysdir,'/etc/fstab']) , 'w')
 fstab.writelines (list)
-fstab.close()
\ No newline at end of file
+fstab.close()


Index: 05fsclean.py
===================================================================
RCS file: /cvs/devel/kadischi/post_install_scripts/05fsclean.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- 05fsclean.py	30 Mar 2006 04:29:22 -0000	1.2
+++ 05fsclean.py	31 Mar 2006 21:03:41 -0000	1.3
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python -tt
 
 import os
 import sys
@@ -7,58 +7,58 @@
 
 # Directories that we want to empty but not delete
 directories_to_be_emptied = [
-	'/root',
-	'/proc',
-	'/lost+found',
-	'/var/gdm',
-	'/dev',
-	'/tmp',
-	'/var/tmp',
-	'/var/cache/yum',
-	'/mnt',
-	'/media',
-	'/boot/isolinux'
-	]
+    '/root',
+    '/proc',
+    '/lost+found',
+    '/var/gdm',
+    '/dev',
+    '/tmp',
+    '/var/tmp',
+    '/var/cache/yum',
+    '/mnt',
+    '/media',
+    '/boot/isolinux'
+    ]
 
 # Directories that we want to empty of files
 directories_to_be_cleaned = [
-	'/var/log', ## FIXME: Think this through
-	]
+    '/var/log', ## FIXME: Think this through
+    ]
 
 # files that need removing
 files_to_be_removed = [
-	'/.autofsck',
-	]
+    '/.autofsck',
+    ]
 
 def clean_up_directories (rootdir, to_empty, to_clean, to_remove):
-	for d in to_empty:
-		path = os.path.normpath (rootdir + '/' + d)
-		if not os.path.isdir (path):
-			continue
-		clean_directory (path, False)
-
-	for d in to_clean:
-		path = os.path.normpath (rootdir + '/' + d)
-		if not os.path.isdir (path):
-			continue
-		clean_directory (path, False, True)
-
-	for f in to_remove:
-		path = os.path.join (rootdir, f)
-		if not os.path.isfile (path):
-			continue
-		os.remove (path)
-	
+    for d in to_empty:
+        path = os.path.normpath (rootdir + '/' + d)
+        if not os.path.isdir (path):
+            continue
+        clean_directory (path, False)
+
+    for d in to_clean:
+        path = os.path.normpath (rootdir + '/' + d)
+        if not os.path.isdir (path):
+            continue
+        clean_directory (path, False, True)
+
+    for f in to_remove:
+        path = os.path.join (rootdir, f)
+        if not os.path.isfile (path):
+            continue
+        os.remove (path)
+
 def clean_up_root (rootdir):
-	# FIXME: Do this nicer at some point
-	os.system ("chroot %s /usr/bin/rsync -a /etc/skel/ /root/" % rootdir)
-	os.chmod (rootdir + '/root', 0750)
+    # FIXME: Do this nicer at some point
+    os.system ("chroot %s /usr/bin/rsync -a /etc/skel/ /root/" % rootdir)
+    os.chmod (rootdir + '/root', 0750)
 
 rootdir = sys.argv[1]
 
 clear_rpm_db_files (rootdir)
 clean_up_directories (rootdir,
-	directories_to_be_emptied,
-	directories_to_be_cleaned,
-	files_to_be_removed)
+        directories_to_be_emptied,
+        directories_to_be_cleaned,
+        files_to_be_removed)
 clean_up_root (rootdir)


Index: 06sysconfig.py
===================================================================
RCS file: /cvs/devel/kadischi/post_install_scripts/06sysconfig.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- 06sysconfig.py	30 Aug 2005 01:56:22 -0000	1.2
+++ 06sysconfig.py	31 Mar 2006 21:03:41 -0000	1.3
@@ -1,54 +1,54 @@
-#!/usr/bin/python
+#!/usr/bin/python -tt
 
 import os
 import sys
 from functions import *
 
 def tweak_readonly_root_config (rootdir):
-	# create symlink to rc.readonly-livecd
-	os.symlink ('rc.d/rc.readonly-livecd', normalize_path (['etc/rc.readonly'], rootdir))
-	os.symlink ('../init.d/readonly-halt', normalize_path (['etc/rc0.d/S00readonly-halt'], rootdir))
-	os.symlink ('../init.d/readonly-halt', normalize_path (['etc/rc6.d/S00readonly-halt'], rootdir))
-	# create dirs for fedora-livecd files
-	os.mkdir (normalize_path (['/livecd'], rootdir))
-	os.mkdir (normalize_path (['/livecd/tmpfs'], rootdir))
-	os.mkdir (normalize_path (['/livecd/ramfs'], rootdir))
-	os.mkdir (normalize_path (['/livecd/moved'], rootdir))
-	# enable readonly-root
-	shf = sysconfig_file (rootdir, "readonly-root")
-	# run rc.readonly
-	shf["READONLY"] = "yes"
-	shf.write ()
-    
+    # create symlink to rc.readonly-livecd
+    os.symlink ('rc.d/rc.readonly-livecd', normalize_path (['etc/rc.readonly'], rootdir))
+    os.symlink ('../init.d/readonly-halt', normalize_path (['etc/rc0.d/S00readonly-halt'], rootdir))
+    os.symlink ('../init.d/readonly-halt', normalize_path (['etc/rc6.d/S00readonly-halt'], rootdir))
+    # create dirs for fedora-livecd files
+    os.mkdir (normalize_path (['/livecd'], rootdir))
+    os.mkdir (normalize_path (['/livecd/tmpfs'], rootdir))
+    os.mkdir (normalize_path (['/livecd/ramfs'], rootdir))
+    os.mkdir (normalize_path (['/livecd/moved'], rootdir))
+    # enable readonly-root
+    shf = sysconfig_file (rootdir, "readonly-root")
+    # run rc.readonly
+    shf["READONLY"] = "yes"
+    shf.write ()
+
 def tweak_udev_config (rootdir):
-	shf = sysconfig_file (rootdir, "udev")
-	# Mount a ramfs over /dev
-	shf["UDEV_RAMFS"] = "yes"
-	# We aren't using an initrd
-	shf["UDEV_INITRD"] =  "no"
-	# Don't keep the ramfs from the initrd
-	shf["UDEV_KEEP_DEV"] = "no"
-	shf.write ()
-        
+    shf = sysconfig_file (rootdir, "udev")
+    # Mount a ramfs over /dev
+    shf["UDEV_RAMFS"] = "yes"
+    # We aren't using an initrd
+    shf["UDEV_INITRD"] =  "no"
+    # Don't keep the ramfs from the initrd
+    shf["UDEV_KEEP_DEV"] = "no"
+    shf.write ()
+ 
 def tweak_firstboot_config (rootdir):
-	shf = sysconfig_file (rootdir, "firstboot")
-	shf["RUN_FIRSTBOOT"] = "YES"
-	shf.write ()
+    shf = sysconfig_file (rootdir, "firstboot")
+    shf["RUN_FIRSTBOOT"] = "YES"
+    shf.write ()
 
 def tweak_kudzu_config (rootdir):
-	shf = sysconfig_file (rootdir, "kudzu")
-	# Take default actions without prompting
-	shf["KUDZU_ARGS"] =  "-q"
-	shf.write ()
-	
+    shf = sysconfig_file (rootdir, "kudzu")
+    # Take default actions without prompting
+    shf["KUDZU_ARGS"] =  "-q"
+    shf.write ()
+
 def tweak_livecd (rootdir):
-	file = open (normalize_path (['.livecd'], rootdir) , 'w')
-	file.close()
-	
+    file = open (normalize_path (['.livecd'], rootdir) , 'w')
+    file.close()
+
 rootdir = sys.argv[1]
 
 tweak_readonly_root_config (rootdir)
 tweak_udev_config (rootdir)
 tweak_firstboot_config (rootdir)
 #tweak_kudzu_config (rootdir)
-tweak_livecd (rootdir)
\ No newline at end of file
+tweak_livecd (rootdir)




More information about the fedora-extras-commits mailing list