API Reference

class packagemanager.PM(config)

Package Manager Class

clean_drpms(id, env=None)

Remove Delta RPM which is no more present in presto metadata

Parameters
  • id – Repository ID

  • env – Environment to process (Default to Latest)

count_drpms(id, env)

Returns Erratas

Parameters
  • id – Repository ID

  • env – Environment (Default to latest)

diff_updates(pkgs, repos, env=None)

Returns a Packages diff from all repos into environment

Parameters
  • pkgs – Packages Dictionnary

  • env – Environment (Default: Latest)

  • repos – Repositories ID (Default: All)

drpms_all()

Create Delta RPM and update Repository Metadata for all Configured Repo

erratas(id, env)

Returns Erratas

Parameters
  • id – Repository ID

  • env – Environment (Default to latest)

get_deps(pkg_name)

Returns Dependencies for pkg_name

Parameters

pkg_name (string) – Package Name

get_local_pkgs(repos, env=None)

Get Local RPM from Repo

Parameters
  • repos – List of Repositories ID

  • env – Environment (Default to Latest)

get_requires(pkgs, id)

Returns requirements for pkg_name

Parameters
  • pkg_name – Package Name

  • id – Repo where to find RPM

make_drpms(id, env=None, sha='sha256')

Create Delta RPM and update Repository Metadata

Parameters
  • id – Repository ID

  • env – Environment to process (Default to Latest)

  • sha – CheckSum (Default to sha256)

pkg_info(id, pkg, env=None)

Returns RPM version and changelog

Parameters
  • id – Repository ID

  • env – Environment

  • pkg – Package instance

push(id, env, to_envs, pkgs)

Push pkgs from env to to_env

Parameters
  • id – Repository ID

  • env – Environment where to pick RPM

  • to_envs – Environment List where to push RPM

  • pkgs – RPM List to push

remove_rpm(id, env, pkgs)

Removes pkgs from repo(s) Cannot remove package from your latest environment if a snapshot exists

Parameters
  • id – Repository ID

  • env – Environment

  • pkgs – RPM List to delete

repo(id, env=None, full=False)

Repository

Parameters
  • id (string) – Repository ID

  • env (string) – Environment

  • full (boolean) – Return pkgs

Returns

repo configuration

Return type

dict

Example

>>> PM().repo(id, full=True)
{
    "status": "0",
    "id": "id",
    "name": "",
    "group": "",
    "excludepkgs": "",
    "includepkgs": "",
    "baseurl": "",
    "mirrorlist": "",
    "path": ""
}

Note

Set full=True to get repository pkgs

repo_diff(from_id, from_env, to_id=None, to_env=None)

Returns a diff from 2 environment

Parameters
  • from_id – Repository ID

  • from_env – Environment

  • to_id – Repository ID

  • to_env – Environment

repos(full=False)

Returns: dict of Repositories by group

Note

Set full=True to get repository pkgs

search(pkg)

Returns RPM version and changelog

Parameters

pkg – Package instance

snapshot(id, env)

Snapshot env

Parameters
  • id – Repository ID

  • env – Environment list where to pick RPM

sync_all()

Sync Upstream Repo for all Configured Repo

sync_latest_repo(id)

Sync Upstream Repo for Repo ID id

Parameters

id – Repository ID

update(id, env=None, sha='sha256')

Update Repository Metadata

Parameters
  • id – Repository ID

  • env – Environment (Default to Latest)

  • sha – CheckSum (Default to sha256)