Skip to content

Commit 721de49

Browse files
committed
make_website: only parse repo_pubkey if its needed
This makes writing tests a lot easier, since the test cases no longer need to provide a value for `repo_pubkey:`.
1 parent 677301b commit 721de49

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

fdroidserver/index.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,6 @@ def _should_file_be_generated(path, magic_string):
152152

153153

154154
def make_website(apps, repodir, repodict):
155-
_ignored, repo_pubkey_fingerprint = extract_pubkey()
156-
repo_pubkey_fingerprint_stripped = repo_pubkey_fingerprint.replace(" ", "")
157-
link = repodict["address"]
158-
link_fingerprinted = ('{link}?fingerprint={fingerprint}'
159-
.format(link=link, fingerprint=repo_pubkey_fingerprint_stripped))
160155
# do not change this string, as it will break updates for files with older versions of this string
161156
autogenerate_comment = "auto-generated - fdroid index updates will overwrite this file"
162157

@@ -168,6 +163,13 @@ def make_website(apps, repodir, repodict):
168163

169164
if _should_file_be_generated(html_file, autogenerate_comment):
170165
import qrcode
166+
167+
_ignored, repo_pubkey_fingerprint = extract_pubkey()
168+
repo_pubkey_fingerprint_stripped = repo_pubkey_fingerprint.replace(" ", "")
169+
link = repodict["address"]
170+
link_fingerprinted = '{link}?fingerprint={fingerprint}'.format(
171+
link=link, fingerprint=repo_pubkey_fingerprint_stripped
172+
)
171173
qrcode.make(link_fingerprinted).save(os.path.join(repodir, "index.png"))
172174
with open(html_file, 'w') as f:
173175
name = repodict["name"]

0 commit comments

Comments
 (0)