Skip to content

Commit

Permalink
use tar pointer config
Browse files Browse the repository at this point in the history
  • Loading branch information
briandowns committed May 9, 2019
1 parent fc9eabf commit 869d168
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions jail/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ func (j *jailService) extractBasePkgs() error {
t := j.metrics.NewTiming()
defer t.Send("base.extract_packages_time")
fullPath := j.conf.Jails.BaseJailDir + "/releases/" + j.conf.Release
txz := &archiver.TarXz{}
txz := archiver.TarXz{
Tar: &archiver.Tar{
MkdirAll: true,
OverwriteExisting: true,
},
}
for _, p := range basePackages {
if err := txz.Unarchive("/tmp/"+j.conf.Release+"/"+p, fullPath); err != nil {
return err
Expand Down Expand Up @@ -185,7 +190,12 @@ func (j *jailService) installGo() error {
}
src := fmt.Sprintf("/tmp/go%s.freebsd-amd64.tar.gz", j.conf.GoVersion)
dst := fmt.Sprintf("%s/releases/%s/usr/local", j.conf.Jails.BaseJailDir, j.conf.Release)
tgz := &archiver.TarGz{}
tgz := archiver.TarGz{
Tar: &archiver.Tar{
MkdirAll: true,
OverwriteExisting: true,
},
}
if err := tgz.Unarchive(src, dst); err != nil {
return err
}
Expand Down

0 comments on commit 869d168

Please sign in to comment.