# Copyright 2008-2014 Amazon.com, Inc. or its affiliates. All Rights # Reserved. Licensed under the Amazon Software License (the # "License"). You may not use this file except in compliance with the # License. A copy of the License is located at # http://aws.amazon.com/asl or in the "license" file accompanying this # file. This file is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See # the License for the specific language governing permissions and # limitations under the License. require 'ec2/amitools/format' require 'ec2/amitools/manifestv3' require 'ec2/amitools/unbundleparameters' require 'ec2/platform/current' require 'ec2/amitools/tool_base' UNBUNDLE_NAME = 'ec2-unbundle' UNBUNDLE_MANUAL =< e $stderr.puts e.message end # Verify digest. unless manifest.digest == digest raise "invalid digest, expected #{manifest.digest} received #{digest}" end puts "Unbundle complete." return 0 ensure File::delete( digest_pipe ) if (digest_pipe && File::exist?( digest_pipe )) end end #------------------------------------------------------------------------------# # Overrides #------------------------------------------------------------------------------# def get_manual() UNBUNDLE_MANUAL end def get_name() UNBUNDLE_NAME end def main(p) unbundle(p) end end #------------------------------------------------------------------------------# # Script entry point. Execute only if this file is being executed. if __FILE__ == $0 || $0.match(/bin\/ec2-unbundle/) Unbundler.new().run(UnbundleParameters) end