diff options
-rwxr-xr-x | templates/turris.run | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/templates/turris.run b/templates/turris.run index 58a4714..0e98531 100755 --- a/templates/turris.run +++ b/templates/turris.run @@ -18,7 +18,18 @@ shift # Shift --locked curl "https://repo.turris.cz/$ANIMAL/$BOARD/packages/git-hash" > git-hash cat git-hash -if [ -z "$CLEAN" ] && [ -f "$WORKSPACE/openwrt-git-hash" ] && cmp -s git-hash "$WORKSPACE/openwrt-git-hash"; then +new_upstream="n" +cmp -s git-hash "$WORKSPACE/openwrt-git-hash" || new_upstream="y" + +latest_master="$(echo list \ + | git remote-https https://git.cynerd.cz/openwrt-personal-pkgs \ + | awk '$2 == "refs/heads/master" { print $1 }')" +if [ "$new_upstream" = "n" ] && [ "$latest_master" = "$(cat "$WORKSPACE/personal-git-hash")" ]; then + echo_info "Latest version of personal packages is already build." + exit 0 +fi + +if [ -z "$CLEAN" ] && [ -f "$WORKSPACE/openwrt-git-hash" ] && [ "$new_upstream" = "n" ]; then echo_info "Using previous version of SDK" tar -xzf "$WORKSPACE/openwrt.tar.gz" else @@ -79,3 +90,4 @@ ssh upload /bin/sh -se "$ANIMAL" "$BOARD" <<"EOF" rm -rf "/var/www/repo/turris/$1/$2" mv "deploy-turris-$1-$2" "/var/www/repo/turris/$1/$2" EOF +echo "$latest_master" > "$WORKSPACE/personal-git-hash" |