[andrew@walrond.org: Another ruby-vim indent problem]

Doug Kearns dougkearns at gmail.com
Tue May 3 00:04:05 EDT 2005


----- Forwarded message from Andrew Walrond <andrew at walrond.org> -----

From: Andrew Walrond <andrew at walrond.org>
User-Agent: KMail/1.7.2
Date: Mon, 2 May 2005 22:06:15 +0100
Subject: Another ruby-vim indent problem
To: Doug Kearns <dougkearns at gmail.com>

Hi Doug

The attached file ends up way over to the right...

Andrew

----- End forwarded message -----
-------------- next part --------------
# Populate the root filesystem with the basic directories and files.
# Only used during bootstrap.
#
def populate_fs()
	puts('Populating root filesystem')
	$root.cd {
		umask(0) {
		%w{ dev etc home include lib mnt pkg proc share sys }.each { |d| d.mkdir(0755) }
		'etc/fstab'.ftouch('#<fs>        <mountpoint>  <type>   <opts>        <backup?> <pass #>',
						   '#/dev/hda1    /             ext3     noatime          0        1',
						   '#/dev/hda2    /mnt/root2    ext3     noauto,noatime   1        2',
						   '#/dev/hda3    none          swap     sw               0        0',
						   '#/dev/hda4    /home         ext3     noatime          1        2',
						   '#/dev/hdc1    /mnt/cdrom    iso9660  noauto,ro        0        0'
						  ).chmod(0644)
						  'etc/hosts'.ftouch('# Hostname-to-address mappings for the TCP/IP subsystem',
											 '# IP address     FQDN             Alias(es)',
											 '127.0.0.1        localhost',
											 '127.0.0.1        heretic.local-domain'
											).chmod(0644)
											'etc/host.conf'.ftouch('# Resolver configuration file',
																   'order hosts,bind',
																   'multi on'
																  ).chmod(0644)
																  'etc/mtab'.ftouch('').chmod(0644)
																  'etc/networks'.ftouch('# Netname-to-address mappings for the TCP/IP subsystem',
																						'# Netname  IP address',
																						'loopback   127.0.0.1'
																					   ).chmod(0644)
																					   'etc/nsswitch.conf'.ftouch('passwd:         db files',
																												  'group:          db files',
																												  'shadow:         db files',
																												  'hosts:          files dns',
																												  'networks:       files dns',
																												  'protocols:      db files',
																												  'services:       db files',
																												  'ethers:         db files',
																												  'rpc:            db files',
																												  'netgroup:       db files'
																												 ).chmod(0644)
																												 'etc/protocols'.ftouch('# Protocols available from the TCP/IP subsystem.',
																																		'ip      0       IP      # internet protocol, pseudo protocol number',
																																		'icmp    1       ICMP    # internet control message protocol',
																																		'igmp    2       IGMP    # internet group multicast protocol',
																																		'ggp     3       GGP     # gateway-gateway protocol',
																																		'tcp     6       TCP     # transmission control protocol',
																																		'pup     12      PUP     # PARC universal packet protocol',
																																		'udp     17      UDP     # user datagram protocol',
																																		'idp     22      IDP     # WhatsThis?',
																																		'raw     255     RAW     # RAW IP interface'
																																	   ).chmod(0644)
																																	   'etc/resolv.conf'.ftouch().chmod(0644)
																																	   unless 'etc/services'.exists?
																																		   path(HERETIXDIR,'port-numbers').cp('etc/services')
																																		   'etc/services'.fedit { |line|
																																			   line.gsub!("\C-M","")
																																			   if line =~ /(^\S+)\s+(\d+)\/(\S+)\s+(\S+|$)/
																																				   sname,sport,sencap,sdesc = $1,$2,$3,$4
																																				   line.replace "#{$1.ljust(20)} #{$2.rjust(5)}/#{$3.ljust(6)}##{$4}\n"
																																			   else
																																				   line.replace("#"+line) unless line[0]==?#
																																			   end
																																		   }
																																	   end
																																	   'home/public'.mkdir(01777)
																																	   'home/root'.mkdir(0700)
																																	   'pkg/.snapshot'.mkdir(0755)
																																	   'tmp'.mkdir.chmod(01777)
																																	   'usr'.symlink('.')
	}
	}
end


# Create the basic device files in /dev. Heretix uses hotplug/udev when booting normally,
# but these devices are needed during early boot, bootstrap and chroot operation.
#
def make_devices()
	puts('Populating /dev')
	$root.cd {
		umask(0) {
		'dev'.cd {
		%w{ shm pts input rd usb isdn cpu cpu/0 cpu/1 i2o net watchdogs dri }.each { |d| d.mkdir(0755) }

		# Load the devices file
		devices = path(HERETIXDIR,'devices').fread()

		devices.each { |line|
			next unless line =~ /(\S+)\s+(\S+)\s+(\S+)\s+(\d+)\s+(\S)\s+(\d+)\s+(\d+)/
			raise 'makedev' unless $1.exists? or system("mknod --mode #{$4} #{$1} #{$5} #{$6} #{$7}")
			$1.chown(User[$2].uid,Group[$3].gid)
		}

		{
			'/proc/self/fd'=>'fd','fd/0'=>'stdin','fd/1'=>'stdout','fd/2'=>'stderr',
			'/proc/kcore'=>'core','ram0'=>'ramdisk'
		}.each { |s,d| d.symlink(s) }
	}
	}
	}
end


More information about the vim-ruby-devel mailing list