1
0
mirror of synced 2026-02-07 16:21:24 +00:00

2006-11-29 23:32:55 by steve

Minor formatting updates.
This commit is contained in:
steve
2006-11-29 23:35:20 +00:00
parent f2729f1053
commit 2de829f31e
2 changed files with 62 additions and 61 deletions

View File

@@ -29,21 +29,21 @@ xen-update-image - Update the software installed upon offline Xen images.
=item B<--dir>
Specify the directory which contains the image(s).
=item B<--evms>
Specify the EVMS container which contains the image(s).
=item B<--help>
Show the script help.
=item B<--lvm>
Specify the LVM volume group which contains the image(s).
=item B<--manual>
Read the manual.
=item B<--version>
Show the version number and exit.
=item B<--lvm>
Specify the LVM volume group which contains the image(s).
=item B<--evms>
Specify the EVMS container which contains the image(s).
=back
=cut
@@ -61,8 +61,9 @@ Specify the EVMS container which contains the image(s).
apt-get upgrade
B<NOTE> If the image is already running within Xen this will cause corruption
otherwise it will allow you to update your image without booting it.
NOTE If the image is already running within Xen this will cause
corruption otherwise it will allow you to update your image without
booting it.
=cut
@@ -86,7 +87,7 @@ Specify the EVMS container which contains the image(s).
--
http://www.steve.org.uk/
$Id: xen-update-image,v 1.16 2006-11-19 19:41:34 steve Exp $
$Id: xen-update-image,v 1.17 2006-11-29 23:32:55 steve Exp $
=cut
@@ -312,39 +313,39 @@ sub readConfigurationFile
while (defined($line = <FILE>) )
{
chomp $line;
if ($line =~ s/\\$//)
{
$line .= <FILE>;
redo unless eof(FILE);
}
if ($line =~ s/\\$//)
{
$line .= <FILE>;
redo unless eof(FILE);
}
# Skip lines beginning with comments
next if ( $line =~ /^([ \t]*)\#/ );
# Skip lines beginning with comments
next if ( $line =~ /^([ \t]*)\#/ );
# Skip blank lines
next if ( length( $line ) < 1 );
# Skip blank lines
next if ( length( $line ) < 1 );
# Strip trailing comments.
if ( $line =~ /(.*)\#(.*)/ )
{
$line = $1;
}
# Strip trailing comments.
if ( $line =~ /(.*)\#(.*)/ )
{
$line = $1;
}
# Find variable settings
if ( $line =~ /([^=]+)=([^\n]+)/ )
{
my $key = $1;
my $val = $2;
# Find variable settings
if ( $line =~ /([^=]+)=([^\n]+)/ )
{
my $key = $1;
my $val = $2;
# Strip leading and trailing whitespace.
$key =~ s/^\s+//;
$key =~ s/\s+$//;
$val =~ s/^\s+//;
$val =~ s/\s+$//;
# Strip leading and trailing whitespace.
$key =~ s/^\s+//;
$key =~ s/\s+$//;
$val =~ s/^\s+//;
$val =~ s/\s+$//;
# Store value.
$CONFIG{ $key } = $val;
}
# Store value.
$CONFIG{ $key } = $val;
}
}
close( FILE );
@@ -363,16 +364,16 @@ sub readConfigurationFile
sub parseCommandLineArguments
{
my $HELP = 0;
my $MANUAL = 0;
my $VERSION = 0;
my $HELP = 0;
my $MANUAL = 0;
my $VERSION = 0;
# Parse options.
#
GetOptions(
"dir=s", \$CONFIG{'dir'},
"lvm=s", \$CONFIG{'lvm'},
"evms=s", \$CONFIG{'evms'},
"evms=s", \$CONFIG{'evms'},
"help", \$HELP,
"manual", \$MANUAL,
"version", \$VERSION
@@ -383,14 +384,14 @@ sub parseCommandLineArguments
if ( $VERSION )
{
my $REVISION = '$Revision: 1.16 $';
my $REVISION = '$Revision: 1.17 $';
if ( $REVISION =~ /1.([0-9.]+) / )
{
$REVISION = $1;
}
print "xen-update-image release $RELEASE - CVS: $REVISION\n";
exit;
if ( $REVISION =~ /1.([0-9.]+) / )
{
$REVISION = $1;
}
print "xen-update-image release $RELEASE - CVS: $REVISION\n";
exit;
}
}
@@ -414,8 +415,8 @@ sub checkArguments
#
if ( ( $CONFIG{'lvm'} && $CONFIG{'dir'} ) || ( $CONFIG{'lvm'} && $CONFIG{'evms'} ) || ( $CONFIG{'evms'} && $CONFIG{'dir'} ) )
{
print "Please use only one of: a volume group, an EVMS container, or a directory name\n";
exit;
print "Please use only one of: a volume group, an EVMS container, or a directory name\n";
exit;
}
@@ -424,7 +425,7 @@ sub checkArguments
#
if ( (!defined( $CONFIG{'dir'} ) ) && ( !defined( $CONFIG{'lvm'} ) ) && ( !defined( $CONFIG{'evms'} ) ) )
{
print "Please specify either a directory root, an LVM volume group, or an EVMS container\n";
exit;
print "Please specify either a directory root, an LVM volume group, or an EVMS container\n";
exit;
}
}

View File

@@ -96,7 +96,7 @@ xt-create-config - Create a Xen configuration file for a new guest
--
http://www.steve.org.uk/
$Id: xt-create-xen-config,v 1.24 2006-11-19 19:41:34 steve Exp $
$Id: xt-create-xen-config,v 1.25 2006-11-29 23:35:20 steve Exp $
=cut
@@ -203,14 +203,14 @@ sub parseCommandLineArguments
if ( $VERSION )
{
my $REVISION = '$Revision: 1.24 $';
if ( $REVISION =~ /1.([0-9.]+) / )
{
$REVISION = $1;
}
my $REVISION = '$Revision: 1.25 $';
if ( $REVISION =~ /1.([0-9.]+) / )
{
$REVISION = $1;
}
print "xt-create-xen-config release $RELEASE - CVS: $REVISION\n";
exit;
print "xt-create-xen-config release $RELEASE - CVS: $REVISION\n";
exit;
}
}
@@ -286,7 +286,7 @@ sub createXenConfig
#
# The template we're going to read from.
#
my $template = new Text::Template( TYPE => 'FILE',
my $template = new Text::Template( TYPE => 'FILE',
SOURCE => $CONFIG{'template'} );
@@ -354,7 +354,7 @@ sub createXenConfig
#
# The template file gets a complete copy of our configuration values.
#
my $result = $template->fill_in(HASH => \%vars);
my $result = $template->fill_in( HASH => \%vars );
#
# Write the output of processing the template file, if it succeeds.