From 348dd4a8fe8bc92614a60a77d31b416029993d89 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Wed, 11 Oct 2017 20:19:43 -0600 Subject: [PATCH] Update status script --- cook.sh | 12 ++++++++++++ status.sh | 16 +++++++--------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/cook.sh b/cook.sh index daf79c758..f7c044bd1 100755 --- a/cook.sh +++ b/cook.sh @@ -30,6 +30,7 @@ function usage { echo " unpublish" >&2 echo " stage" >&2 echo " unstage" >&2 + echo " status" >&2 echo " tar" >&2 echo " untar" >&2 echo " update" >&2 @@ -109,6 +110,17 @@ function op { rm -f source.tar fi ;; + status) + if [ -n "$TAR" ] + then + tar --compare --file="source.tar" -C "source" --strip-components=1 2>&1 | + grep -v "tar: :" | grep -v '\(Mod time\|Mode\|Gid\|Uid\) differs' || + true + elif [ -n "$GIT" ] + then + git -C source diff --name-status + fi + ;; update) pushd source > /dev/null skip=0 diff --git a/status.sh b/status.sh index 21abe8fa1..fe715ffcf 100755 --- a/status.sh +++ b/status.sh @@ -12,15 +12,13 @@ fi for recipe in $recipes do - echo -e "\e[1m$recipe\e[0m" - if [ -d "recipes/$recipe/source/.git" ] + if [ -d "recipes/$recipe/source" ] then - git -C "recipes/$recipe/source" status - elif [ -e "recipes/$recipe/source.tar" ] - then - echo "Using source tarball" - tar --compare --file="recipes/$recipe/source.tar" -C "recipes/$recipe/source" --strip-components=1 2>&1| grep -v "tar: :" | grep -v '\(Mode\|Gid\|Uid\) differs' || true - else - echo "No original source found" + status="$(COOK_QUIET=1 ./cook.sh "$recipe" status)" + + if [ -n "$status" ] + then + echo -e "\e[1m$recipe\e[0m\n$status" + fi fi done