[Fai-commit] r3669 - people/michael/features/setup_harddisks_2/implementation

fai-commit at lists.alioth.debian.org fai-commit at lists.alioth.debian.org
Sun Jul 23 20:05:49 UTC 2006


Author: michael-guest
Date: 2006-07-23 20:05:49 +0000 (Sun, 23 Jul 2006)
New Revision: 3669

Modified:
   people/michael/features/setup_harddisks_2/implementation/Makefile
   people/michael/features/setup_harddisks_2/implementation/shdd2
   people/michael/features/setup_harddisks_2/implementation/shdd2-commands
   people/michael/features/setup_harddisks_2/implementation/shdd2-exec
   people/michael/features/setup_harddisks_2/implementation/shdd2-fstab
   people/michael/features/setup_harddisks_2/implementation/shdd2-init
   people/michael/features/setup_harddisks_2/implementation/shdd2-lib
   people/michael/features/setup_harddisks_2/implementation/shdd2-parser
   people/michael/features/setup_harddisks_2/implementation/shdd2-sizes
Log:
whitespace cleanup and some comments added 


Modified: people/michael/features/setup_harddisks_2/implementation/Makefile
===================================================================
--- people/michael/features/setup_harddisks_2/implementation/Makefile	2006-07-23 19:43:59 UTC (rev 3668)
+++ people/michael/features/setup_harddisks_2/implementation/Makefile	2006-07-23 20:05:49 UTC (rev 3669)
@@ -1,7 +1,15 @@
 .PHONY: tidy move
 
+FILES = shdd2 \
+	shdd2-commands \
+	shdd2-exec \
+	shdd2-fstab \
+	shdd2-init \
+	shdd2-lib \
+	shdd2-sizes
+
 tidy:
-	perltidy -bl -i=2 shdd2-*
+	perltidy -bl -i=2 $(FILES)
 
 move:
 	for i in shdd2*.tdy ; do mv $$i `echo $$i | sed 's/.tdy//'` ; done

Modified: people/michael/features/setup_harddisks_2/implementation/shdd2
===================================================================
--- people/michael/features/setup_harddisks_2/implementation/shdd2	2006-07-23 19:43:59 UTC (rev 3668)
+++ people/michael/features/setup_harddisks_2/implementation/shdd2	2006-07-23 20:05:49 UTC (rev 3669)
@@ -10,7 +10,7 @@
 # WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 # General Public License for more details.
-# 
+#
 # A copy of the GNU General Public License is available as
 # `/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
 # or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html. You
@@ -25,8 +25,8 @@
 # @file shdd2
 #
 # @brief The main function of setup harddisks 2 - the tool to configure the
-# partitioning from within FAI. 
-# 
+# partitioning from within FAI.
+#
 # This is an implementation from scratch to properly support LVM and RAID. The
 # input format is documented in @ref shdd2-parser
 #
@@ -67,11 +67,13 @@
 foreach my $cmd (@FAI::commands)
 {
   print $cmd . "\n";
+
   # &FAI::execute_command($cmd);
 }
 
 # generate the proposed fstab contents
 my @fstab = &FAI::generate_fstab( \%FAI::configs );
