Class: PRM::Repo

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Redhat

#build_rpm_repo

Methods included from SNAP

#snapshot_to

Methods included from DHO

#sync_to_dho

Methods included from Debian

#build_apt_repo, #generate_packages_gz, #generate_release, #generate_release_gpg, #move_packages

Instance Attribute Details

#accesskeyObject

Returns the value of attribute accesskey.



476
477
478
# File 'lib/prm/repo.rb', line 476

def accesskey
  @accesskey
end

#archObject

Returns the value of attribute arch.



472
473
474
# File 'lib/prm/repo.rb', line 472

def arch
  @arch
end

#componentObject

Returns the value of attribute component.



471
472
473
# File 'lib/prm/repo.rb', line 471

def component
  @component
end

#directoryObject

Returns the value of attribute directory.



478
479
480
# File 'lib/prm/repo.rb', line 478

def directory
  @directory
end

#gpgObject

Returns the value of attribute gpg.



474
475
476
# File 'lib/prm/repo.rb', line 474

def gpg
  @gpg
end

#pathObject

Returns the value of attribute path.



469
470
471
# File 'lib/prm/repo.rb', line 469

def path
  @path
end

#recentObject

Returns the value of attribute recent.



479
480
481
# File 'lib/prm/repo.rb', line 479

def recent
  @recent
end

#releaseObject

Returns the value of attribute release.



473
474
475
# File 'lib/prm/repo.rb', line 473

def release
  @release
end

#secretkeyObject

Returns the value of attribute secretkey.



475
476
477
# File 'lib/prm/repo.rb', line 475

def secretkey
  @secretkey
end

#snapshotObject

Returns the value of attribute snapshot.



477
478
479
# File 'lib/prm/repo.rb', line 477

def snapshot
  @snapshot
end

#typeObject

Returns the value of attribute type.



470
471
472
# File 'lib/prm/repo.rb', line 470

def type
  @type
end

Instance Method Details

#_parse_vars(arch_ar, component_ar, release_ar) ⇒ Object



507
508
509
510
511
512
# File 'lib/prm/repo.rb', line 507

def _parse_vars(arch_ar,component_ar,release_ar)
  arch_ar = arch.split(",")
  component_ar = component.split(",")
  release_ar = release.split(",")
  return [arch_ar,component_ar,release_ar]
end

#createObject



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
# File 'lib/prm/repo.rb', line 481

def create
  if "#{@type}" == "deb"
    parch,pcomponent,prelease = _parse_vars(arch,component,release)
    if snapshot
      snapshot_to(path,pcomponent,prelease,snapshot,type,recent)
    else
      if directory
        silent = true
        build_apt_repo(path,pcomponent,parch,prelease,gpg,silent)
        if move_packages(path,pcomponent,parch,prelease,directory) == false
          return
        end
      end
      silent = false
      build_apt_repo(path,pcomponent,parch,prelease,gpg,silent)
    end
  elsif "#{@type}" == "sync"
    sync_to_dho(path, accesskey, secretkey,pcomponent,prelease)
  elsif "#{@type}" == "rpm"
    component = "test"
    parch,prelease = _parse_vars(arch,component,release)
    silent = false
    build_rpm_repo(path,parch,prelease,gpg,silent)
  end
end