[Erp5-report] r7034 - /umigumi/trunk/umibuilder.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue May 2 16:40:11 CEST 2006


Author: kevin
Date: Tue May  2 16:39:59 2006
New Revision: 7034

URL: http://svn.erp5.org?rev=7034&view=rev
Log:
Test folder existence before getting its subdirectories
Fix indention problems

Modified:
    umigumi/trunk/umibuilder.py

Modified: umigumi/trunk/umibuilder.py
URL: http://svn.erp5.org/umigumi/trunk/umibuilder.py?rev=7034&r1=7033&r2=7034&view=diff
==============================================================================
--- umigumi/trunk/umibuilder.py (original)
+++ umigumi/trunk/umibuilder.py Tue May  2 16:39:59 2006
@@ -191,12 +191,13 @@
   '''
   path_list = []
   pwd = os.getcwd()
-  os.chdir(root_dir)
-  for e in os.listdir(os.curdir):
-    if e == 'dev' or e == 'proc':
-      continue
-    path_list.extend(getPathList(e, os.sep))
-  os.chdir(pwd)
+  if os.path.exists(root_dir):
+    os.chdir(root_dir)
+    for e in os.listdir(os.curdir):
+      if e == 'dev' or e == 'proc':
+        continue
+      path_list.extend(getPathList(e, os.sep))
+    os.chdir(pwd)
   return path_list
 
 def executeCommand(command, dry_run = 0):
@@ -236,7 +237,7 @@
   if not config.keep:
     if os.access(config.build_dir, os.F_OK):
       print '  Cleaning up the directory %s...' % config.build_dir
-      if not dry_run: 
+      if not dry_run:
         os.system('rm -rf %s' % config.build_dir)
     print '  Creating a temporary fstab...'
     if not dry_run:
@@ -504,7 +505,7 @@
   program_list = [ 'busybox', 'mke2fs', 'sfdisk', 'udevstart', 'udev', 'mount', 'umount', 'insmod', 'ifconfig','udhcpc', 'ash', 'route', 'cp', ]
   # static programs MUST be in 'program_list' too.
   static_program_list = ['busybox', 'ash', ]
-  
+
   # Modify the folowing list only if the list of programs supported by busybox changes
   busybox_supported = [ 'addgroup', 'adduser', 'adjtimex', 'ar', 'arping', 'ash',
                        'awk', 'basename', 'bunzip2', 'bzcat', 'cal', 'cat', 'chgrp', 'chmod', 'chown', 'chroot', 'chvt', 'clear', 'cmp', 'cp', 'cpio', 'crond', 'crontab', 'cut', 'date', 'dc', 'dd', 'deallocvt', 'delgroup', 'deluser', 'devfsd', 'df', 'dirname', 'dmesg', 'dos2unix', 'dpkg', 'dpkg-deb', 'du', 'dumpkmap', 'dumpleases', 'echo', 'egrep', 'env', 'expr', 'false', 'fbset', 'fdflush', 'fdformat', 'fdisk', 'fgrep', 'find', 'fold', 'free','freeramdisk', 'fsck.minix', 'ftpget', 'ftpput', 'getopt', 'getty', 'grep', 'gunzip', 'gzip', 'halt', 'hdparm', 'head', 'hexdump', 'hostid', 'hostname', 'hush', 'hwclock', 'id', 'ifconfig', 'ifdown', 'ifup', 'inetd', 'init', 'insmod', 'install', 'ip', 'ipaddr', 'ipcalc', 'iplink', 'iproute', 'iptunnel', 'kill', 'killall', 'klogd', 'lash', 'last', 'length', 'ln', 'loadfont', 'loadkmap', 'logger', 'login', 'logname', 'logread', 'losetup', 'ls', 'lsmod', 'makedevs', 'md5sum', 'mesg', 'mkdir', 'mkfifo', 'mkfs.minix', 'mknod', 'mkswap', 'mktemp', 'more', 'mount' , 'msh', 'mt', 'mv', 'nameif', 'nc', 'netstat', 'nslookup', 'od', 'openvt', 'passwd', 'patch', 'pidof', 'ping', 'ping6', 'pipe_progress', 'pivot_root', 'poweroff', 'printf', 'ps', 'pwd', 'rdate', 'readlink', 'realpath', 'reboot', 'renice', 'reset', 'rm', 'rmdir', 'rmmod', 'route', 'rpm', 'rpm2cpio', 'run-parts', 'rx', 'sed', 'seq', 'setkeycodes', 'sha1sum', 'sleep', 'sort', 'start-stop-daemon', 'strings', 'stty', 'su', 'sulogin', 'swapoff', 'swapon', 'sync', 'sysctl', 'syslogd', 'tail', 'tar', 'tee', 'telnet', 'telnetd', 'test', 'tftp', 'time', 'top', 'touch', 'tr', 'traceroute', 'true', 'tty', 'udhcpc', 'udhcpd', 'umount', 'uname', 'uncompress', 'uniq', 'unix2dos', 'unzip', 'uptime', 'usleep', 'uudecode', 'uuencode', 'vconfig', 'vi', 'vlock', 'watch', 'watchdog', 'wc', 'wget', 'which', 'who', 'whoami', 'xargs', 'yes', 'zcat', ]
@@ -716,14 +717,14 @@
         #if m is not None:
           #size = m.string[m.start(1):m.end(1)]
           #break
-	# Fixed by Christophe Dumez, probably not optimized
-	m = re.match(r'Disk geometry for\s+.*', line)
-	if m is not None:
-	  m = re.search('(?<=- ).*', line)
-	  size = m.string[m.start():m.end()]
-	  break
-      else:
-        raise RuntimeError, 'the device size of %s cannot be detected' % config.install_device
+        # Fixed by Christophe Dumez, probably not optimized
+        m = re.match(r'Disk geometry for\s+.*', line)
+        if m is not None:
+          m = re.search('(?<=- ).*', line)
+          size = m.string[m.start():m.end()]
+          break
+        else:
+          raise RuntimeError, 'the device size of %s cannot be detected' % config.install_device
       p.fromchild.close()
       if p.wait() != 0:
         raise RuntimeError, 'Failed in executing parted %s' % config.install_device




More information about the Erp5-report mailing list