|
|
@ -36,17 +36,19 @@ def update_package(): |
|
|
|
version = latest['tag_name'] |
|
|
|
version = latest['tag_name'] |
|
|
|
pe = PackageEntry(); |
|
|
|
pe = PackageEntry(); |
|
|
|
control = pe.load_control_from_wapt('.') |
|
|
|
control = pe.load_control_from_wapt('.') |
|
|
|
|
|
|
|
bin_found = [] |
|
|
|
for arch in ['86','64']: |
|
|
|
for arch in ['86','64']: |
|
|
|
for asset in latest['assets']: |
|
|
|
for asset in latest['assets']: |
|
|
|
if asset['name'] == 'fusioninventory-agent_windows-x%s_%s.exe' % (arch, version) and not isfile('fusioninventory-agent_windows-x%s_%s.exe' % (arch, version)): |
|
|
|
if asset['name'] == 'fusioninventory-agent_windows-x%s_%s.exe' % (arch, version) and not isfile('fusioninventory-agent_windows-x%s_%s.exe' % (arch, version)): |
|
|
|
url = asset['browser_download_url'] |
|
|
|
url = asset['browser_download_url'] |
|
|
|
print('Downloading FusionInventory Agent %s for x%s from %s' % (version,arch,url)) |
|
|
|
print('Downloading FusionInventory Agent %s for x%s from %s' % (version,arch,url)) |
|
|
|
wget(url,'fusioninventory-agent_windows-x%s_%s.exe' % (arch, version)) |
|
|
|
wget(url,'fusioninventory-agent_windows-x%s_%s.exe' % (arch, version)) |
|
|
|
|
|
|
|
bin_found.append(arch) |
|
|
|
for file in glob.glob('fusioninventory-agent_windows-%s_*.exe' % arch): |
|
|
|
for file in glob.glob('fusioninventory-agent_windows-%s_*.exe' % arch): |
|
|
|
if file != 'fusioninventory-agent_windows-x%s_%s.exe' % (arch, version): |
|
|
|
if file != 'fusioninventory-agent_windows-x%s_%s.exe' % (arch, version): |
|
|
|
print('Removing %s' % file) |
|
|
|
print('Removing %s' % file) |
|
|
|
remove_file(file) |
|
|
|
remove_file(file) |
|
|
|
if Version(version) > Version(control['version'].split('-',1)[0]): |
|
|
|
if Version(version) > Version(control['version'].split('-',1)[0]) and '86' in bin_found and '64' in bin_found: |
|
|
|
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' |
|
|
|
pe.maturity = 'PREPROD' |
|
|
|
pe.maturity = 'PREPROD' |
|
|
|