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, #create_filelists_xml, #create_other_xml, #create_primary_xml, #create_repomd_xml

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.



330
331
332
# File 'lib/prm/repo.rb', line 330

def accesskey
  @accesskey
end

#archObject

Returns the value of attribute arch.



326
327
328
# File 'lib/prm/repo.rb', line 326

def arch
  @arch
end

#componentObject

Returns the value of attribute component.



325
326
327
# File 'lib/prm/repo.rb', line 325

def component
  @component
end

#directoryObject

Returns the value of attribute directory.



332
333
334
# File 'lib/prm/repo.rb', line 332

def directory
  @directory
end

#gpgObject

Returns the value of attribute gpg.



328
329
330
# File 'lib/prm/repo.rb', line 328

def gpg
  @gpg
end

#pathObject

Returns the value of attribute path.



323
324
325
# File 'lib/prm/repo.rb', line 323

def path
  @path
end

#recentObject

Returns the value of attribute recent.



333
334
335
# File 'lib/prm/repo.rb', line 333

def recent
  @recent
end

#releaseObject

Returns the value of attribute release.



327
328
329
# File 'lib/prm/repo.rb', line 327

def release
  @release
end

#secretkeyObject

Returns the value of attribute secretkey.



329
330
331
# File 'lib/prm/repo.rb', line 329

def secretkey
  @secretkey
end

#snapshotObject

Returns the value of attribute snapshot.



331
332
333
# File 'lib/prm/repo.rb', line 331

def snapshot
  @snapshot
end

#typeObject

Returns the value of attribute type.



324
325
326
# File 'lib/prm/repo.rb', line 324

def type
  @type
end

Instance Method Details

#_parse_vars(arch_ar, component_ar, release_ar) ⇒ Object



361
362
363
364
365
366
367
368
# File 'lib/prm/repo.rb', line 361

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(",")
    return [arch_ar,component_ar,release_ar]
end

#createObject



335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
# File 'lib/prm/repo.rb', line 335

def create
    if "#{@type}" == "deb"
        parch,pcomponent,prelease = _parse_vars(arch,component,release)
        if snapshot
            snapshot_to(path,pcomponent,prelease,snapshot,type,recent)
            pcomponent = snapshot
        end
        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)
    elsif "#{@type}" == "sync"
        sync_to_dho(path, accesskey, secretkey,pcomponent,prelease)
    elsif "#{@type}" == "rpm"
        component = nil
        parch,pcomponent,prelease = _parse_vars(arch,component,release)
        silent = false
        build_rpm_repo(path,parch,prelease,gpg,silent)
    end
end