Skip to content

Commit

Permalink
Final steps in replacing .tar.xz by .tar.gz
Browse files Browse the repository at this point in the history
  • Loading branch information
nkryuchkov committed Oct 20, 2020
1 parent 59b209a commit 626bc30
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ deploy:
provider: releases
file_glob: true
file:
- output/final/*.tar.xz
- fyne-cross/bin/*.tar.xz
- output/final/*.tar.gz
- fyne-cross/bin/*.tar.gz
draft: true
prerelease: true
skip_cleanup: true
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ clean_output_dir()
# Clean parts.
cd "${PARTS_ARMBIAN_DIR}" && find . -type f ! -name '*.7z' -delete
cd "${PARTS_SKYWIRE_DIR}" && find . -type f ! -name '*.tar.gz' -delete && rm -rf bin
cd "${FINAL_IMG_DIR}" && find . -type f ! -name '*.tar.xz' -delete
cd "${FINAL_IMG_DIR}" && find . -type f ! -name '*.tar.gz' -delete

# Rm base image.
rm -v "${IMAGE_DIR}/base_image"
Expand Down
12 changes: 6 additions & 6 deletions pkg/imager/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
// File extensions which we expect to see in the archive.
const (
ExtTmp = ".tmp"
ExtTarXz = ".tar.xz"
ExtTarGz = ".tar.gz"
ExtImg = ".img"
ExtMD5 = ".img.md5"
ExtSHA1 = ".img.sha1"
Expand Down Expand Up @@ -71,7 +71,7 @@ func NewBuilder(log logrus.FieldLogger, root string) (*Builder, error) {

// DownloadPath returns the path to the download file.
func (b *Builder) DownloadPath() string {
return filepath.Join(b.baseDir, "download"+ExtTarXz)
return filepath.Join(b.baseDir, "download"+ExtTarGz)
}

// DownloadTotal is a thread-safe function that returns the total download size.
Expand Down Expand Up @@ -103,15 +103,15 @@ func (b *Builder) ExtractArchive() (err error) {
pkgFile := b.DownloadPath()
log.WithField("archive_file", pkgFile).Info("Extracting...")

tarXz := archiver.NewTarXz()
tarGz := archiver.NewTarGz()
defer func() {
if err := tarXz.Close(); err != nil {
if err := tarGz.Close(); err != nil {
log.WithError(err).Error("Failed to close archiver.")
}
}()

walkFn := func(f archiver.File) error {
if _, ok := hasExtension(f.Name(), ExtTarXz); ok || f.IsDir() {
if _, ok := hasExtension(f.Name(), ExtTarGz); ok || f.IsDir() {
log.WithField("file_name", f.Name()).
Debug("Skipping...")
return nil
Expand Down Expand Up @@ -160,7 +160,7 @@ func (b *Builder) ExtractArchive() (err error) {
return nil
}

if err = tarXz.Walk(pkgFile, walkFn); err != nil {
if err = tarGz.Walk(pkgFile, walkFn); err != nil {
return err
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/imager/latest_release.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const (
)

func expectedBaseImgAssetName(tag string) string {
return fmt.Sprintf("Skybian-%s%s", tag, ExtTarXz)
return fmt.Sprintf("Skybian-%s%s", tag, ExtTarGz)
}

// LatestBaseImgURL returns the latest stable base image download URL.
Expand Down

0 comments on commit 626bc30

Please sign in to comment.