diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2013-11-24 15:18:44 +0100 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2013-11-24 15:18:44 +0100 |
commit | e03db0a0773e078d9b677d396ad78362654956af (patch) | |
tree | 17192285892d996eb7b9819e79e04729e166e81a /youtube_dl/update.py | |
parent | a1ee09e815cb413d67cee17ad686224b26182dfb (diff) | |
parent | 267ed0c5d3547c68f1d34203c2ae4b0d826a29d9 (diff) | |
download | youtube-dl-e03db0a0773e078d9b677d396ad78362654956af.tar.xz |
Merge branch 'master' into opener-to-ydl
Diffstat (limited to 'youtube_dl/update.py')
-rw-r--r-- | youtube_dl/update.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/youtube_dl/update.py b/youtube_dl/update.py index e5f441707..cd9670166 100644 --- a/youtube_dl/update.py +++ b/youtube_dl/update.py @@ -41,6 +41,7 @@ def rsa_verify(message, signature, key): if signature != sha256(message).digest(): return False return True + def update_self(to_screen, verbose): """Update the program file with the latest version from the repository""" @@ -82,6 +83,13 @@ def update_self(to_screen, verbose): return version_id = versions_info['latest'] + + def version_tuple(version_str): + return tuple(map(int, version_str.split('.'))) + if version_tuple(__version__) >= version_tuple(version_id): + to_screen(u'youtube-dl is up to date (%s)' % __version__) + return + to_screen(u'Updating to version ' + version_id + '...') version = versions_info['versions'][version_id] |