+
 # TODO - debugging only; print fstab
 foreach my $line (@fstab)
 {

Modified: people/michael/features/setup_harddisks_2/implementation/shdd2-commands
===================================================================
--- people/michael/features/setup_harddisks_2/implementation/shdd2-commands	2006-07-23 19:43:59 UTC (rev 3668)
+++ people/michael/features/setup_harddisks_2/implementation/shdd2-commands	2006-07-23 20:05:49 UTC (rev 3669)
@@ -10,7 +10,7 @@
 # WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 # General Public License for more details.
-# 
+#
 # A copy of the GNU General Public License is available as
 # `/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
 # or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html. You

Modified: people/michael/features/setup_harddisks_2/implementation/shdd2-exec
===================================================================
--- people/michael/features/setup_harddisks_2/implementation/shdd2-exec	2006-07-23 19:43:59 UTC (rev 3668)
+++ people/michael/features/setup_harddisks_2/implementation/shdd2-exec	2006-07-23 20:05:49 UTC (rev 3669)
@@ -10,7 +10,7 @@
 # WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 # General Public License for more details.
-# 
+#
 # A copy of the GNU General Public License is available as
 # `/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
 # or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html. You

Modified: people/michael/features/setup_harddisks_2/implementation/shdd2-fstab
===================================================================
--- people/michael/features/setup_harddisks_2/implementation/shdd2-fstab	2006-07-23 19:43:59 UTC (rev 3668)
+++ people/michael/features/setup_harddisks_2/implementation/shdd2-fstab	2006-07-23 20:05:49 UTC (rev 3669)
@@ -10,7 +10,7 @@
 # WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 # General Public License for more details.
-# 
+#
 # A copy of the GNU General Public License is available as
 # `/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
 # or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html. You

Modified: people/michael/features/setup_harddisks_2/implementation/shdd2-init
===================================================================
--- people/michael/features/setup_harddisks_2/implementation/shdd2-init	2006-07-23 19:43:59 UTC (rev 3668)
+++ people/michael/features/setup_harddisks_2/implementation/shdd2-init	2006-07-23 20:05:49 UTC (rev 3669)
@@ -10,7 +10,7 @@
 # WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 # General Public License for more details.
-# 
+#
 # A copy of the GNU General Public License is available as
 # `/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
 # or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html. You

Modified: people/michael/features/setup_harddisks_2/implementation/shdd2-lib
===================================================================
--- people/michael/features/setup_harddisks_2/implementation/shdd2-lib	2006-07-23 19:43:59 UTC (rev 3668)
+++ people/michael/features/setup_harddisks_2/implementation/shdd2-lib	2006-07-23 20:05:49 UTC (rev 3669)
@@ -10,7 +10,7 @@
 # WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 # General Public License for more details.
-# 
+#
 # A copy of the GNU General Public License is available as
 # `/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
 # or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html. You

Modified: people/michael/features/setup_harddisks_2/implementation/shdd2-parser
===================================================================
--- people/michael/features/setup_harddisks_2/implementation/shdd2-parser	2006-07-23 19:43:59 UTC (rev 3668)
+++ people/michael/features/setup_harddisks_2/implementation/shdd2-parser	2006-07-23 20:05:49 UTC (rev 3669)
@@ -237,7 +237,7 @@
     # no further checks for the disk label being msdos have to be performed in
     # this branch, it has been ensured above
 
-# find the index of the new partition, initialise it to the highest current index
+    # find the index of the new partition, initialise it to the highest current index
     foreach
       my $part_id ( sort keys %{ $FAI::configs{$FAI::device}{"partitions"} } )
     {
@@ -347,13 +347,18 @@
 $FAI::Parser = Parse::RecDescent->new(
   q{
     file: line(s?) /\Z/
+        {
+        }
+
     line: <skip: qr/[ \t]*/> "\\n"
         | <skip: qr/[ \t]*/> comment "\\n"
         | <skip: qr/[ \t]*/> config "\\n"
-        #| <error>
+
     comment: /^\s*#.*/
+
     config: 'disk_config' disk_config_arg
         | volume
+
     disk_config_arg: 'raid'
         {
           # check, whether raid tools are available
@@ -387,6 +392,7 @@
           &FAI::init_disk_config( $item[ 1 ] );
         }
         option(s?)
+
     option: /^preserve:(\d+(,\d+)*)/
         {
           # set the preserve flag for all ids
@@ -420,6 +426,7 @@
           # TODO not yet implemented
           $FAI::configs{ $FAI::device }{ "virtual" } = 1;
         }
+
     volume: 'vg' name devices
         | /^raid([0156])\s+/
         {
@@ -439,6 +446,7 @@
         }
         mountpoint devices filesystem mount_options fs_options
         | type mountpoint size filesystem mount_options fs_options
+
     type: 'primary'
         {
           # initialise a primary partition
@@ -465,6 +473,7 @@
           # the reference is used by all further processing of this config line
           $FAI::partition_pointer = ( \%FAI::configs )->{$FAI::device}->{"volumes"}->{$2};
         }
+
     mountpoint: '-'
         {
           # this partition should not be mounted
@@ -480,6 +489,7 @@
           # set the mount point
           $FAI::partition_pointer->{ "mountpoint" } = $item[ 1 ];
         }
+
     name: m{^([^/\s\-]+)\s+}
         {
           # make sure this line is part of an LVM configuration
@@ -495,6 +505,7 @@
           # initialise the list of physical devices
           $FAI::configs{$FAI::device}{"devices"} = ();
         }
+
     size: /^(\d+%?(-(\d+%?)?)?)(:resize)?\s+/
         {
           # complete the size specification to be a range in all cases
@@ -535,6 +546,7 @@
           }
         }
         | <error: invalid partition size near "$text">
+
     devices: /^([^\d,:\s\-][^,:\s]*(:(spare|missing))*(,[^,:\s]+(:(spare|missing))*)*)\s+/
         {
           # split the device list by ,
@@ -575,10 +587,12 @@
           }
         }
         | <error: invalid device spec "$text">
+
     mount_options: /\S+/
         {
           $FAI::partition_pointer->{ "mount_options" } = $item[ 1 ];
         }
+
     filesystem: '-'
         {
           $FAI::partition_pointer->{ "filesystem" } = $item[ 1 ];
@@ -592,6 +606,7 @@
           ( &FAI::in_path("mkfs.$item[1]") == 1 ) or die "unknown/invalid filesystem type $item[1]";
           $FAI::partition_pointer->{ "filesystem" } = $item[ 1 ];
         }
+
     fs_options: /.*/
         {
           $FAI::partition_pointer->{ "fs_options" } = $item[ 1 ];
@@ -599,15 +614,23 @@
 }
 );
 
+################################################################################
+#
+# @brief Parse the data from <STDIN> using @ref $FAI::Parser
+#
+################################################################################
 sub run_parser
 {
+  # read <STDIN> to a single string (not a list), thus $/ has to be unset
   my $ifs = $/;
   undef $/;
   my $input = <STDIN>;
   $/ = $ifs;
 
+  # print the contents of <STDIN> for debugging purposes
   ( $FAI::debug > 0 ) and print "Input was:\n" . $input;
 
+  # attempt to parse $input - any error will lead to termination
   defined $FAI::Parser->file($input) or die "Syntax error\n";
 }
 

Modified: people/michael/features/setup_harddisks_2/implementation/shdd2-sizes
===================================================================
--- people/michael/features/setup_harddisks_2/implementation/shdd2-sizes	2006-07-23 19:43:59 UTC (rev 3668)
+++ people/michael/features/setup_harddisks_2/implementation/shdd2-sizes	2006-07-23 20:05:49 UTC (rev 3669)
@@ -10,7 +10,7 @@
 # WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 # General Public License for more details.
-# 
+#
 # A copy of the GNU General Public License is available as
 # `/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
 # or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html. You




More information about the Fai-commit mailing list