Skip to content

Commit

Permalink
Fix error in release script sequence
Browse files Browse the repository at this point in the history
Cannot list download checksum in appdata file since appdata
is part of that same source package.

Fixup of 506c9c5
  • Loading branch information
jaap-karssenberg committed Jan 1, 2020
1 parent 8781a45 commit ab57a03
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 22 deletions.
31 changes: 16 additions & 15 deletions tools/add_release_to_appdata.py
Expand Up @@ -41,24 +41,25 @@ def new_release(release, date, changelogs):
ul = ET.SubElement(description, "ul")
for entry in changelogs:
ET.SubElement(ul, "li").text = entry
artifacts = ET.SubElement(tag, "artifacts")
artifact = ET.SubElement(artifacts, "artifact")
artifact.set("type", "source")

tarball = "zim-%s.tar.gz" % release
ET.SubElement(artifact, "location").text = "http://www.zim-wiki.org/downloads/" + tarball
#artifacts = ET.SubElement(tag, "artifacts")
#artifact = ET.SubElement(artifacts, "artifact")
#artifact.set("type", "source")

checksum = ET.SubElement(artifact, "checksum")
checksum.set("type", "sha256")
hasher = hashlib.sha256()
with open("dist/" + tarball, "rb") as f:
for chunk in iter(lambda: f.read(4096), b""):
hasher.update(chunk)
checksum.text = hasher.hexdigest()
#tarball = "zim-%s.tar.gz" % release
#ET.SubElement(artifact, "location").text = "http://www.zim-wiki.org/downloads/" + tarball

size = ET.SubElement(artifact, "size")
size.set("type", "download")
size.text = str(os.path.getsize("dist/" + tarball))
#checksum = ET.SubElement(artifact, "checksum")
#checksum.set("type", "sha256")
#hasher = hashlib.sha256()
#with open("dist/" + tarball, "rb") as f:
# for chunk in iter(lambda: f.read(4096), b""):
# hasher.update(chunk)
#checksum.text = hasher.hexdigest()

#size = ET.SubElement(artifact, "size")
#size.set("type", "download")
#size.text = str(os.path.getsize("dist/" + tarball))

return tag

Expand Down
7 changes: 0 additions & 7 deletions xdg/org.zim_wiki.Zim.appdata.xml
Expand Up @@ -57,13 +57,6 @@
<li>Fix bugs in auto insert bullet at newline</li>
</ul>
</description>
<artifacts>
<artifact type="source">
<location>http://www.zim-wiki.org/downloads/zim-0.72.0.tar.gz</location>
<checksum type="sha256">a1a93e17e19365d1e4c729739558fd2e68d7dcdef944d0198f481bf4ceab6fd8</checksum>
<size type="download">2026552</size>
</artifact>
</artifacts>
</release>
</releases>
<update_contact>jaap.karssenberg@gmail.com</update_contact>
Expand Down

0 comments on commit ab57a03

Please sign in to comment.