Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
0178d726
Commit
0178d726
authored
17 years ago
by
Mattijs Janssens
Browse files
Options
Downloads
Patches
Plain Diff
simplification of colouring
parent
e684296b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wmake/wmakeScheduler
+15
-23
15 additions, 23 deletions
wmake/wmakeScheduler
with
15 additions
and
23 deletions
wmake/wmakeScheduler
+
15
−
23
View file @
0178d726
...
@@ -137,16 +137,6 @@ done
...
@@ -137,16 +137,6 @@ done
# is returned and not of colouring pipe.
# is returned and not of colouring pipe.
set
-o
pipefail
set
-o
pipefail
# Define function to colour output by argument 1
colourPipe
(){
if
[
"
$1
"
]
;
then
(
while
read
line
;
do
setterm
-foreground
$1
;
echo
"
$line
"
;
done
;
setterm
-foreground
default
)
else
cat
fi
}
colourIndex
=
0
colourIndex
=
0
while
:
while
:
...
@@ -164,26 +154,28 @@ do
...
@@ -164,26 +154,28 @@ do
do
do
lockFile
=
"
$lockDir
/
$host
:
$i
"
lockFile
=
"
$lockDir
/
$host
:
$i
"
if
lockfile
-r0
"
$lockFile
"
2>/dev/null
;
then
if
lockfile
-r0
"
$lockFile
"
2>/dev/null
;
then
# Set colour
if
[
"
$WM_COLOURS
"
]
;
then
colour
=
${
colours
[
$colourIndex
]
}
# Set colour
## echo "** host=$host colourIndex=$colourIndex colour=$colour"
colourString
=
`
setterm
-foreground
${
colours
[
$colourIndex
]
}
`
if
[
"
$host
"
=
"
$HOST
"
]
;
then
if
[
"
$host
"
=
"
$HOST
"
]
;
then
if
[
"
$colour
"
]
;
then
eval
$*
2>&1 |
sed
-e
"s/^/
$colourString
/"
eval
$*
2>&1 | colourPipe
$colour
elif
[
-n
"
$JOB_ID
"
]
;
then
qrsh
-inherit
-v
PWD
$host
"
$rcmd
"
else
else
eval
$*
ssh
$host
"
$sourceFoam
2>/dev/null; cd
$PWD
&&
$rcmd
"
2>&1 |
sed
-e
"s/^/
$colourString
/"
fi
fi
elif
[
-n
"
$JOB_ID
"
]
;
then
retval
=
$?
qrsh
-inherit
-v
PWD
$host
"
$rcmd
"
else
else
if
[
"
$colour
"
]
;
then
if
[
"
$host
"
=
"
$HOST
"
]
;
then
ssh
$host
"
$sourceFoam
2>/dev/null; cd
$PWD
&&
$rcmd
"
2>&1 | colourPipe
$colour
eval
$*
elif
[
-n
"
$JOB_ID
"
]
;
then
qrsh
-inherit
-v
PWD
$host
"
$rcmd
"
else
else
ssh
$host
"
$sourceFoam
2>/dev/null; cd
$PWD
&&
$rcmd
"
ssh
$host
"
$sourceFoam
2>/dev/null; cd
$PWD
&&
$rcmd
"
fi
fi
retval
=
$?
fi
fi
retval
=
$?
# Release lock
# Release lock
rm
-f
"
$lockFile
"
2>/dev/null
rm
-f
"
$lockFile
"
2>/dev/null
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment