Class: MPRM::Repo

Inherits:
Object
  • Object
show all
Includes:
Debian, Redhat
Defined in:
lib/mprm/repo.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Redhat

#build_rpm_repo, #create_filelists_xml, #create_other_xml, #create_primary_xml, #create_repomd_xml, #move_rpm_packages

Methods included from Debian

#build_apt_repo, #generate_packages_gz, #generate_release, #generate_release_gpg, #move_apt_packages, #s3_compatible_encode

Instance Attribute Details

#archObject

Returns the value of attribute arch.



12
13
14
# File 'lib/mprm/repo.rb', line 12

def arch
  @arch
end

#componentObject

Returns the value of attribute component.



11
12
13
# File 'lib/mprm/repo.rb', line 11

def component
  @component
end

#directoryObject

Returns the value of attribute directory.



19
20
21
# File 'lib/mprm/repo.rb', line 19

def directory
  @directory
end

#gpgObject

Returns the value of attribute gpg.



16
17
18
# File 'lib/mprm/repo.rb', line 16

def gpg
  @gpg
end

#gpg_passphraseObject

Returns the value of attribute gpg_passphrase.



17
18
19
# File 'lib/mprm/repo.rb', line 17

def gpg_passphrase
  @gpg_passphrase
end

#gpg_sign_algorithmObject

Returns the value of attribute gpg_sign_algorithm.



18
19
20
# File 'lib/mprm/repo.rb', line 18

def gpg_sign_algorithm
  @gpg_sign_algorithm
end

#labelObject

Returns the value of attribute label.



14
15
16
# File 'lib/mprm/repo.rb', line 14

def label
  @label
end

#nocacheObject

Returns the value of attribute nocache.



20
21
22
# File 'lib/mprm/repo.rb', line 20

def nocache
  @nocache
end

#originObject

Returns the value of attribute origin.



15
16
17
# File 'lib/mprm/repo.rb', line 15

def origin
  @origin
end

#pathObject

Returns the value of attribute path.



9
10
11
# File 'lib/mprm/repo.rb', line 9

def path
  @path
end

#releaseObject

Returns the value of attribute release.



13
14
15
# File 'lib/mprm/repo.rb', line 13

def release
  @release
end

#typeObject

Returns the value of attribute type.



10
11
12
# File 'lib/mprm/repo.rb', line 10

def type
  @type
end

Instance Method Details

#_parse_vars(arch_ar, component_ar, release_ar) ⇒ Object



45
46
47
48
49
50
51
52
# File 'lib/mprm/repo.rb', line 45

def _parse_vars(arch_ar,component_ar,release_ar)
  arch_ar = arch.split(",")
  if !component.nil?
    component_ar = component.split(",")
  end
  release_ar = release.split(",")
  [arch_ar,component_ar,release_ar]
end

#createObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/mprm/repo.rb', line 22

def create
  if "#{@type}" == "deb"
    parch,pcomponent,prelease = _parse_vars(arch,component,release)
    if directory
      build_apt_repo(path,pcomponent,parch,prelease,label,origin,gpg,nocache)
      if move_apt_packages(path,pcomponent,parch,prelease,directory) == false
        return
      end
    end
    build_apt_repo(path,pcomponent,parch,prelease,label,origin,gpg,nocache)
  elsif "#{@type}" == "rpm"
    component = nil
    parch,pcomponent,prelease = _parse_vars(arch,component,release)
    if directory
      build_rpm_repo(path,parch,prelease,gpg)
      if move_rpm_packages(path,parch,prelease,directory) == false
        return
      end
    end
    build_rpm_repo(path,parch,prelease,gpg)
  end
end