Merge pull request #5 from ids1024/update-all

Add update-all.sh script to rebuild only out of date packages
This commit is contained in:
Jeremy Soller 2017-04-08 16:36:16 -06:00 committed by GitHub
commit 33f662cb58
2 changed files with 39 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"
@ -215,6 +223,7 @@ then
done
else
echo "cook.sh: recipe '$1' not found" >&2
exit 1
fi
else
usage "{package}"

30
update-packages.sh Executable file
View File

@ -0,0 +1,30 @@
#!/bin/bash
set -e
if [ $# = 0 ]
then
recipes=$(ls -1 recipes)
else
recipes=$@
fi
for recipe in $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