Skip to content

Commit

Permalink
Revert to dirhash, there is a Windows fix pending for it...
Browse files Browse the repository at this point in the history
...which might fix the cross-environment issues?
See: andhus/scantree#22
  • Loading branch information
bossanova808 committed Apr 22, 2024
1 parent 5750831 commit f8b1f3e
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 13 deletions.
14 changes: 7 additions & 7 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
import hashlib

# These usually need to be installed, e.g. on Ubuntu:
# pip3 install rich dirhash semver
from checksumdir import dirhash
import semver
# pip3 install rich dirhash
from dirhash import dirhash
from rich.console import Console
from rich.theme import Theme

Expand Down Expand Up @@ -70,9 +69,7 @@
# If we detect changes, then zip up the new version and move to the download folder with the correct name
make_new_zip = True
# Dirhash version
# DIRHASH_CALCULATED = dirhash(ADDON_FOLDER_STAGING, "md5", jobs=8)
# Checksumdir version
DIRHASH_CALCULATED = dirhash(ADDON_FOLDER_STAGING, "md5")
DIRHASH_CALCULATED = dirhash(f"staging/{addon}", "md5", jobs=8)
DIRHASH_RECORDED = None
# Use a relative path here as ?dirhash across environments changing?
DIRHASH_FILE = f"./staging/dirhash/{addon}.dirhash"
Expand All @@ -86,6 +83,9 @@
console.log(f"Valid release zip already exists (dirhash=dirhash), skipping.", style="info")
# console.log("(dirhash: {DIRHASH_RECORDED} matches new dirhash: {DIRHASH_CALCULATED})")
make_new_zip = False
else:
console.log(f"Dirhash does not match.", style="info")
console.log(f"Recorded: '{DIRHASH_RECORDED}' Calculated: '{DIRHASH_CALCULATED}'", style="info")

# If the addon zip is not actually present, we need to make it no matter what the dirhash situation...
if not os.path.exists(f"{ADDON_FOLDER_REPOSITORY_DOWNLOADS}/{ZIP_FILE}.zip"):
Expand All @@ -97,7 +97,7 @@
changes_detected = True
console.log(f"Making new release zip: '{ADDON_FOLDER_REPOSITORY_DOWNLOADS}/{ZIP_FILE}.zip'")
shutil.make_archive(f"{ADDON_FOLDER_REPOSITORY_DOWNLOADS}/{ZIP_FILE}", 'zip', root_dir=STAGING_DIR, base_dir=addon)
console.log(f"& writing new dirhash file: '{DIRHASH_FILE}'")
console.log(f"Writing new dirhash '{DIRHASH_CALCULATED}' to file: '{DIRHASH_FILE}'")
with open(DIRHASH_FILE, 'w', encoding="utf-8") as f:
f.write(DIRHASH_CALCULATED)

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion staging/dirhash/repository.bossanova808.dirhash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d42d8c2f9bfbadb868c6837ab6e2ec5b
dc2010ba97c86a38e41a3a87baecd873
2 changes: 1 addition & 1 deletion staging/dirhash/script.kodi.yoctodisplay.dirhash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
eac198629631c84137dca9da67fa5f3d
6511269c20d6a32192a14f2efd32bd82
2 changes: 1 addition & 1 deletion staging/dirhash/script.ozweather-skinpatcher.dirhash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0dab7bec47e613099f32e6ca0f2d5b7a
8bb8ab31c8b6e2f8dc73495441d451d6
Original file line number Diff line number Diff line change
@@ -1 +1 @@
eff42f7d074f573442e16a1c3626ff9e
176638aab55a9198174b98dd67c348ca
2 changes: 1 addition & 1 deletion staging/dirhash/skin.confluence.bossanova808.nexus.dirhash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
54e5037015d54696f10d0731b85b3b0a
e5e139e12663ab1ebeffd5a4350a08af
2 changes: 1 addition & 1 deletion staging/dirhash/skin.confluence.bossanova808.omega.dirhash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6bfb8cd55da470694fe852ff841d44e3
89b55ffc4ad9f051c4b8c1f90e9f7977

0 comments on commit f8b1f3e

Please sign in to comment.