parent
d2dacdb41d
commit
11a7290a48
|
@ -137,7 +137,7 @@ fdroid build:
|
||||||
paths:
|
paths:
|
||||||
- .gradle
|
- .gradle
|
||||||
script:
|
script:
|
||||||
- git fetch https://gitlab.com/fdroid/fdroiddata;
|
- git fetch https://gitlab.com/fdroid/fdroiddata.git;
|
||||||
- test -d build || mkdir build
|
- test -d build || mkdir build
|
||||||
- for f in `git diff --name-only --diff-filter=d FETCH_HEAD...HEAD -- metadata/*.yml`; do
|
- 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;
|
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)
|
current = yaml.safe_load(fp)
|
||||||
cmd = 'git apply --reverse'
|
cmd = 'git apply --reverse'
|
||||||
p = subprocess.run(cmd.split(' '), input=diff, stdout=subprocess.DEVNULL)
|
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:
|
if p.returncode:
|
||||||
print(Fore.RED + ('ERROR: %s: %d' % (cmd, p.returncode)) + Style.RESET_ALL,
|
print(Fore.RED + ('ERROR: %s: %d' % (cmd, p.returncode)) + Style.RESET_ALL,
|
||||||
file=sys.stderr)
|
file=sys.stderr)
|
||||||
sys.exit(p.returncode)
|
sys.exit(p.returncode)
|
||||||
|
|
||||||
to_build = []
|
to_build = []
|
||||||
previous_builds = dict()
|
if os.path.exists(metadata_file):
|
||||||
for build in previous['Builds']:
|
with open(metadata_file) as fp:
|
||||||
previous_builds[build['versionCode']] = build
|
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']:
|
previous_builds = dict()
|
||||||
vc = build['versionCode']
|
for build in previous['Builds']:
|
||||||
if vc not in previous_builds:
|
previous_builds[build['versionCode']] = build
|
||||||
to_build.append(vc)
|
|
||||||
continue
|
for build in current['Builds']:
|
||||||
if build != previous_builds[vc]:
|
vc = build['versionCode']
|
||||||
to_build.append(vc)
|
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:
|
for vc in to_build:
|
||||||
print('%s:%d' % (appid, vc), end=' ')
|
print('%s:%d' % (appid, vc), end=' ')
|
||||||
|
|
Loading…
Reference in New Issue