Class: DebDeploy::AptFtpArchive

Inherits:
Object
  • Object
show all
Defined in:
lib/deb_deploy/apt_ftp_archive.rb

Class Method Summary collapse

Class Method Details

.command(arguments, options = {}) ⇒ Object



4
5
6
# File 'lib/deb_deploy/apt_ftp_archive.rb', line 4

def command(arguments, options={})
  "apt-ftparchive " << options.map{|k,v| "-o #{k}='#{v}'"}.join(' ') << " #{arguments}"
end

.create_packages_file(from, options = {}) ⇒ Object



8
9
10
# File 'lib/deb_deploy/apt_ftp_archive.rb', line 8

def create_packages_file(from, options={})
  command("packages #{from} | gzip -9c > Packages.gz", options)
end

.create_release_file(from, options = {}) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/deb_deploy/apt_ftp_archive.rb', line 12

def create_release_file(from, options={})
  release_file_options = {
        "Codename" => "deb_deploy", 
        "Components" => "deb_deploy", 
        "Origin" => "deb_deploy", 
        "Label" => "Deployed with deb_deploy", 
        "Architectures" => "all", 
        "Suite" => "stable"
      }
  command("release #{from} > Release", options.merge(Hash[release_file_options.map {|k,v| ["APT::FTPArchive::Release::#{k}",v]}]))
end