package: xen-tools
Tags: patch
probably the main config file reading method does not check for the
main config file, because it should also work gicing all arguments on
the command line.
However, using --config with a nonexisting file is not usefull. And
it's helpful for users to be alterted when they do it instead of just
ignoring this.
Here's a patch.
[EMAIL PROTECTED]:/hier/sources/xen-tools/xen-tools-cvs$ cvs diff -u
bin/xen-create-image
cvs diff: CVS password file /home/henning/.cvspass does not exist -
creating a new file
Index: bin/xen-create-image
===================================================================
RCS file: /home/cvs/xen-tools/bin/xen-create-image,v
retrieving revision 1.110
diff -u -r1.110 xen-create-image
--- bin/xen-create-image 5 Dec 2006 15:04:31 -0000 1.110
+++ bin/xen-create-image 9 Dec 2006 13:19:55 -0000
@@ -582,10 +582,13 @@
#
# If we received a configuration file then read it.
#
+
if ( $CONFIG{'config'} )
{
my $path = $CONFIG{'config'};
+
+
# If not fully-qualified then read from /etc/xen-tools.
if ( $path !~ /^[\/]/ )
{
@@ -593,7 +596,14 @@
}
# Read the file, if it exists.
- readConfigurationFile( $path ) if ( -e $path );
+ if ( -e $path )
+ {
+ readConfigurationFile( $path );
+ } else {
+ # extra config file should be there or not given
+ logprint( "Error: Given config file $path does not exist.\n" );
+ exit;
+ }
}
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]