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
cf8853d7
Commit
cf8853d7
authored
3 years ago
by
Karl-Hermann Wieners
Browse files
Options
Downloads
Patches
Plain Diff
importexp: support for /bin/bash scripts (no echoing of here docs)
parent
8136e010
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
+17
-1
17 additions, 1 deletion
importexp
with
17 additions
and
1 deletion
importexp
+
17
−
1
View file @
cf8853d7
...
...
@@ -39,19 +39,35 @@ do
echo
"Analyzing '
$RUN_SCRIPT
'"
>
&2
# New style scripts will make sure that helper scripts are found.
# So no need to hack the . ./* calls
# So no need to hack the . ./* calls
(see 4. below)
if
grep
'^ *cd *\$BUILD_DIR/run'
$RUN_SCRIPT
>
/dev/null
then
RUN_BASE_DIR
=
.
fi
# "Normalize" run script
# 1. get rid of possible +x settings
# 2. to handle external scripts, replace script dir with tmp dir
# 3. to handle external scripts, replace working dir with tmp dir
# 4. to handle external scripts, replace ./ calls appropriately
# 5. levante scripts use bash, where -x does not show here-docs
SHOW_HERE_DOCS
=
'\
for x in $master_namelist $atm_namelist $jsbach_namelist $oce_namelist\
do\
echo "cat > $x << EOF"\
cat $x\
echo EOF\
done\
'
sed
-r
'
s:^(\s*)(set\s+\+x\s*$|(set\s+\+\w+)x):\1\3:
s:^(\s*)SCRIPT_DIR=.*$:\1SCRIPT_DIR='
$WORK_DIR
':
s:^(\s*)EXPDIR=.*$:\1EXPDIR='
$WORK_DIR
':
s:^(\s*\.\s+)\./:\1'
$RUN_BASE_DIR
'/:
s:^\s*cat\s+\$thisscript\s*$:'
"
$SHOW_HERE_DOCS
"
':
'
"
$RUN_SCRIPT
"
>
$RUN_FILE
# Get script shell without possible +x settings to handle
COMMAND
=
$(
perl
-ne
'
/^\#!\s*(\/\S+)(
\s+\+x\s*$|
...
...
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