Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionally support LZO compression for snap #65

Merged
merged 2 commits into from
Aug 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion pkg/package-format/snap/snap.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ type SnapOptions struct {

arch *string
output *string

compression *string
}

func ConfigureCommand(app *kingpin.Application) {
Expand All @@ -61,6 +63,8 @@ func ConfigureCommand(app *kingpin.Application) {
executableName: command.Flag("executable", "The executable file name to create command wrapper.").String(),
extraAppArgs: command.Flag("extraAppArgs", "The extra app launch arguments").String(),
excludedAppFiles: command.Flag("exclude", "The excluded app files.").Strings(),
compression: command.Flag("compression", "The compression type when building from template.").
Short('c').Default("xz").Enum("xz", "lzo"),

arch: command.Flag("arch", "The arch.").Default("amd64").String(),

Expand Down Expand Up @@ -285,7 +289,7 @@ func buildUsingTemplate(templateDir string, options SnapOptions) error {
return errors.WithStack(err)
}

args = append(args, *options.output, "-no-progress", "-quiet", "-noappend", "-comp", "xz", "-no-xattrs", "-no-fragments", "-all-root")
args = append(args, *options.output, "-no-progress", "-quiet", "-noappend", "-comp", *options.compression, "-no-xattrs", "-no-fragments", "-all-root")

_, err = util.Execute(exec.Command(mksquashfsPath, args...))
if err != nil {
Expand Down