Commit c0d69020 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

post-processor/vagrant: Only tar files

parent e5a23492
......@@ -31,7 +31,7 @@ const defaultConfig = `
},
"post-processors": {
"compress": "packer-post-processor-compress"
"vagrant": "packer-post-processor-vagrant"
},
"provisioners": {
......
......@@ -40,6 +40,8 @@ func (p *PostProcessor) Configure(raw interface{}) error {
return fmt.Errorf("output invalid template: %s", err)
}
/*
TODO(mitchellh): We need a way to get the keys...
mapConfig, ok := raw.(map[string]interface{})
if !ok {
panic("Raw configuration not a map")
......@@ -62,6 +64,7 @@ func (p *PostProcessor) Configure(raw interface{}) error {
if len(errors) > 0 {
return &packer.MultiError{errors}
}
*/
return nil
}
......
......@@ -7,6 +7,7 @@ import (
"encoding/json"
"github.com/mitchellh/packer/packer"
"io"
"log"
"os"
"path/filepath"
"text/template"
......@@ -23,6 +24,7 @@ type OutputPathTemplate struct {
// box. This function does not perform checks to verify that dir is
// actually a proper box. This is an expected precondition.
func DirToBox(dst, dir string) error {
log.Printf("Turning dir into box: %s", dir)
dstF, err := os.Create(dst)
if err != nil {
return err
......@@ -37,6 +39,13 @@ func DirToBox(dst, dir string) error {
// This is the walk func that tars each of the files in the dir
tarWalk := func(path string, info os.FileInfo, prevErr error) error {
// Skip directories
if info.IsDir() {
log.Printf("Skiping directory '%s' for box '%s'", path, dst)
return nil
}
log.Printf("Box add: '%s' to '%s'", path, dst)
f, err := os.Open(path)
if err != nil {
return err
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment