]> git.openfabrics.org - ~tnikolova/ofed_scripts/.git/commitdiff
install.pl: Add '--builddir' parameter
authorVladimir Sokolovsky <vlad@mellanox.co.il>
Sun, 7 Mar 2010 11:34:54 +0000 (13:34 +0200)
committerVladimir Sokolovsky <vlad@mellanox.co.il>
Sun, 7 Mar 2010 11:37:42 +0000 (13:37 +0200)
Some users set /var/tmp as read-only.
Adding '--builddir' will help to workaround this issue.

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

index 346db13996aef7c8c5eb300ae7da11a9d621a49d..9f050aad3050260bd0cb8f6d17e020c519204064 100755 (executable)
@@ -187,11 +187,9 @@ my $config = $CWD . '/ofed.conf';
 chomp $config;
 my $config_net;
 
-my $TOPDIR = "/var/tmp/" . $PACKAGE . "_topdir";
-chomp $TOPDIR;
+my $builddir = "/var/tmp/";
+chomp $builddir;
 
-rmtree ("$TOPDIR");
-mkpath([$TOPDIR . '/BUILD' ,$TOPDIR . '/RPMS',$TOPDIR . '/SOURCES',$TOPDIR . '/SPECS',$TOPDIR . '/SRPMS']);
 my $ofedlogs = "/tmp/$PACKAGE.$$.logs";
 mkpath([$ofedlogs]);
 
@@ -265,6 +263,7 @@ sub usage
    print "\n           -v|-vv|-vvv          Set verbosity level";
    print "\n           -q                   Set quiet - no messages will be printed";
    print "\n           --force              Force uninstall RPM coming with Distribution";
+   print "\n           --builddir           Change build directory. Default: $builddir";
    print "\n\n           --all|--hpc|--basic    Install all,hpc or basic packages correspondingly";
    print RESET "\n\n";
 }
@@ -1394,6 +1393,8 @@ while ( $#ARGV >= 0 ) {
         }
     } elsif ( $cmd_flag eq "--without-depcheck" ) {
         $check_linux_deps = 0;
+    } elsif ( $cmd_flag eq "--builddir" ) {
+        $builddir = shift(@ARGV);
     } elsif ( $cmd_flag eq "-q" ) {
         $quiet = 1;
     } elsif ( $cmd_flag eq "-v" ) {
@@ -1411,6 +1412,12 @@ while ( $#ARGV >= 0 ) {
     }
 }
 
+my $TOPDIR = $builddir . '/' . $PACKAGE . "_topdir";
+chomp $TOPDIR;
+
+rmtree ("$TOPDIR");
+mkpath([$TOPDIR . '/BUILD' ,$TOPDIR . '/RPMS',$TOPDIR . '/SOURCES',$TOPDIR . '/SPECS',$TOPDIR . '/SRPMS']);
+
 if ($config_given and $install_option) {
     print RED "\nError: '-c' option can't be used with '--all|--hpc|--basic'", RESET "\n";
     exit 1;