Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mkexp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package registry
Operate
Terraform modules
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
esmenv
mkexp
Commits
8798fb06
Commit
8798fb06
authored
1 year ago
by
Karl-Hermann Wieners
Browse files
Options
Downloads
Patches
Plain Diff
Import: model/build dirs for external scripts
parent
8cb43763
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
importexp
+6
-3
6 additions, 3 deletions
importexp
with
6 additions
and
3 deletions
importexp
+
6
−
3
View file @
8798fb06
...
...
@@ -78,7 +78,7 @@ do
echo
"Analyzing '
$RUN_SCRIPT
'"
>
&2
# Get current directory settings
eval
$(
perl
-lne
'if(/^\s*((?:BUILD|MODEL)_DIR
)=(.*?)
\s*$/) {print "OLD_$1='
\'
'$2'
\'
'"}'
$RUN_SCRIPT
)
eval
$(
perl
-lne
'if(/^\s*((?:BUILD|MODEL)_DIR
|basedir)=["'
\'
']?(.*?)["'
\'
']?
\s*$/) {print "OLD_$1='
\'
'$2'
\'
'"}'
$RUN_SCRIPT
)
# New style scripts will make sure that helper scripts are found.
# So no need to hack the . ./* calls (see 4. below)
...
...
@@ -93,7 +93,8 @@ do
# 3. to handle external scripts, replace script dir with tmp dir
# 4. to handle external scripts, replace working dir with tmp dir
# 5. to handle external scripts, replace ./ calls appropriately
# 6. use original model base for executable
# 6. to handle external scripts, replace build and model dirs appropriately
# 7. use original model base for executable
if
$IGNORE_ERRORS
then
...
...
@@ -107,6 +108,7 @@ s:^(\s*)\$\{START\}:\1exit # ${START}:
[
"
$OLD_BUILD_DIR
"
]
&&
SUBST_BUILD_DIR
=
"s:
$OLD_BUILD_DIR
:
$BUILD_DIR
:"
[
"
$OLD_MODEL_DIR
"
]
&&
SUBST_MODEL_DIR
=
"s:
$OLD_MODEL_DIR
:
$MODEL_BASE_DIR
:"
[
"
$OLD_basedir
"
]
&&
SUBST_basedir
=
"s:
$OLD_basedir
:
$MODEL_BASE_DIR
:"
EXEC_SHELL
=
$(
perl
-ne
'/^\#!\s*(\/\S+)/x and print($1); exit'
$RUN_SCRIPT
)
case
$EXEC_SHELL
in
...
...
@@ -133,9 +135,10 @@ cd '$WORK_DIR'
s:^(\s*)BUILD_DIR=.*$:\1BUILD_DIR='
$BUILD_DIR
':
s:^(\s*)EXPDIR=.*$:\1EXPDIR='
$WORK_DIR
':
s:^(\s*\.\s+)\./:\1'
$RUN_BASE_DIR
'/:
s:^(\s*(export\s+)?basedir=).*$:\1'
$
BUILD
_DIR
':
s:^(\s*(export\s+)?basedir=).*$:\1'
$
MODEL_BASE
_DIR
':
'
${
SUBST_BUILD_DIR
-
}
'
'
${
SUBST_MODEL_DIR
-
}
'
'
${
SUBST_basedir
-
}
'
'
"
$RUN_SCRIPT
"
>
$RUN_FILE
# Get script shell without possible +x/-e settings
...
...
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