From a1ed6901d4dc1fc9067adeb03d788ac8d6897467 Mon Sep 17 00:00:00 2001 From: rembo10 Date: Wed, 9 Apr 2014 18:52:31 -0700 Subject: [PATCH 1/4] Possible fix for zip not updating --- headphones/versioncheck.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/headphones/versioncheck.py b/headphones/versioncheck.py index 17afc19b..c30114a9 100644 --- a/headphones/versioncheck.py +++ b/headphones/versioncheck.py @@ -182,14 +182,14 @@ def update(): update_dir = os.path.join(headphones.PROG_DIR, 'update') version_path = os.path.join(headphones.PROG_DIR, 'version.txt') - logger.info('Downloading update from: '+tar_download_url) + logger.info('Downloading update from: '+ tar_download_url) data = request.request_content(tar_download_url) if not data: logger.error("Unable to retrieve new version from '%s', can't update", tar_download_url) return - download_name = data.geturl().split('/')[-1] + download_name = headphones.GIT_BRANCH + '-github' tar_download_path = os.path.join(headphones.PROG_DIR, download_name) # Save tar to disk From 0c32fbe7062758bf3d8fbf116f4c4a5d17f7cc92 Mon Sep 17 00:00:00 2001 From: rembo10 Date: Wed, 9 Apr 2014 18:56:33 -0700 Subject: [PATCH 2/4] 'Nother bug in the updater --- headphones/versioncheck.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headphones/versioncheck.py b/headphones/versioncheck.py index c30114a9..ff7372e4 100644 --- a/headphones/versioncheck.py +++ b/headphones/versioncheck.py @@ -194,7 +194,7 @@ def update(): # Save tar to disk f = open(tar_download_path, 'wb') - f.write(data.read()) + f.write(data) f.close() # Extract the tar to update folder From 69d1807e9a5ce36d36ad8c53293140e468aa27a1 Mon Sep 17 00:00:00 2001 From: rembo10 Date: Wed, 9 Apr 2014 19:33:07 -0700 Subject: [PATCH 3/4] Possible fix for updater --- headphones/versioncheck.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headphones/versioncheck.py b/headphones/versioncheck.py index ff7372e4..fd79dca9 100644 --- a/headphones/versioncheck.py +++ b/headphones/versioncheck.py @@ -228,7 +228,7 @@ def update(): # Update version.txt try: ver_file = open(version_path, 'w') - ver_file.write(headphones.LATEST_VERSION) + ver_file.write(str(headphones.LATEST_VERSION)) ver_file.close() except IOError, e: logger.error("Unable to write current version to version.txt, update not complete: "+ex(e)) From a37ce75038eacdcd271f68fd95a6f0987b2bf964 Mon Sep 17 00:00:00 2001 From: rembo10 Date: Wed, 9 Apr 2014 19:39:09 -0700 Subject: [PATCH 4/4] Bug fix to return latest version available rather than None --- headphones/versioncheck.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headphones/versioncheck.py b/headphones/versioncheck.py index fd79dca9..ff42e894 100644 --- a/headphones/versioncheck.py +++ b/headphones/versioncheck.py @@ -134,7 +134,7 @@ def checkGithub(): # See how many commits behind we are if not headphones.CURRENT_VERSION: logger.info('You are running an unknown version of Headphones. Run the updater to identify your version') - return headphones.CURRENT_VERSION + return headphones.LATEST_VERSION logger.info('Comparing currently installed version with latest GitHub version') url = 'https://api.github.com/repos/%s/headphones/compare/%s...%s' % (headphones.GIT_USER, headphones.CURRENT_VERSION, headphones.LATEST_VERSION)