[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Libguestfs] Rethinking appliance building

On Sun, Dec 5, 2010 at 10:56 AM, Richard W.M. Jones <rjones redhat com> wrote:
To make this even more explicit:

> (1) There has to be a way to detect that the package manager should
> be used, eg. by looking for /etc/arch-release

RPM: check for existence of /etc/redhat-release
Debian: check for existence of /etc/debian_version
Arch: check for existence of /etc/arch-release
Arch: Or check the kernel version for "ARCH" with a uname -r
> (2) There must be a way to take a list of package names, and fully
> resolve all dependencies (recursively as necessary) to get a complete
> list of packages that must be installed to bootstrap.

RPM: [lots of Yum API magic]
Debian: apt-cache depends --recurse -i <list of package names>
Arch: pactree -l <list of package names> | sort -u 
pactree is part of the pacman-contrib package

> (3) Must be a way to download a package.

RPM: yumdownloader <name of package>
Debian: aptitude download <name of package>
Arch: pacman -Sw --cachedir=<Where to download> <name of package(s)>
This will download the package to the cachedir: /var/cache/pacman/pkg

> (4) Must be able to list out the files in a downloaded package.

RPM: rpm -qlp foo.rpm
Debian: dpkg-deb -c foo.deb
pacman -Qlp  foo.pkg.tar.xz

> (5) Must be able to extract a single file from a downloaded package.

RPM: rpm2cpio foo.rpm | cpio -id
Debian: dpkg-deb --fsys-tarfile foo.deb | tar xf -
Arch: tar xf foo.pkg.tar.xz
Arch packages are just tarballs with a PKGINFO file in the root directory which has package metadata

So it's almost enough for you to tell me the equivalent of those
commands for pacman, although of course I'd prefer a patch to


Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into Xen guests.

Here are the answers, and all commands work as non-root, before running any commands the package database would need to be updated by running "pacman -Sy"

I will grab a git checkout of febootstrap and start looking into prepping a patch, but if this is enough info for you to whip up support then let me know and I will test it and fix any arch specific things.


-Tom Hatch

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]