Skip to content

Commit

Permalink
shared: Update for Incus packages
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
  • Loading branch information
stgraber committed Sep 13, 2023
1 parent fb3319f commit 532b85e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions shared/archive_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ import (
"strings"

incus "github.com/lxc/incus/shared"
"github.com/lxc/incus/shared/archive"
"github.com/lxc/incus/shared/subprocess"
"golang.org/x/sys/unix"
)

// Unpack unpacks a tarball.
func Unpack(file string, path string) error {
extractArgs, extension, _, err := incus.DetectCompression(file)
extractArgs, extension, _, err := archive.DetectCompression(file)
if err != nil {
return err
}
Expand Down Expand Up @@ -56,11 +58,11 @@ func Unpack(file string, path string) error {
return fmt.Errorf("Unsupported image format: %s", extension)
}

err = incus.RunCommandWithFds(context.TODO(), reader, nil, command, args...)
err = subprocess.RunCommandWithFds(context.TODO(), reader, nil, command, args...)
if err != nil {
// We can't create char/block devices in unpriv containers so ignore related errors.
if command == "unsquashfs" {
var runError *incus.RunError
var runError *subprocess.RunError

ok := errors.As(err, &runError)
if !ok || runError.StdErr().String() == "" {
Expand Down

0 comments on commit 532b85e

Please sign in to comment.