Class: FPM::Package::Snap

Inherits:
FPM::Package show all
Defined in:
lib/fpm/package/snap.rb

Overview

Support for snaps (.snap files).

This supports the input and output of snaps.

Instance Attribute Summary

Attributes inherited from FPM::Package

#architecture, #attributes, #attrs, #category, #config_files, #conflicts, #dependencies, #description, #directories, #epoch, #iteration, #license, #maintainer, #name, #provides, #replaces, #scripts, #url, #vendor, #version

Instance Method Summary collapse

Methods inherited from FPM::Package

apply_options, #build_path, #cleanup, #cleanup_build, #cleanup_staging, #convert, #converted_from, default_attributes, #edit_file, #files, inherited, #initialize, option, #script, #staging_path, #type, type, types

Methods included from Util

#ar_cmd, #ar_cmd_deterministic?, #copied_entries, #copy_entry, #copy_metadata, #default_shell, #erbnew, #execmd, #expand_pessimistic_constraints, #logger, #program_exists?, #program_in_path?, #safesystem, #safesystemout, #tar_cmd, #tar_cmd_supports_sort_names_and_set_mtime?

Constructor Details

This class inherits a constructor from FPM::Package

Instance Method Details

#input(input_snap) ⇒ Object

Input a snap



38
39
40
41
# File 'lib/fpm/package/snap.rb', line 38

def input(input_snap)
  extract_snap_to_staging input_snap
  
end

#output(output_snap) ⇒ Object

Output a snap.



44
45
46
47
48
49
50
51
52
# File 'lib/fpm/package/snap.rb', line 44

def output(output_snap)
  output_check(output_snap)

  write_snap_yaml

  # Create the snap from the staging path
  safesystem("mksquashfs", staging_path, output_snap, "-noappend", "-comp",
             "xz", "-no-xattrs", "-no-fragments", "-all-root")
end

#to_s(format = nil) ⇒ Object

def output



54
55
56
57
58
# File 'lib/fpm/package/snap.rb', line 54

def to_s(format=nil)
  # Default format if nil
  # name_version_arch.snap
  return super(format.nil? ? "NAME_FULLVERSION_ARCH.EXTENSION" : format)
end