Update to 2.20.1 and fix last version detection
This commit is contained in:
parent
f555d23d05
commit
5d6227147d
BIN
Git-2.20.0-32-bit.exe (Stored with Git LFS)
BIN
Git-2.20.0-32-bit.exe (Stored with Git LFS)
Binary file not shown.
BIN
Git-2.20.0-64-bit.exe (Stored with Git LFS)
BIN
Git-2.20.0-64-bit.exe (Stored with Git LFS)
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,5 +1,5 @@
|
||||||
package : fws-git
|
package : fws-git
|
||||||
version : 2.20.0-3
|
version : 2.20.1-1
|
||||||
architecture : all
|
architecture : all
|
||||||
section : base
|
section : base
|
||||||
priority : optional
|
priority : optional
|
||||||
|
|
5
setup.py
5
setup.py
|
@ -16,11 +16,13 @@ def install():
|
||||||
)
|
)
|
||||||
|
|
||||||
def update_package():
|
def update_package():
|
||||||
|
import re
|
||||||
print('Updating Git Package')
|
print('Updating Git Package')
|
||||||
latest = json.loads(requests.get('https://api.github.com/repos/git-for-windows/git/releases/latest').text.encode('utf-8'))
|
latest = json.loads(requests.get('https://api.github.com/repos/git-for-windows/git/releases/latest').text.encode('utf-8'))
|
||||||
version = latest['tag_name'].lstrip('v').rstrip('.windows.1')
|
version = re.search('v(.*)\.windows\.1', latest['tag_name']).group(1)
|
||||||
pe = PackageEntry();
|
pe = PackageEntry();
|
||||||
control = pe.load_control_from_wapt('.')
|
control = pe.load_control_from_wapt('.')
|
||||||
|
print('Last version is %s' % version)
|
||||||
for arch in ['32','64']:
|
for arch in ['32','64']:
|
||||||
for asset in latest['assets']:
|
for asset in latest['assets']:
|
||||||
if asset['name'] == 'Git-%s-%s-bit.exe' %(version,arch) and not isfile('Git-%s-%s-bit.exe' % (version,arch)):
|
if asset['name'] == 'Git-%s-%s-bit.exe' %(version,arch) and not isfile('Git-%s-%s-bit.exe' % (version,arch)):
|
||||||
|
@ -30,6 +32,7 @@ def update_package():
|
||||||
for old in glob.glob(r'Git-*-%s-bit.exe' % arch):
|
for old in glob.glob(r'Git-*-%s-bit.exe' % arch):
|
||||||
if not old == 'Git-%s-%s-bit.exe' %(version,arch):
|
if not old == 'Git-%s-%s-bit.exe' %(version,arch):
|
||||||
remove_file(old)
|
remove_file(old)
|
||||||
|
|
||||||
if Version(version) > Version(control['version'].split('-',1)[0]):
|
if Version(version) > Version(control['version'].split('-',1)[0]):
|
||||||
print('Updating control file with new version %s' % version)
|
print('Updating control file with new version %s' % version)
|
||||||
pe.version = version + '-0'
|
pe.version = version + '-0'
|
||||||
|
|
Loading…
Reference in New Issue