prepend to PYTHONPATH instead of replacing
authorTom Clegg <tom@clinicalfuture.com>
Wed, 17 Jul 2013 01:50:36 +0000 (21:50 -0400)
committerTom Clegg <tom@clinicalfuture.com>
Wed, 17 Jul 2013 01:50:36 +0000 (21:50 -0400)
services/crunch/crunch-job

index 6c0031c6171bb8135bd06a3c110af3c1ae5667ad..4601c5a477b00a544af3f0ef604b964b3bddc9f1 100755 (executable)
@@ -572,7 +572,8 @@ for (my $todo_ptr = 0; $todo_ptr <= $#jobstep_todo; $todo_ptr ++)
       $command .=
          "&& perl -";
     }
-    $ENV{"PYTHONPATH"} = "$ENV{CRUNCH_SRC}/sdk/python"; # xxx hack
+    $ENV{"PYTHONPATH"} =~ s{^}{:} if $ENV{"PYTHONPATH"};
+    $ENV{"PYTHONPATH"} =~ s{^}{$ENV{CRUNCH_SRC}/sdk/python}; # xxx hack
     $command .=
         "&& exec $ENV{CRUNCH_SRC}/crunch_scripts/" . $Job->{"script"};
     my @execargs = ('bash', '-c', $command);