diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2016-12-28 15:09:30 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2016-12-28 15:09:30 -0200 |
commit | e778fcaba5e88605f4e3adde4418fcac9abfd4c6 (patch) | |
tree | c163a40cd68a3c00524c6033b140ea7464c59eb6 | |
parent | 2fcbad9e3cde7537a9b7c400163bc64368b49fd4 (diff) | |
download | metadot-e778fcaba5e88605f4e3adde4418fcac9abfd4c6.tar.gz metadot-e778fcaba5e88605f4e3adde4418fcac9abfd4c6.tar.bz2 |
Dependency handling support
-rw-r--r-- | README.mdwn | 2 | ||||
-rwxr-xr-x | metadot | 28 |
2 files changed, 26 insertions, 4 deletions
diff --git a/README.mdwn b/README.mdwn index d72d57c..80c4f21 100644 --- a/README.mdwn +++ b/README.mdwn @@ -17,7 +17,7 @@ Instalation Get the code: - git clone git://git.fluxo.info/metadot.git && cd metadot + git clone https://git.fluxo.info/metadot && cd metadot Then check the source integrity of the latest release: @@ -98,6 +98,25 @@ function metadot_load { fi } +# Load a module +function metadot_deps { + local module="$1" + local destname + local dirname + + if [ -d "$MODULES/$module" ]; then + echo "Resolving dependencies for $module.." + + if [ -e "/etc/debian_version" ] && [ -e "$MODULES/$module/dependencies/debian" ]; then + deps="`grep -v '^#' $MODULES/$module/dependencies/debian | xargs`" + sudo apt install $deps + fi + + else + echo "No such module $module" + fi +} + # Parsing. if [ -z "$OPT" ]; then echo "usage: $BASENAME <option> [arguments]" @@ -157,7 +176,7 @@ elif [ "$OPT" == "create" ]; then git add . ) echo "Metadot skeleton module $1 created at $MODULES/$1" -elif [ "$OPT" == "load" ]; then +elif [ "$OPT" == "load" ] || [ "$OPT" == "deps" ]; then shift if [ -z "$1" ]; then @@ -171,9 +190,12 @@ elif [ "$OPT" == "load" ]; then fi for module in $modules; do - metadot_load $module + metadot_$OPT $module done - echo "Backups saved at $BACKUPS." + + if [ "$OPT" == "load" ]; then + echo "Backups saved at $BACKUPS." + fi elif [ "$OPT" == "list" ]; then # Complete, slow version #find $HOME -lname '*.dotfiles*' -exec ls -la {} | \ |