From 3f4d6ef6d2a9b6a9c6595a202a18c98b155ee524 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Mon, 26 Jun 2023 12:24:50 +0200 Subject: [PATCH] Package upgrade fixes and update to 1.5 --- GLPI-Agent-1.4-x64.msi | 3 - GLPI-Agent-1.4-x86.msi | 3 - GLPI-Agent-1.5-x64.msi | 3 + GLPI-Agent-1.5-x86.msi | 3 + WAPT/control | 8 +-- WAPT/wapt.psproj | 124 ++++++++++++++--------------------------- setup.py | 14 +++-- 7 files changed, 60 insertions(+), 98 deletions(-) delete mode 100644 GLPI-Agent-1.4-x64.msi delete mode 100644 GLPI-Agent-1.4-x86.msi create mode 100644 GLPI-Agent-1.5-x64.msi create mode 100644 GLPI-Agent-1.5-x86.msi diff --git a/GLPI-Agent-1.4-x64.msi b/GLPI-Agent-1.4-x64.msi deleted file mode 100644 index 31a6c86..0000000 --- a/GLPI-Agent-1.4-x64.msi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:95c3e417bf7fcc7674b033c1abb89e108f7677bc01a2628ec5a00a6bc289a7e5 -size 15056896 diff --git a/GLPI-Agent-1.4-x86.msi b/GLPI-Agent-1.4-x86.msi deleted file mode 100644 index 6d73845..0000000 --- a/GLPI-Agent-1.4-x86.msi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:987c4874eae6291d9adcf50b70509b57fa5df2c205624b1cf0975f8a3e59c02e -size 15024128 diff --git a/GLPI-Agent-1.5-x64.msi b/GLPI-Agent-1.5-x64.msi new file mode 100644 index 0000000..36eb61b --- /dev/null +++ b/GLPI-Agent-1.5-x64.msi @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0f2cfadee623013028b73bf31c89ca3f43a3797c95a7cf45fdeb320ea73a4b7d +size 16621756 diff --git a/GLPI-Agent-1.5-x86.msi b/GLPI-Agent-1.5-x86.msi new file mode 100644 index 0000000..34e3560 --- /dev/null +++ b/GLPI-Agent-1.5-x86.msi @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9ffaef446ac86fad22c19d7daf57b76918760ac828d990f390066ec2972d025 +size 16621756 diff --git a/WAPT/control b/WAPT/control index 9945825..85a0f37 100644 --- a/WAPT/control +++ b/WAPT/control @@ -1,5 +1,5 @@ package : eht-glpi-agent -version : 1.4-6 +version : 1.5-3 architecture : all section : base priority : optional @@ -29,7 +29,7 @@ editor : keywords : inventory licence : GPLv2+ homepage : http://glpi-project.org/ -package_uuid : 2a4a9893-325a-4301-8ebe-db2418f89133 +package_uuid : fa238a04-45d4-414b-b152-f87487bac3e6 valid_from : valid_until : forced_install_on : @@ -39,6 +39,6 @@ max_os_version : icon_sha256sum : fba3af4f79be43de12a5f9438a98831edc7a08c5761e5f216eb9d9ca5d98b3ff signer : dbd signer_fingerprint: e9156ec73f1ea6b50f33e0d9f580e8ae56db147100894bb5d2d4648a46f07ed1 -signature : Pflv3b4Y6tEimQYzmqXY1pssMBXTBx5L0GFTm8t/YfK2T8FMK97n+aS/KLmRfQQFHQk8a1dWPbJ9FtMw2xTDIh+Ao+7ne4PD6V82wTlKTCd48DrGnCRHiD1mhEU95d4fDW9v0vHJwNezJWZ3CEee/iG2kRkYizEanjZsHaGs29vIzPDbPdQ27wC4jYe2EKH9C9+0slDMyvrPoq1xUtmkusRgsEGupgQEI1ymUT8C4PSGc96jy8agIkQYXsWHSff0bJ/JcoFUHPffdhozOeAeetzVLRZMlqATG+EZ67CzJtE/Vi+nKiAXFy/dOoCL77sj3LKjo5PQ4oBIp589oL3+sA== -signature_date : 2023-03-27T14:42:55.641309 +signature : lCIb1ejBByEDsSKKyusgpSBA3fYkkZPumtRjuS+nxcB0p34/DAz/M+1l6VQfZWhW1+Vj1TSQ5g0CTOUn0N1xnZSs5tF+N+B50VToALvW/hVQjvpQTcm6wgpCWQ6IG0YqlMK2YRctz8NmaBLX2LA4XbxEbHa3qpkwJp/vES8+J2ULiWRcBJZZL6s5wXQppdq5FEIhxNkAPzaBXQ8iYtvdEMWSDqfuO/7z6H/ea2+Ydqw1hOXbfiqdVTl38baN2WOR8ESmjPHDZ2pb0MDOMtJlKSBrtK+dBRziLbXeK3te5DywUAdpxFm6OPgEXjat3kNZVmj8f6NCstUqDPdpLfj//A== +signature_date : 2023-06-26T12:24:03.237760 signed_attributes : package,version,architecture,section,priority,name,categories,maintainer,description,depends,conflicts,maturity,locale,target_os,min_wapt_version,sources,installed_size,impacted_process,description_fr,description_pl,description_de,description_es,description_pt,description_it,description_nl,description_ru,audit_schedule,editor,keywords,licence,homepage,package_uuid,valid_from,valid_until,forced_install_on,changelog,min_os_version,max_os_version,icon_sha256sum,signer,signer_fingerprint,signature_date,signed_attributes \ No newline at end of file diff --git a/WAPT/wapt.psproj b/WAPT/wapt.psproj index 42a4af8..31fd757 100644 --- a/WAPT/wapt.psproj +++ b/WAPT/wapt.psproj @@ -1,5 +1,5 @@ [PyScripter] -Version=3.4.2.0 +Version=3.6.4.0 [Project] ClassName=TProjectRootNode @@ -23,18 +23,34 @@ FileName=C:\Program Files (x86)\wapt\setuphelpers.py [Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node2] ClassName=TProjectFileNode -FileName=C:\Program Files (x86)\wapt\wapt-get.py +FileName=C:\Program Files (x86)\wapt\setuphelpers_linux.py [Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3] ClassName=TProjectFileNode -FileName=C:\Program Files (x86)\wapt\wapt-get.ini +FileName=C:\Program Files (x86)\wapt\setuphelpers_macos.py [Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node4] ClassName=TProjectFileNode +FileName=C:\Program Files (x86)\wapt\setuphelpers_unix.py + +[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node5] +ClassName=TProjectFileNode +FileName=C:\Program Files (x86)\wapt\setuphelpers_windows.py + +[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node6] +ClassName=TProjectFileNode +FileName=C:\Program Files (x86)\wapt\wapt-get.ini + +[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node7] +ClassName=TProjectFileNode +FileName=C:\Program Files (x86)\wapt\wapt-get.py + +[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node8] +ClassName=TProjectFileNode FileName=C:\Program Files (x86)\wapt\waptpackage.py [Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes] -Count=5 +Count=9 [Project\ChildNodes\Node0\ChildNodes\Node1] ClassName=TProjectFileNode @@ -56,10 +72,11 @@ ClassName=TProjectRunConfiguationsNode [Project\ChildNodes\Node1\ChildNodes\Node0] ClassName=TProjectRunConfiguationNode -Name=install +Name=WAPT: install [Project\ChildNodes\Node1\ChildNodes\Node0\RunConfig] ScriptName=C:\Program Files (x86)\wapt\wapt-get.py +Description=Launch package installation. EngineType=peRemote ReinitializeBeforeRun=TRUE Parameters=install "$[Project-Path].." @@ -77,10 +94,11 @@ WorkingDirectory=$[ActiveScript-Dir] [Project\ChildNodes\Node1\ChildNodes\Node1] ClassName=TProjectRunConfiguationNode -Name=remove +Name=WAPT: remove [Project\ChildNodes\Node1\ChildNodes\Node1\RunConfig] ScriptName=C:\Program Files (x86)\wapt\wapt-get.py +Description=Launch uninstallation (the uninstallation code found in local wapt database, remember to launch after an installation). EngineType=peRemote ReinitializeBeforeRun=TRUE Parameters=remove "$[Project-Path].." @@ -98,13 +116,14 @@ WorkingDirectory=$[ActiveScript-Dir] [Project\ChildNodes\Node1\ChildNodes\Node2] ClassName=TProjectRunConfiguationNode -Name=session-setup +Name=WAPT: uninstall [Project\ChildNodes\Node1\ChildNodes\Node2\RunConfig] ScriptName=C:\Program Files (x86)\wapt\wapt-get.py +Description=Launch uninstallation code (for debugging purpose, it only runs the code of uninstall function). EngineType=peRemote ReinitializeBeforeRun=TRUE -Parameters=session-setup "$[Project-Path].." +Parameters=uninstall "$[Project-Path].." WorkingDir=$[Project-Path].. WriteOutputToFile=FALSE OutputFileName=$[ActiveScript-NoExt].log @@ -115,17 +134,18 @@ Caption=External Run Description=Run script using an external Python Interpreter ApplicationName=$[PythonExe-Short] Parameters=$[ActiveScript-Short] -WorkingDirectory=$[ActiveScript-Dir] +WorkingDirectory=$[Project-Path].. [Project\ChildNodes\Node1\ChildNodes\Node3] ClassName=TProjectRunConfiguationNode -Name=update +Name=WAPT: session-setup [Project\ChildNodes\Node1\ChildNodes\Node3\RunConfig] ScriptName=C:\Program Files (x86)\wapt\wapt-get.py +Description=Launch session-setup (it runs directly as current user). EngineType=peRemote ReinitializeBeforeRun=TRUE -Parameters=update +Parameters=session-setup "$[Project-Path].." WorkingDir=$[Project-Path].. WriteOutputToFile=FALSE OutputFileName=$[ActiveScript-NoExt].log @@ -140,14 +160,15 @@ WorkingDirectory=$[ActiveScript-Dir] [Project\ChildNodes\Node1\ChildNodes\Node4] ClassName=TProjectRunConfiguationNode -Name=upgrade +Name=WAPT: audit [Project\ChildNodes\Node1\ChildNodes\Node4\RunConfig] ScriptName=C:\Program Files (x86)\wapt\wapt-get.py +Description=Launch package audit. EngineType=peRemote ReinitializeBeforeRun=TRUE -Parameters=-f upgrade -WorkingDir=$[ActiveScript-Dir] +Parameters=audit -f "$[Project-Path].." +WorkingDir=$[Project-Path].. WriteOutputToFile=FALSE OutputFileName=$[ActiveScript-NoExt].log AppendToFile=FALSE @@ -161,13 +182,14 @@ WorkingDirectory=$[ActiveScript-Dir] [Project\ChildNodes\Node1\ChildNodes\Node5] ClassName=TProjectRunConfiguationNode -Name=-i build-upload +Name=WAPT: update-package [Project\ChildNodes\Node1\ChildNodes\Node5\RunConfig] ScriptName=C:\Program Files (x86)\wapt\wapt-get.py +Description=Launch update_package (it usually serve to update binaries of the package). EngineType=peRemote ReinitializeBeforeRun=TRUE -Parameters=-i build-upload "$[Project-Path].." +Parameters=update-package-sources "$[Project-Path].." WorkingDir=$[Project-Path].. WriteOutputToFile=FALSE OutputFileName=$[ActiveScript-NoExt].log @@ -182,13 +204,14 @@ WorkingDirectory=$[ActiveScript-Dir] [Project\ChildNodes\Node1\ChildNodes\Node6] ClassName=TProjectRunConfiguationNode -Name=svn update +Name=WAPT: -i build-upload [Project\ChildNodes\Node1\ChildNodes\Node6\RunConfig] ScriptName=C:\Program Files (x86)\wapt\wapt-get.py +Description=Build and upload package to the waptserver. EngineType=peRemote ReinitializeBeforeRun=TRUE -Parameters=sources "$[Project-Path].." +Parameters=--use-gui -i build-upload "$[Project-Path].." WorkingDir=$[Project-Path].. WriteOutputToFile=FALSE OutputFileName=$[ActiveScript-NoExt].log @@ -201,71 +224,8 @@ ApplicationName=$[PythonExe-Short] Parameters=$[ActiveScript-Short] WorkingDirectory=$[ActiveScript-Dir] -[Project\ChildNodes\Node1\ChildNodes\Node7] -ClassName=TProjectRunConfiguationNode -Name=uninstall - -[Project\ChildNodes\Node1\ChildNodes\Node7\RunConfig] -ScriptName=C:\Program Files (x86)\wapt\wapt-get.py -EngineType=peRemote -ReinitializeBeforeRun=TRUE -Parameters=uninstall "$[Project-Path].." -WorkingDir=$[Project-Path].. -WriteOutputToFile=FALSE -OutputFileName=$[ActiveScript-NoExt].log -AppendToFile=FALSE - -[Project\ChildNodes\Node1\ChildNodes\Node7\RunConfig\ExternalRun] -Caption=External Run -Description=Run script using an external Python Interpreter -ApplicationName=$[PythonExe-Short] -Parameters=$[ActiveScript-Short] -WorkingDirectory=$[Project-Path].. - -[Project\ChildNodes\Node1\ChildNodes\Node8] -ClassName=TProjectRunConfiguationNode -Name=update-package-sources - -[Project\ChildNodes\Node1\ChildNodes\Node8\RunConfig] -ScriptName=C:\Program Files (x86)\wapt\wapt-get.py -EngineType=peRemote -ReinitializeBeforeRun=TRUE -Parameters=update-package-sources "$[Project-Path].." -WorkingDir=$[Project-Path].. -WriteOutputToFile=FALSE -OutputFileName=$[ActiveScript-NoExt].log -AppendToFile=FALSE - -[Project\ChildNodes\Node1\ChildNodes\Node8\RunConfig\ExternalRun] -Caption=External Run -Description=Run script using an external Python Interpreter -ApplicationName=$[PythonExe-Short] -Parameters=$[ActiveScript-Short] -WorkingDirectory=$[ActiveScript-Dir] - -[Project\ChildNodes\Node1\ChildNodes\Node9] -ClassName=TProjectRunConfiguationNode -Name=audit - -[Project\ChildNodes\Node1\ChildNodes\Node9\RunConfig] -ScriptName=C:\Program Files (x86)\wapt\wapt-get.py -EngineType=peRemote -ReinitializeBeforeRun=TRUE -Parameters=audit -f "$[Project-Path].." -WorkingDir=$[Project-Path].. -WriteOutputToFile=FALSE -OutputFileName=$[ActiveScript-NoExt].log -AppendToFile=FALSE - -[Project\ChildNodes\Node1\ChildNodes\Node9\RunConfig\ExternalRun] -Caption=External Run -Description=Run script using an external Python Interpreter -ApplicationName=$[PythonExe-Short] -Parameters=$[ActiveScript-Short] -WorkingDirectory=$[ActiveScript-Dir] - [Project\ChildNodes\Node1\ChildNodes] -Count=10 +Count=7 [Project\ChildNodes] Count=2 diff --git a/setup.py b/setup.py index 9202530..0d6e7ab 100644 --- a/setup.py +++ b/setup.py @@ -39,9 +39,9 @@ def install(): print('Installing GLPI Agent') version = control['version'].split('-',1)[0] if iswin64(): - msi = 'GLPI-Agent-1.4-x64.msi' + msi = 'GLPI-Agent-%s-x64.msi' % version else: - msi = 'GLPI-Agent-1.4-x86.msi' + msi = 'GLPI-Agent-%s-x86.msi' % version install_msi_if_needed(msi,min_version=version,properties=props) @@ -49,21 +49,23 @@ def install(): def update_package(): print('Updating GLPI Agent package') import requests,json + from waptpackage import PackageEntry latest = json.loads(requests.get('https://api.github.com/repos/glpi-project/glpi-agent/releases/latest').text.encode('utf-8')) version = latest['tag_name'] + print('Last version is %s' % version) pe = PackageEntry(); control = pe.load_control_from_wapt('.') bin_found = [] for arch in ['86','64']: for asset in latest['assets']: - if asset['name'] == 'GLPI-Agent-x%s-%s.msi' % (version, arch) and not isfile('GLPI-Agent-x%s-%s.msi' % (version, arch)): + if asset['name'] == 'GLPI-Agent-%s-x%s.msi' % (version, arch) and not isfile('GLPI-Agent-%s-x%s.msi' % (version, arch)): url = asset['browser_download_url'] print('Downloading GLPI Agent %s for x%s from %s' % (version, arch ,url)) - wget(url,'GLPI-Agent-x%s-%s.msi' % (version, arch)) + wget(url,'GLPI-Agent-%s-x%s.msi' % (version, arch)) bin_found.append(arch) - for file in glob.glob('GLPI-Agent-x*-%s.msi' % arch): - if file != 'GLPI-Agent-x%s-%s.msi' % (version, arch): + for file in glob.glob('GLPI-Agent*%s*.msi' % arch): + if file != 'GLPI-Agent-x%s-%s.msi' % (arch, version) and file != 'GLPI-Agent-%s-x%s.msi' % (version, arch): print('Removing %s' % file) remove_file(file) if Version(version) > Version(control['version'].split('-',1)[0]) and '86' in bin_found and '64' in bin_found: