Skip to content
This repository has been archived by the owner on Nov 13, 2019. It is now read-only.

Repoclient cookbook

mriehl edited this page Aug 6, 2012 · 3 revisions

Repoclient cookbook

Creating regular repositories

repoclient create <reponame>

Generating repository metadata

repoclient generatemetadata <reponame>

RPM operations

Upload a RPM to a repo

repoclient uploadto <reponame> <rpm1> ... <rpmN>

Delete a RPM

repoclient deleterpm <reponame> <rpm1> ... <rpmN>

Propagate ("move") a RPM

propagate <from_repo> <arch>/<name> <to_repo> (If you do not specify a full RPM name when propagating, the most recent matching RPM will be propagated instead.)

Deleting repositories

Virtual repository deletion

repoclient deletevirtual <virtual_reponame>

Static repository deletion

repoclient deletestatic <reponame>

Virtual repositories

Virtual repositories that redirect to external repositories

repoclient redirectto <virtual_reponame> <redirect_url> After this if a machine queries <virtual_reponame>, it will use the repo at <redirect_url> instead.

Virtual repositories linked to repositories on the yum-repo-server

linktostatic <virtual_reponame> <static_reponame> #Creates or updates a virtual repository that points to a static repository linktovirtual <virtual_reponame> <virtual_reponame> #Creates or updates a virtual repository that points to another virtual repository

Tagging system

You can mark regular (not virtual, that wouldn't make any sense) repositories with so-called 'tags'. The tags are used for queries and can be seen/modified on the repository web page.

Tag a repository

repoclient tag repo1 'hello_world'

repoclient tag repo1 'yum-was-here'

Querying repository tags

repoclient taglist repo1 results in :
hello_world
yum-was-here

Untag a repository

repoclient untag repo1 'hello_world'

Querying repositories

repoclient querystatic [-name <regex>] [-tag <tag1,tagN>] [-notag <tag1,tagN>] [-newer <days>] [-older <days>]

repoclient queryvirtual [-name <regex>] [-newer <days>] [-older <days>] [-showDestination true]

tag combinations are OR : repoclient querystatic -tag 'foo,bar,baz' means
"repositories with (foo OR bar OR baz) as tags"

however, BEWARE:

notag combinations are OR too but that means AND! Consider the following :
repoclient querystatic -notag 'foo,bar,baz'

This means

"repositories with NOT(foo OR bar OR baz) as tags"

which evaluates (De Morgan's laws) to

"repositories with NOT(foo as tag) AND NOT(bar as tag) AND NOT(baz as tag)"

You can leverage the power of bash to do pretty cool things, like piping the output of querystatic into xargs or use a for loop!
Putting it together repoclient querystatic -tag 'this_repo_is_trash,delete_me' -older 7 -name 'myapprepo_*' | xargs repoclient deletestatic
or
for REPO in `repoclient querystatic -tag 'live_deployed'`; do repoclient tag $REPO 'important'; done