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, #s3_compatible_encode

Instance Attribute Details

#accesskeyObject

Returns the value of attribute accesskey.



357
358
359
# File 'lib/prm/repo.rb', line 357

def accesskey
  @accesskey
end

#archObject

Returns the value of attribute arch.



351
352
353
# File 'lib/prm/repo.rb', line 351

def arch
  @arch
end

#componentObject

Returns the value of attribute component.



350
351
352
# File 'lib/prm/repo.rb', line 350

def component
  @component
end

#directoryObject

Returns the value of attribute directory.



359
360
361
# File 'lib/prm/repo.rb', line 359

def directory
  @directory
end

#gpgObject

Returns the value of attribute gpg.



355
356
357
# File 'lib/prm/repo.rb', line 355

def gpg
  @gpg
end

#labelObject

Returns the value of attribute label.



353
354
355
# File 'lib/prm/repo.rb', line 353

def label
  @label
end

#nocacheObject

Returns the value of attribute nocache.



361
362
363
# File 'lib/prm/repo.rb', line 361

def nocache
  @nocache
end

#originObject

Returns the value of attribute origin.



354
355
356
# File 'lib/prm/repo.rb', line 354

def origin
  @origin
end

#pathObject

Returns the value of attribute path.



348
349
350
# File 'lib/prm/repo.rb', line 348

def path
  @path
end

#recentObject

Returns the value of attribute recent.



360
361
362
# File 'lib/prm/repo.rb', line 360

def recent
  @recent
end

#releaseObject

Returns the value of attribute release.



352
353
354
# File 'lib/prm/repo.rb', line 352

def release
  @release
end

#secretkeyObject

Returns the value of attribute secretkey.



356
357
358
# File 'lib/prm/repo.rb', line 356

def secretkey
  @secretkey
end

#snapshotObject

Returns the value of attribute snapshot.



358
359
360
# File 'lib/prm/repo.rb', line 358

def snapshot
  @snapshot
end

#typeObject

Returns the value of attribute type.



349
350
351
# File 'lib/prm/repo.rb', line 349

def type
  @type
end

#uploadObject

Returns the value of attribute upload.



362
363
364
# File 'lib/prm/repo.rb', line 362

def upload
  @upload
end

Instance Method Details

#_parse_vars(arch_ar, component_ar, release_ar) ⇒ Object



392
393
394
395
396
397
398
399
# File 'lib/prm/repo.rb', line 392

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



364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
# File 'lib/prm/repo.rb', line 364

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,label,origin,gpg,silent,nocache)
            if move_packages(path,pcomponent,parch,prelease,directory) == false
                return
            end
        end
        silent = false
        build_apt_repo(path,pcomponent,parch,prelease,label,origin,gpg,silent,nocache)
    elsif "#{@type}" == "sync"
        parch,pcomponent,prelease = _parse_vars(arch,component,release)
        object_store = upload
        sync_to_dho(path, accesskey, secretkey,pcomponent,prelease,object_store)
    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