Restore configuration structure from vtolstov's branch
This commit is contained in:
parent
b2ad92f414
commit
2d6f8279e6
|
@ -2,23 +2,47 @@ package compress
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"archive/tar"
|
"archive/tar"
|
||||||
|
"archive/zip"
|
||||||
|
"compress/flate"
|
||||||
"compress/gzip"
|
"compress/gzip"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"gopkg.in/yaml.v2"
|
||||||
|
|
||||||
|
"github.com/biogo/hts/bgzf"
|
||||||
|
"github.com/klauspost/pgzip"
|
||||||
"github.com/mitchellh/packer/common"
|
"github.com/mitchellh/packer/common"
|
||||||
"github.com/mitchellh/packer/helper/config"
|
"github.com/mitchellh/packer/helper/config"
|
||||||
"github.com/mitchellh/packer/packer"
|
"github.com/mitchellh/packer/packer"
|
||||||
"github.com/mitchellh/packer/template/interpolate"
|
"github.com/mitchellh/packer/template/interpolate"
|
||||||
|
"github.com/pierrec/lz4"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Metadata map[string]Metaitem
|
||||||
|
|
||||||
|
type Metaitem struct {
|
||||||
|
CompSize int64 `yaml:"compsize"`
|
||||||
|
OrigSize int64 `yaml:"origsize"`
|
||||||
|
CompType string `yaml:"comptype"`
|
||||||
|
CompDate string `yaml:"compdate"`
|
||||||
|
}
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
common.PackerConfig `mapstructure:",squash"`
|
common.PackerConfig `mapstructure:",squash"`
|
||||||
|
|
||||||
OutputPath string `mapstructure:"output"`
|
OutputPath string `mapstructure:"output"`
|
||||||
|
OutputFile string `mapstructure:"file"`
|
||||||
ctx interpolate.Context
|
Compression int `mapstructure:"compression"`
|
||||||
|
Metadata bool `mapstructure:"metadata"`
|
||||||
|
NumCPU int `mapstructure:"numcpu"`
|
||||||
|
Format string `mapstructure:"format"`
|
||||||
|
KeepInputArtifact bool `mapstructure:"keep_input_artifact"`
|
||||||
|
ctx *interpolate.Context
|
||||||
}
|
}
|
||||||
|
|
||||||
type PostProcessor struct {
|
type PostProcessor struct {
|
||||||
|
@ -205,7 +229,7 @@ func (p *PostProcessor) cmpTAR(src []string, dst string) ([]string, error) {
|
||||||
return nil, fmt.Errorf("tar error on stat of %s: %s", name, err)
|
return nil, fmt.Errorf("tar error on stat of %s: %s", name, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
target, _ := os.Readlink(path)
|
target, _ := os.Readlink(name)
|
||||||
header, err := tar.FileInfoHeader(fi, target)
|
header, err := tar.FileInfoHeader(fi, target)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("tar error reading info for %s: %s", name, err)
|
return nil, fmt.Errorf("tar error reading info for %s: %s", name, err)
|
||||||
|
|
Loading…
Reference in New Issue