mirror of
https://github.com/mudler/luet.git
synced 2025-07-31 23:05:03 +00:00
Generate empty tar
This commit is contained in:
parent
876e3659fb
commit
86c256a062
@ -16,6 +16,7 @@
|
|||||||
package compiler
|
package compiler
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"archive/tar"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
@ -438,12 +439,15 @@ func (cs *LuetCompiler) genArtifact(p CompilationSpec, builderOpts, runnerOpts C
|
|||||||
|
|
||||||
if len(p.BuildSteps()) == 0 && len(p.GetPreBuildSteps()) == 0 && !unpack {
|
if len(p.BuildSteps()) == 0 && len(p.GetPreBuildSteps()) == 0 && !unpack {
|
||||||
fakePackage := p.Rel(p.GetPackage().GetFingerPrint() + ".package.tar")
|
fakePackage := p.Rel(p.GetPackage().GetFingerPrint() + ".package.tar")
|
||||||
// We can't generate delta in this case. It implies the package is a virtual, and nothing as to be done really
|
// We can't generate delta in this case. It implies the package is a virtual, and nothing has to be done really
|
||||||
|
|
||||||
file, err := os.Create(fakePackage)
|
file, err := os.Create(fakePackage)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "Failed creating virtual package")
|
return nil, errors.Wrap(err, "Failed creating virtual package")
|
||||||
}
|
}
|
||||||
file.Close()
|
defer file.Close()
|
||||||
|
tw := tar.NewWriter(file)
|
||||||
|
defer tw.Close()
|
||||||
|
|
||||||
artifact := NewPackageArtifact(fakePackage)
|
artifact := NewPackageArtifact(fakePackage)
|
||||||
artifact.SetCompressionType(cs.CompressionType)
|
artifact.SetCompressionType(cs.CompressionType)
|
||||||
|
Loading…
Reference in New Issue
Block a user