Update status script

This commit is contained in:
Jeremy Soller 2017-10-11 20:19:43 -06:00
parent 1f7128c43f
commit 348dd4a8fe
2 changed files with 19 additions and 9 deletions

12
cook.sh
View File

@ -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

View File

@ -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