heres a patch correcting an error in the previous patch of the same
topic - not doing hooks on noinstall led to not have exported the
config in ENV.

so i pulled this function out and run it anyway, immediately after
reading all configs

now here the full, corrected patch
BTW: maybe the ENV should also be used in xt-install-image , currently
there seems to be some code duplication as reading configs and parsing
args is done there again.
I am not sure if any user is really using the xt-* scripts on their
own, xen-create-image provides a nice unified frontend.


[EMAIL PROTECTED]:/hier/sources/xen-tools/xen-tools-cvs_noinstall$ cvs
diff 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 -r1.110 xen-create-image
598a599,600
# now all config vars should be defined - export them for external commands
exportConfigVariables();
696c698,702
< installSystem();
---
if ( $CONFIG{'noinstall'} ne 1 )
{
      installSystem();
}

700c706
< #  Make sure the installation succeeded.
---
#  Make sure the installation succeeded - only if install was run
702c708
< if ( ! -x $MOUNT_POINT . "/bin/ls" )
---
if ( $CONFIG{'noinstall'} ne 1 && ! -x $MOUNT_POINT . "/bin/ls" )
714c720,723
< runCustomisationHooks();
---
if ( $CONFIG{'noinstall'} ne 1 )
{
      runCustomisationHooks();
}
1369a1379,1386

    # if config noinstall isn't set set it to exact 0 explicitly
    if  ( !  $CONFIG{'noinstall'} || $CONFIG{'noinstall'} eq 0 ){
        $CONFIG{'noinstall'} = 0;
    } else {
      $CONFIG{'noinstall'} = 1;
    }

2224,2234d2240
<     #  Setup the environment for the child processes.
<     #
<     foreach my $key ( keys %CONFIG )
<     {
<         if ( defined( $CONFIG{$key} ) )
<         {
<             $ENV{$key} = $CONFIG{$key};
<         }
<     }
<
<     #
2282a2289,2312
=begin doc

  pulled here from runcustomizationhooks - we need it also when customizing
  doesn't happen, for example xet-create-config assumes
  the config variables in $ENV

=end doc

=cut


sub exportConfigVariables(){
    #
    #  Setup the environment for the child processes.
    #
    foreach my $key ( keys %CONFIG )
    {
        if ( defined( $CONFIG{$key} ) )
        {
            $ENV{$key} = $CONFIG{$key};
        }
    }
}



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to