From 569bc08564824af906cf20b7311c3ff8dc6c6903 Mon Sep 17 00:00:00 2001 From: Jeremy Soller <jackpot51@gmail.com> Date: Wed, 11 Oct 2017 20:24:40 -0600 Subject: [PATCH] Add upstream status script --- cook.sh | 12 ++++++++++++ status_upstream.sh | 24 ++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100755 status_upstream.sh diff --git a/cook.sh b/cook.sh index f7c044bd1..41d3b76c1 100755 --- a/cook.sh +++ b/cook.sh @@ -31,6 +31,7 @@ function usage { echo " stage" >&2 echo " unstage" >&2 echo " status" >&2 + echo " status_upstream" >&2 echo " tar" >&2 echo " untar" >&2 echo " update" >&2 @@ -121,6 +122,17 @@ function op { git -C source diff --name-status fi ;; + status_upstream) + if [ -n "$GIT_UPSTREAM" ] + then + if [ -n "$BRANCH" ] + then + git -C source diff --name-status "upstream/$BRANCH" + else + git -C source diff --name-status "upstream/master" + fi + fi + ;; update) pushd source > /dev/null skip=0 diff --git a/status_upstream.sh b/status_upstream.sh new file mode 100755 index 000000000..defd1c539 --- /dev/null +++ b/status_upstream.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +set -e + +source config.sh + +if [ $# = 0 ] +then + recipes="$(ls -1 recipes)" +else + recipes="$@" +fi + +for recipe in $recipes +do + if [ -d "recipes/$recipe/source" ] + then + status="$(COOK_QUIET=1 ./cook.sh "$recipe" status_upstream)" + + if [ -n "$status" ] + then + echo -e "\e[1m$recipe\e[0m\n$status" + fi + fi +done -- GitLab