Jag <agrajag@dragaera.net> wrote:
Probably a simple for loop would sort them out for you. Then you
could remove those that are dubs (or find other problems, but still
get installable ones installed)
I haven't done this but I think the rpm --test command may be your
friend here. I only tried agains a very small sample.
Probably work without the --test too, but testing would be a little safer.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#!/bin/bash
RPM_DIR=/some/rpm_dir
## cd to the scene of the crime
cd $RPM_DIR
for ii in `ls *rpm` ## get a working list of all the rpms in there
do
## test and record (including stderr) each file
rpm -Uvh --test $ii > test_results 2>&1
## if test shows exit status of 0 then run the install command.
if [ "$? = 0 ]; then
## record installationn
rpm -Uvh $ii 2>&1|tee -a installed_results
fi
done
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
That should leave you with the installable ones installed,
uninstallable ones will be recorded in test_results
In case there were other reasons besides being installed already.
Install output will be recorded in installed_results but also piped
to screen so you see what is happening.