gitlab-ci: improved detection of actual builds for `fdroid build

Apps and Builds that are disabled should obviously not be run.  But if a
merge request disables a single build and adds a build, then `fdroid build`
should run on the new build.

https://gitlab.com/fdroid/fdroiddata/-/merge_requests/7821#note_458798083
This commit is contained in:
Hans-Christoph Steiner 2020-12-02 16:12:51 +01:00
parent 4ceed5fd9f
commit f7bf5a747a
No known key found for this signature in database
GPG key ID: 3E177817BA1B9BFA

View file

@ -137,7 +137,10 @@ fdroid build:
- git fetch https://gitlab.com/fdroid/fdroiddata.git;
- test -d build || mkdir build
- for f in `git diff --name-only --diff-filter=d FETCH_HEAD...HEAD -- metadata/*.yml`; do
git diff FETCH_HEAD...HEAD -- $f |grep -E '^\+ *(NoSourceSince|Disabled|disable):' && continue;
diff=$(git diff FETCH_HEAD...HEAD -- $f);
echo "$diff";
test $(echo "$diff" | grep '^[+-] ' | grep -v '^+ *disable:' | wc -l) = 0 && continue;
echo "$diff" | grep -E '^\+ *(NoSourceSince|Disabled):' && continue;
appid=`echo $f | sed -n -e 's,^metadata/\([^/][^/]*\)\.yml,\1,p'`;
export CHANGED="$CHANGED $appid";
done;