]> git.openfabrics.org - ~tnikolova/ofed_scripts/.git/commitdiff
install.pl: Check the installation prefix of existing RPMs, if
authorVladimir Sokolovsky <vlad@mellanox.co.il>
Mon, 29 Oct 2007 17:41:56 +0000 (19:41 +0200)
committerVladimir Sokolovsky <vlad@mellanox.co.il>
Mon, 29 Oct 2007 17:41:56 +0000 (19:41 +0200)
does not match to the required prefix, rebuild all the RPMs.

Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.co.il>
install.pl

index efdedcaf97e1efec749ebda298d66bbbc4c3e25d..73b34fc3f95145cf1680e5512d355b562a52f884 100755 (executable)
@@ -1539,6 +1539,19 @@ sub set_availability
 # Set rpm_exist parameter for existing RPMs
 sub set_existing_rpms
 {
+    # Check if the ofed-scripts RPM exist and its prefix is the same as required one
+    my $scr_rpm = <$RPMS/ofed-scripts-*.$target_cpu.rpm>;
+    if ( -f $scr_rpm ) {
+        my $current_prefix = `rpm -qlp $scr_rpm | grep ofed_info | sed -e "s@/bin/ofed_info@@"`;
+        chomp $current_prefix;
+        print "Found $scr_rpm. Its installation prefix: $current_prefix\n" if ($verbose2);
+        if (not $current_prefix eq $prefix) {
+            print "Required prefix is: $prefix\n" if ($verbose2);
+            print "Going to rebuils RPMs from scratch\n" if ($verbose2);
+            return;
+        }
+    }
+
     for my $binrpm ( <$RPMS/*.rpm> ) {
         my ($rpm_name, $rpm_arch) = (split ' ', get_rpm_name_arch($binrpm));
         if ($rpm_name =~ /kernel-ib|ib-bonding/) {