parent
d2dacdb41d
commit
11a7290a48
|
@ -137,7 +137,7 @@ fdroid build:
|
|||
paths:
|
||||
- .gradle
|
||||
script:
|
||||
- git fetch https://gitlab.com/fdroid/fdroiddata;
|
||||
- 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;
|
||||
|
|
|
@ -20,31 +20,45 @@ for appid in sorted(changed):
|
|||
current = yaml.safe_load(fp)
|
||||
cmd = 'git apply --reverse'
|
||||
p = subprocess.run(cmd.split(' '), input=diff, stdout=subprocess.DEVNULL)
|
||||
if p.returncode:
|
||||
print(Fore.RED + ('ERROR: %s: %d' % (cmd, p.returncode)) + Style.RESET_ALL,
|
||||
file=sys.stderr)
|
||||
sys.exit(p.returncode)
|
||||
with open(metadata_file) as fp:
|
||||
previous = yaml.safe_load(fp)
|
||||
cmd = 'git apply'
|
||||
p = subprocess.run(cmd.split(' '), input=diff, stdout=subprocess.DEVNULL)
|
||||
if p.returncode:
|
||||
print(Fore.RED + ('ERROR: %s: %d' % (cmd, p.returncode)) + Style.RESET_ALL,
|
||||
file=sys.stderr)
|
||||
sys.exit(p.returncode)
|
||||
|
||||
to_build = []
|
||||
previous_builds = dict()
|
||||
for build in previous['Builds']:
|
||||
previous_builds[build['versionCode']] = build
|
||||
if os.path.exists(metadata_file):
|
||||
with open(metadata_file) as fp:
|
||||
previous = yaml.safe_load(fp)
|
||||
cmd = 'git apply'
|
||||
p = subprocess.run(cmd.split(' '), input=diff, stdout=subprocess.DEVNULL)
|
||||
if p.returncode:
|
||||
print(Fore.RED + ('ERROR: %s: %d' % (cmd, p.returncode)) + Style.RESET_ALL,
|
||||
file=sys.stderr)
|
||||
sys.exit(p.returncode)
|
||||
|
||||
for build in current['Builds']:
|
||||
vc = build['versionCode']
|
||||
if vc not in previous_builds:
|
||||
to_build.append(vc)
|
||||
continue
|
||||
if build != previous_builds[vc]:
|
||||
to_build.append(vc)
|
||||
previous_builds = dict()
|
||||
for build in previous['Builds']:
|
||||
previous_builds[build['versionCode']] = build
|
||||
|
||||
for build in current['Builds']:
|
||||
vc = build['versionCode']
|
||||
if vc not in previous_builds:
|
||||
to_build.append(vc)
|
||||
continue
|
||||
if build != previous_builds[vc]:
|
||||
to_build.append(vc)
|
||||
else:
|
||||
# this is a brand new metadata file
|
||||
cmd = 'git checkout -- ' + metadata_file
|
||||
p = subprocess.run(cmd.split(' '), stdout=subprocess.DEVNULL)
|
||||
if p.returncode:
|
||||
print(Fore.RED + ('ERROR: %s: %d' % (cmd, p.returncode)) + Style.RESET_ALL,
|
||||
file=sys.stderr)
|
||||
sys.exit(p.returncode)
|
||||
with open(metadata_file) as fp:
|
||||
data = yaml.safe_load(fp)
|
||||
for build in data['Builds']:
|
||||
to_build.append(build['versionCode'])
|
||||
|
||||
for vc in to_build:
|
||||
print('%s:%d' % (appid, vc), end=' ')
|
||||
|
|
Loading…
Reference in New Issue