|
|
|
@ -19,6 +19,7 @@ import (
|
|
|
|
|
"archive/tar"
|
|
|
|
|
"bytes"
|
|
|
|
|
"compress/gzip"
|
|
|
|
|
"fmt"
|
|
|
|
|
"io"
|
|
|
|
|
"os"
|
|
|
|
|
"path"
|
|
|
|
@ -78,7 +79,7 @@ func NewExtractor(source string) (Extractor, error) {
|
|
|
|
|
return extractor, nil
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return nil, errors.Errorf("no extractor implemented yet for %s", source)
|
|
|
|
|
return nil, fmt.Errorf("no extractor implemented yet for %s", source)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// NewHTTPInstaller creates a new HttpInstaller.
|
|
|
|
@ -151,7 +152,7 @@ func (i *HTTPInstaller) Install() error {
|
|
|
|
|
// Update updates a local repository
|
|
|
|
|
// Not implemented for now since tarball most likely will be packaged by version
|
|
|
|
|
func (i *HTTPInstaller) Update() error {
|
|
|
|
|
return errors.Errorf("method Update() not implemented for HttpInstaller")
|
|
|
|
|
return fmt.Errorf("method Update() not implemented for HttpInstaller")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Path is overridden because we want to join on the plugin name not the file name
|
|
|
|
@ -261,7 +262,7 @@ func (g *TarGzExtractor) Extract(buffer *bytes.Buffer, targetDir string) error {
|
|
|
|
|
case tar.TypeXGlobalHeader, tar.TypeXHeader:
|
|
|
|
|
continue
|
|
|
|
|
default:
|
|
|
|
|
return errors.Errorf("unknown type: %b in %s", header.Typeflag, header.Name)
|
|
|
|
|
return fmt.Errorf("unknown type: %b in %s", header.Typeflag, header.Name)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|