Skip to content

Commit

Permalink
fixed integration
Browse files Browse the repository at this point in the history
  • Loading branch information
itsManjeet committed Oct 19, 2023
1 parent ef45336 commit 292ca4b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion internal/builder/integrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,16 @@ func (b *Builder) Integrate(container *container.Container, e *element.Element,
return container.Shell(err)
}
} else {

args := []string{"tar", "-xPhf", path.Join("/", "cache", path.Base(cachefile)), "-C", rootdir}
if rootdir == "/" {
for _, exclude := range []string{"etc/hosts", "etc/hostname", "etc/resolve.conf", "proc", "sys", "dev", "run"} {
args = append(args, "--exclude='./"+exclude+"'")
}
}

color.Process("Integrating %s, %s", e.Id, path.Base(cachefile))
if err := container.Execute("tar", "-xf", path.Join("/", "cache", path.Base(cachefile)), "-C", rootdir); err != nil {
if err := container.Execute(args...); err != nil {
return container.Shell(err)
}
}
Expand Down

0 comments on commit 292ca4b

Please sign in to comment.