John Oliver wrote:
> On Thu, Mar 22, 2007 at 12:28:59PM -0700, Gregory K. Ruiz-Ade wrote:
>> As to the error you're having:
>>
>>> That resulted in:
>>>
>>> Checking pre-requisite packages ...
>>>
>>> Red Hat Enterprise Linux version is: 4
>>>
>>> error: Failed dependencies:
>>> libgcc >= 3.4.6-3.1 is needed by (installed)
>>> gcc-3.4.6-3.1.i386
>>> libgcc_s.so.1(GCC_4.2.0) is needed by (installed)
>>> libstdc++-3.4.6-3.1.i386
>> Well, yes, of course it would error out. You're installing an older
>> libgcc than what is installed, and RPM is telling you that if you
>> install the older version, you'll replace the newer version, and gcc
>> requires the newer version, so it won't install the older version.
>
> Yes, I know... :-)
>
>> The fact that you're doing:
>>
>> if [ something ]; then
>> rpm -Uh $package1 && rpm -Uh $package2
>> fi
>>
>> is why no additional packages are being installed after the first one
>> fails. The "&&" notation means "if the first one was successful, do
>> the next one". Specifically, if the first command gives a return
>> code of 0 (successfull), keep going. If this is not the behavior you
>> want, then pull the "&&" notation off the end of your RPM lines.
>>
>> Why are you trying to install an older version than what's already
>> installed, though?
>
> The application being installed depends on the existence of libgcc,
> compat-libstdc++, and zlib So, the installer was written to rpm -Uh
> them, with the theory that if they're already there, great, and if
> they're not, then they will be.
>
> The older version is almost certainly what comes with the base RHEL4,
> whichever Update level they had to work with.
>
> Like I said, I considered updating the package with the newer libgcc,
> but then I would also have to include the RPMs for every conceivable
> package which might depend on libgcc, which I do not want to do.
>
> Right now, my problem is that, in my elif case, when the RPM
> installation for libgcc fails, it doesn't just go on to try to install
> compat-libstdc++ and zlib... it appears to dump out of the elif case
> entirely. I'm looking for a way for the script to handle this a little
> more gracefully, hopefully without having to test for the existence and
> version level of each RPM dependancy.
>
It appears that you didn't grasp the significance of what Greg said
about the '&&' separating your commands.
If you want to:
try A, and then if that works try B, and then if that works try C
use
A &&
B &&
C
if you want to:
try A, and then (always) try B, and then (always) try C
use
A
B
C
Regards,
..jim
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list