From c19ba61a876b23ce2bb6b8c10582d6c2cebb6440 Mon Sep 17 00:00:00 2001
From: Ian Douglas Scott <ian@iandouglasscott.com>
Date: Thu, 26 Oct 2017 22:30:50 -0700
Subject: [PATCH] Make repo.sh accept --debug, and pass it to cook.sh

---
 repo.sh | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/repo.sh b/repo.sh
index 68a3167d8..c6c8d8f53 100755
--- a/repo.sh
+++ b/repo.sh
@@ -4,11 +4,20 @@ shopt -s nullglob
 
 source config.sh
 
-if [ $# = 0 ]
+recipes=()
+for arg in "${@:1}"
+do
+    if [ "$arg" == "--debug" ]
+    then
+        DEBUG=--debug
+    else
+        recipes[${#recipes[@]}]="$arg"
+    fi
+done
+
+if [ ${#recipes[@]} = 0 ]
 then
     recipes="$(ls -1 recipes)"
-else
-    recipes="$@"
 fi
 
 for recipe in $recipes
@@ -36,7 +45,7 @@ do
     if [ ! -f "recipes/$recipe/stage.tar.gz" ]
     then
         echo -e "\033[01;38;5;155mrepo - building $recipe\033[0m" >&2
-        ./cook.sh "$recipe" build stage tar
+        ./cook.sh "$recipe" build stage tar $DEBUG
     else
         TIME_BUILD="$($FIND recipes/$recipe/build/ -type f -not -path '*/.git*' -printf "%Ts\n" | sort -nr | head -n 1)"
         TIME_STAGE="$($STAT -c "%Y" recipes/$recipe/stage.tar.gz)"
@@ -44,7 +53,7 @@ do
         if [ "$TIME_BUILD" -gt "$TIME_STAGE" -o "$TIME_RECIPE" -gt "$TIME_STAGE" ]
         then
             echo -e "\033[01;38;5;155mrepo - rebuilding $recipe\033[0m" >&2
-            ./cook.sh "$recipe" untar unstage build stage tar
+            ./cook.sh "$recipe" untar unstage build stage tar $DEBUG
         else
             echo -e "\033[01;38;5;155mrepo - $recipe up to date\033[0m" >&2
         fi
-- 
GitLab