I'm working on zypp supprt for supermin, a helper for libguestfs which
creates an appliance based on a list of package names. My current
approach is to download all packages from the repo and pass the filename
of downloaded rpm packages to the tool for further processing.

It does something like this, which downloads over 100 packages in my
local 11.4 installation:

  zypper --verbose --verbose --verbose \
        --root $PWD/tmp/root \
        --reposd-dir $PWD/zypp/repos.d \
        --cache-dir tmp//cache-dir \
        --pkg-cache-dir tmp/pkg_cache_dir \
        --gpg-auto-import-keys \
        --non-interactive \
        install \
        --auto-agree-with-licenses \
        --download-only \
        \
        bash kernel-default mkinitrd


The next step would be to make use of already installed packages. What I
would like to have is something like this:

  $new_tool --names bash kernel-default mkinitrd

And the output would the name of rpm packages required for the named
packages, like the following would produce:

  find tmp/pkg_cache_dir -name "*.rpm" | xargs rpm -qp --qf '%{NAME}\n'

If $new_tool would be able to just download missing dependencies of
uninstalled packages and list all the remaining installaed packages,
that would be even better.

How can I achieve this?
Is there already example code which can be reused?

Olaf
-- 
To unsubscribe, e-mail: zypp-devel+unsubscr...@opensuse.org
To contact the owner, e-mail: zypp-devel+ow...@opensuse.org

Reply via email to