Note that there are some explanatory texts on larger screens.

plurals
  1. POTest rpm installation script
    primarykey
    data
    text
    <p>I'm working on a script that install Apache automatically.<br/> Part of my pre-test is to check that the rpm are installed.<br/> For example to install apache you need zlib and zlib-devel<br/><br/> So basically, I do an <code>rpm -qa zlib</code> and then store the output on a variable. Then I repeat the <code>rpm -qa</code> but with zlib-devel.<br/> After that I check the versions of the stored variables.<br/> For example: <strong>zlib-1.2.8-3.fc20.x86_64</strong> and <strong>zlib-devel-1.2.8-3.fc20.x86_64</strong><br/> I break the variable to end with 1.2.8-3.fc20.x86_64, I compare the 2 variables and if its correct the script continues.<br/><br/> The problem is that if there is more that one rpm installed it continues by default. It only checks the first installation.<br/><br/> Is there any simpler way to check the rpm installations?<br/></p> <hr> <p>This is the idea of the code: <br/><br/></p> <pre><code>zlib_rpm=`rpm -qa zlib` if [ -n "$zlib_rpm" ] then zlib_devel_rpm=`rpm -qa zlib-devel*` if [ -n "$zlib_devel_rpm" ] then version_zlib_rpm=`rpm -qa zlib | cut -c 6-` version_zlib_devel_rpm=`rpm -qa zlib-devel* | cut -c 12-` if [ "$version_zlib_rpm" = "$version_zlib_devel_rpm" ] then echo "zlib rpm --&gt; PASSED" echo "zlib-devel rpm --&gt; PASSED" fi else echo "zlib-devel rpm --&gt; FAILED" echo "You can find instructions on how to install rpms on /mw_share/script/instructions/rpm_install" exit fi else echo "zlib rpm --&gt; FAILED" echo "You can find instructions on how to install rpms on /mw_share/script/instructions/rpm_install" exit fi </code></pre> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload