On Mar 4, 2011, at 4:41 PM, Arkadiusz Miskiewicz wrote: > > Hi, > > I'm still at rpm 4.5 and I'm looking for a way to replace all i686 packages > with x86_64 ones on a existing system. My rpm is already x86_64 one. >
OK, here's the simplest way to achieve a mass replacement of i[3456]86 by their x86_64 equivalents that I can think of. Its not really what RPM was ever designed to do. RPM has had support for manifests for a long time. And rpm-4.5 uses rpmgi which is perfectly happy using manifests, enven manifests of manifests, and gathering packages into argv lists. What isn't in rpm-4.5 (but is simple to add) is support for installs and erases from the same command line. E.g. rpm-5.0 is (or at least was, I haven't checked) prepared for this sort of syntax: rpm -ivh -- +/path/to/foo-1.2-3.x86_64.rpm -foo.i686 Using manifests and rpm -qa its pretty simple to generalize the "+" and "-" prefix into something that achieves what you want to do. The '+' prefixed packages need to be fed to rpmAddInstallElement(). The '-' prefixed packages need to go to rpmAddEraseElement(). The code that needs changing to handle '+' and '-' prefixing to permit installs and erases to be handles as above is in lib/rpminstall.c. The invocation should be "-ivh" rather than the more typical "-Uvh" to disable "newer" upgrading as well as Obsoletes: handling. You will need to generate 2 manifests using rpm --query against whatever happens to be installed. Presumably your need applies to client machines with different install sets. On the down side: 1) You will have to backport (and test) the '+' and '-' prefix code from rpm-5.0. If you can't change existing rpm-4.5 code, well none of what I'm saying is going to work and you're in for some struggles with arch scoring and fiddling with rpmrc files to "prefer" x86_64 over "i686". 2) I'm assuming sufficient regularity between the package name spaces on i686 and x86_64 that you can easily script the two needed manifests knowing only, say, this input rpm -qa | grep '\.i[3456]86' If you have issues with package renaming, or the package name spaces on i686 <-> x86_64 are too dissimilar, you're in for some tedious scripting while also adjusting the package name space differences. Does the above make sense? If not I'll try a more verbose description, and/or generate the patch needed on rpm-4.5. hth 73 de Jeff ______________________________________________________________________ RPM Package Manager http://rpm5.org Developer Communication List rpm-devel@rpm5.org