forked from hawkthorne/hawkthorne-journey
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
27921e9
commit 66578f8
Showing
3 changed files
with
68 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,5 @@ bin/* | |
release.md | ||
post.md | ||
src/conf.lua.bak | ||
sparkle | ||
*.pyc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import version | ||
import os | ||
import urllib | ||
import logging | ||
import subprocess | ||
from os import path | ||
|
||
logging.basicConfig(level=logging.INFO) | ||
|
||
HAWK_URL = "http://files.projecthawkthorne.com/releases/{}/hawkthorne-osx.zip" | ||
BDIFF_URL = "https://bitbucket.org/kyleconroy/love/downloads/BinaryDelta.zip" | ||
|
||
|
||
if __name__ == "__main__": | ||
x, y, z = version.current_version_tuple() | ||
#versions = ["{}.{}.{}".format(x, y, int(z) - i) for i in range(1,6)] | ||
versions = ["v0.0.70", "v0.0.69"] | ||
current_version = versions[0] | ||
current_dir = path.join("sparkle", "releases", current_version) | ||
|
||
if not path.exists("sparkle/releases"): | ||
os.makedirs("sparkle/releases") | ||
|
||
if not path.exists("sparkle/deltas"): | ||
os.makedirs("sparkle/deltas") | ||
|
||
if not path.exists("sparkle/BinaryDelta"): | ||
|
||
if not path.exists("sparkle/BinaryDelta.zip"): | ||
logging.info("Fetching BinaryDelta") | ||
urllib.urlretrieve(BDIFF_URL, "sparkle/BinaryDelta.zip") | ||
|
||
subprocess.call(["unzip", "-q", "sparkle/BinaryDelta.zip", "-d", "sparkle"]) | ||
|
||
for version in versions: | ||
app_dir = path.join("sparkle", "releases", version) | ||
zip_path = path.join(app_dir, "hawk-osx.zip") | ||
app_path = path.join(app_dir, "Journey to the Center of Hawkthorne.app") | ||
# Check S3 for existing delta?? Probably a good idea | ||
|
||
if not path.exists(app_dir): | ||
os.makedirs(app_dir) | ||
|
||
if not path.exists(zip_path): | ||
logging.info("Fetching {}".format(zip_path)) | ||
urllib.urlretrieve(HAWK_URL.format(version), zip_path) | ||
|
||
if not path.exists(app_path): | ||
subprocess.call(["unzip", "-q", zip_path, "-d", app_dir]) | ||
|
||
for version in versions[1:]: | ||
delta_path = path.join("sparkle", "deltas", | ||
"{}-{}.delta".format(version, current_version)) | ||
|
||
if path.exists(delta_path): | ||
continue | ||
|
||
app_dir = path.join("sparkle", "releases", version) | ||
|
||
subprocess.call(["BinaryDelta", "create", | ||
os.path.join(app_dir, "Journey to the Center of Hawkthorne.app"), | ||
os.path.join(current_dir, "Journey to the Center of Hawkthorne.app")]) |