Skip to content

Commit 1c6db54

Browse files
authored
Merge pull request #690 from SteveL-MSFT/tgz
Backport: Change how tar.gz archive is created to just use `tar`
2 parents 631d0e1 + 2ffe90d commit 1c6db54

File tree

2 files changed

+84
-77
lines changed

2 files changed

+84
-77
lines changed

build.ps1

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -689,20 +689,21 @@ if ($packageType -eq 'msixbundle') {
689689
$architecture
690690
}
691691

692-
$packageName = "DSC-$productVersion-$productArchitecture.tar"
692+
Write-Verbose -Verbose "Creating tar.gz file"
693+
$packageName = "DSC-$productVersion-$productArchitecture.tar.gz"
693694
$tarFile = Join-Path $PSScriptRoot 'bin' $packageName
694-
tar cvf $tarFile -C $tgzTarget .
695+
tar -czvf $tarFile -C $tgzTarget .
695696
if ($LASTEXITCODE -ne 0) {
696-
throw "Failed to create tar file"
697+
throw "Failed to create tar.gz file"
697698
}
698-
Write-Host -ForegroundColor Green "`nTar file is created at $tarFile"
699699

700-
$gzFile = "$tarFile.gz"
701-
gzip -c $tarFile > $gzFile
702-
if ($LASTEXITCODE -ne 0) {
703-
throw "Failed to create gz file"
700+
# check it's valid
701+
$out = file $tarFile
702+
if ($out -notmatch 'gzip compressed data') {
703+
throw "Invalid tar.gz file"
704704
}
705-
Write-Host -ForegroundColor Green "`nGz file is created at $gzFile"
705+
706+
Write-Host -ForegroundColor Green "`ntar.gz file is created at $tarFile"
706707
}
707708

708709
$env:RUST_BACKTRACE=1

0 commit comments

Comments
 (0)