Add update-all.sh script to rebuild only out of date packages

This commit is contained in:
Ian Douglas Scott 2017-04-08 11:13:24 -07:00
parent 7baa834c40
commit 3bd2f7cfd6
No known key found for this signature in database
GPG Key ID: 4924E10E199B5959
2 changed files with 31 additions and 0 deletions

View File

@ -101,6 +101,14 @@ function op {
fi
popd > /dev/null
;;
gitversion)
if [ -d build/.git ]
then
echo "$(op $1 version)-$(git -C build rev-parse --short HEAD)"
else
op $1 version
fi
;;
update)
pushd build > /dev/null
skip="0"

23
update-all.sh Executable file
View File

@ -0,0 +1,23 @@
#!/bin/bash
set -e
for recipe in `ls -1 recipes`
do
if [ ! -f "recipes/$recipe/stage.tar" ]
then
echo "$recipe: building..."
./cook.sh $recipe dist
else
oldver=$(./cook.sh $recipe gitversion)
./cook.sh $recipe update
newver=$(./cook.sh $recipe gitversion)
if [ "$oldver" = "$newver" ]
then
echo "$recipe: up to date (version $newver)."
else
echo "$recipe: updating $oldver -> $newver..."
./cook.sh $recipe dist
fi
fi
done