Skip to content
Snippets Groups Projects
Commit 8f2e5073 authored by Karl-Hermann Wieners's avatar Karl-Hermann Wieners
Browse files

mkexp: added common update module for 'getconfig', 'editexp', and 'mkexp.bash'

parent 0346fe4f
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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") &&
......
......@@ -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):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment