|
|
|
@ -19,13 +19,15 @@ def update_package(): |
|
|
|
|
import re |
|
|
|
|
|
|
|
|
|
latest = json.loads(requests.get('https://api.github.com/repos/git-for-windows/git/releases/latest').text.encode('utf-8')) |
|
|
|
|
latest_version = re.search('v(.*)\.windows\.1', latest['tag_name']).group(1) |
|
|
|
|
latest_version = re.search('v(.*)\.windows\.(\d+)', latest['tag_name']).group(1) |
|
|
|
|
latest_release = re.search('v(.*)\.windows\.(\d+)', latest['tag_name']).group(2) |
|
|
|
|
latest_version = '%s.%s' % (latest_version, latest_release) |
|
|
|
|
pe = PackageEntry(); |
|
|
|
|
control = pe.load_control_from_wapt('.') |
|
|
|
|
current_version = control['version'].split('-',1)[0] |
|
|
|
|
|
|
|
|
|
if Version(latest_version) > Version(current_version): |
|
|
|
|
print('Updateing package from %s to %s' % (current_version, latest_version)) |
|
|
|
|
print('Updating package from %s to %s' % (current_version, latest_version)) |
|
|
|
|
for arch in ['32','64']: |
|
|
|
|
for asset in latest['assets']: |
|
|
|
|
if asset['name'] == 'Git-%s-%s-bit.exe' % (latest_version, arch) and not isfile('Git-%s-%s-bit.exe' % (latest_version, arch)): |
|
|
|
|