summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelliott_c <ocielliottc@users.noreply.github.com>2003-08-07 12:36:33 +0000
committerelliott_c <ocielliottc@users.noreply.github.com>2003-08-07 12:36:33 +0000
commitb1dd7ba04d44475ef0bd16b127443ef9291a3dba (patch)
tree0a111711dcdb4e6fb6441ea632702b8ea93a46e2
parent4a235afee40ff8154a8c739fe6e196c8b2ebd200 (diff)
downloadMPC-b1dd7ba04d44475ef0bd16b127443ef9291a3dba.tar.gz
ChangeLogTag: Thu Aug 7 07:35:56 2003 Chad Elliott <elliott_c@ociweb.com>
-rw-r--r--modules/WorkspaceCreator.pm12
1 files changed, 9 insertions, 3 deletions
diff --git a/modules/WorkspaceCreator.pm b/modules/WorkspaceCreator.pm
index b2f7cf1f..93228a55 100644
--- a/modules/WorkspaceCreator.pm
+++ b/modules/WorkspaceCreator.pm
@@ -763,9 +763,15 @@ sub sort_dependencies {
## See if the dependency is listed after this project
for(my $j = $i; $j <= $#list; $j++) {
if ($list[$j] eq $full && $i != $j) {
- ## If so, move it in front of the current project
- splice(@list, $i, 0, $full);
- splice(@list, $j + 1, 1);
+ ## If so, move it in front of the current project.
+ ## The original code, which had splices, didn't always
+ ## work correctly (especially on AIX for some reason).
+ for(my $k = $j; $k > $i; --$k) {
+ $list[$k] = $list[$k - 1];
+ }
+ $list[$i] = $full;
+
+ ## Mark that an entry has been moved
$moved = 1;
$j--;
}