repoquery –repofrompath added

September 6, 2007

I was talking to luke today and he said he needed an easy way of querying data out of a repository that he just had on disk or available at a url but didn’t actually have set up in his yum configuration. So I took a little time and sifted through repoquery in yum-utils to add support for arbitrary repository paths.

So if you take this version of repoquery and you run it like this:

repoquery –repofrompath=/url/or/path/to/myrepo  \ –repoid=myrepo -q -a

then you’ll get a list of all the pkgs in that repository.

It was very simple to implement but it should expedite a lot of random lookups that people may want to do against arbitrary repositories – especially often-remade koji repos.

Here’s the full excerpt from the man page:

Specify  a  path  or  url  to  a  repository  (same path as in a
baseurl) to add to the repositories for this query. This  option
can  be  used  multiple times. If you want to view only the pkgs
from this repository combine this with –repoid. The  repoid  of
the  paths  specified are the last directory path segment. So if
the path you specified  was:  ’/some/place/named/my_repo/’  then
the    repoid   would   be   ’my_repo’.   If   the   path   was:
’http://server/path/my_repo’  then  the  repoid  would  also  be           ‘my_repo’.

4 Responses to “repoquery –repofrompath added”

  1. Nice feature, could be useful in other utils too.
    ( maybe even in core – tim is running away🙂 )

    What about changes it to


    using the the last dir in the path might end up in a repoid
    like ‘i386’ or ‘RPMS’, and if you add more ‘–repofrompath=’ line you might end up with an error is both urls/paths ends with the same dir.

  2. Cialis Says:

    E0WhDM Excellent article, I will take note. Many thanks for the story!

  3. sergio Says:

    why yum don’t have –repofrompath ?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: