Skip to content

Commit

Permalink
convert appliance only when there is no vmx file or the xml.vmx-input…
Browse files Browse the repository at this point in the history
… file is newer than existing vmx file
  • Loading branch information
goldmann committed Jan 22, 2009
1 parent af6a919 commit b01f27f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/jboss-cloud/appliance-vmx-image.rb
Expand Up @@ -43,7 +43,10 @@ def define_precursors
#execute_command( "virt-pack -o $PWD/#{@build_dir}/appliances/#{@arch} #{@appliance_xml_file}.vmx-input" )

vmx_file = File.dirname( @appliance_xml_file) + "/" + File.basename( @appliance_xml_file, ".xml" ) + '.vmx'
execute_command( "#{Dir.pwd}/lib/python-virtinst/virt-convert -o vmx #{@appliance_xml_file}.vmx-input #{File.dirname( @appliance_xml_file)}/" ) unless ( File.exists?( vmx_file ) )

if ( !File.exists?( vmx_file ) || File.new( "#{@appliance_xml_file}.vmx-input" ).mtime > File.new( vmx_file ).mtime )
execute_command( "#{Dir.pwd}/lib/python-virtinst/virt-convert -o vmx #{@appliance_xml_file}.vmx-input #{File.dirname( @appliance_xml_file)}/" )
end

if ( File.exists?( vmx_file ) )

Expand Down

0 comments on commit b01f27f

Please sign in to comment.