Class: FRM::Release

Inherits:
Base
  • Object
show all
Defined in:
lib/frm.rb

Instance Method Summary collapse

Methods inherited from Base

#compute_md5, #compute_sha1, #compute_sha2, #generate_gzip_pipe, #gpg_clearsign, #gpg_detached, #gpg_export_pubkey, #gunzip_pipe, #handle_errors, #run

Constructor Details

#initialize(opts = {}) ⇒ Release

Returns a new instance of Release.



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/frm.rb', line 20

def initialize(opts={})
  super()
  @opts = opts
  @opts[:component] ||= 'main'
  @opts[:origin] ||= 'FRM'
  @opts[:label] ||= 'FRM'
  @opts[:description] = "FRM apt repo"
  @opts[:release] ||= run ". /etc/lsb-release && echo $DISTRIB_CODENAME"
  handle_errors{@time = Net::NTP.get("us.pool.ntp.org").time.getutc}

  case run("uname -m")
  when "x86_64"
    @opts[:arch] ||= 'amd64'
  else
    @opts[:arch] ||= run "uname -m"
  end

  @opts[:remote_store] = FRM::S3.new(opts)
  @arch_releases = [ArchRelease.new(opts)]
  @arch_releases << ArchRelease.new(arch: 'i386',remote_store: @opts[:remote_store]) \
    if @opts[:arch] == 'amd64'

  @release_file = release_file
  @in_release_file = gpg_clearsign(release_file)
  @release_gpg_file = gpg_detached(release_file)

  @release_file_path = "dists/#{@opts[:release]}/Release"
  @in_release_file_path = "dists/#{@opts[:release]}/InRelease"
  @release_gpg_file_path = "dists/#{@opts[:release]}/Release.gpg"

end

Instance Method Details

#mergeObject



62
63
# File 'lib/frm.rb', line 62

def merge
end

#pushObject



52
53
54
55
56
57
58
59
60
# File 'lib/frm.rb', line 52

def push
  @arch_releases.each {|arch_release| arch_release.push}
  @opts[:remote_store].put(@release_file_path,@release_file)
  @opts[:remote_store].put(@in_release_file_path,@in_release_file)
  @opts[:remote_store].put(@release_gpg_file_path,@release_gpg_file)
  
  # push public key
  @opts[:remote_store].put('public.key',gpg_export_pubkey)
end