]> gitweb.fluxo.info Git - metadot.git/commitdiff
Dependency handling support
authorSilvio Rhatto <rhatto@riseup.net>
Wed, 28 Dec 2016 17:09:30 +0000 (15:09 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Wed, 28 Dec 2016 17:09:30 +0000 (15:09 -0200)
README.mdwn
metadot

index d72d57c8368a2bf0614b763f12a2da9c0e2946bf..80c4f21a264b5ac76d73c44bf45bd7bd08d1cb97 100644 (file)
@@ -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:
 
diff --git a/metadot b/metadot
index 86a95048f753aa8201d5be72d28bffea5f4b386d..db6551da6ce976c418506ea3bb706cdfd63a8fca 100755 (executable)
--- a/metadot
+++ b/metadot
@@ -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 {} | \