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
8f2e5073
Commit
8f2e5073
authored
5 years ago
by
Karl-Hermann Wieners
Browse files
Options
Downloads
Patches
Plain Diff
mkexp: added common update module for 'getconfig', 'editexp', and 'mkexp.bash'
parent
0346fe4f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGES.txt
+1
-0
1 addition, 0 deletions
CHANGES.txt
mkexp.bash
+5
-2
5 additions, 2 deletions
mkexp.bash
update.py
+3
-0
3 additions, 0 deletions
update.py
with
9 additions
and
2 deletions
CHANGES.txt
+
1
−
0
View file @
8f2e5073
...
...
@@ -14,6 +14,7 @@ Global
* Added 'getconfig' tool to generate clean config files from 'update' scripts
* Added 'editexp' tool to edit the config file for a given 'update' script
* Added common update module for 'getconfig', 'editexp', and 'mkexp.bash'
* Added 'upexp' tool to run the 'update' script for a given config file
Templates
...
...
This diff is collapsed.
Click to expand it.
mkexp.bash
+
5
−
2
View file @
8f2e5073
...
...
@@ -30,12 +30,15 @@ cdexp () {
cfg
=
"
$1
"
elif
[[
-f
update
]]
then
eval
$(
awk
'/^cd / {dir=$2; print "dir=" dir ";"}; /^exec / {print "cfg=" $3}'
update
)
eval
$(
python
-c
'
import update
u = update.Update("update")
print("dir="+u.get_config_dir()+"\ncfg="+u.get_config_file())
'
)
else
echo
'Oops: invalid number of parameters'
>
&2
return
1
fi
[[
$cfg
!=
/
*
]]
&&
cfg
=
$dir
/
$cfg
var
=
${
var
^^
}
var
=
${
var
%_DIR
}
vardir
=
$(
builtin cd
"
$dir
"
&&
getexp
-k
"
${
var
}
_DIR"
"
$cfg
"
)
&&
...
...
This diff is collapsed.
Click to expand it.
update.py
+
3
−
0
View file @
8f2e5073
...
...
@@ -37,6 +37,9 @@ class Update:
update_file
.
close
()
def
get_config_dir
(
self
):
return
self
.
config_dir
def
get_config_file
(
self
):
config_file
=
self
.
mkexp_args
.
config
if
not
os
.
path
.
isabs
(
config_file
):
...
...
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