Uninstalling an old version of Java

Questions about WAPT Packaging / Requests and help regarding Wapt packages.
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Locked
Dylan
Messages: 20
Registration: June 9, 2016 - 10:28

June 12, 2017 - 11:50

Good morning,

It doesn't seem complicated, and with Simon's help I was able to uninstall older versions of Thunderbird.

I'm using WAPT-fixup with these lines of code

Code: Select all

def install():
    prefixpkg = control.package.split('-',1)[0]
    java8 = WAPT.is_installed('%s-java8'% prefixpkg)
    if java8 and Version(java8.version) == Version('8.121-24'):
        WAPT.remove(java8.package)
        WAPT.install('%s-java8'% prefixpkg)
My goal is to uninstall only version 8.121. When I run the debugger, I get a NameError: global name 'Version' in not defined. I conclude that, as far as it's concerned, the version is not defined.

Any idea what the problem is?
User avatar
agauvrit
WAPT Expert
Messages: 238
Registration: Nov 17, 2016 - 10:25
Location: Nantes
Contact :

June 12, 2017 - 3:26 PM

The class Version which is used to compare software version numbers has recently moved to a different file in WAPT, during execution there are no problems, but during debugging it gets stuck.

Which version of the agent are you using?

The version class is now located in the waptutils file (C:\wapt\waptutils.py)

Try importing the library like this:

Code: Select all

from waptutils import *
Dylan
Messages: 20
Registration: June 9, 2016 - 10:28

June 12, 2017 - 4:46 PM

Good morning,

Thank you for the reply.
The agent and console are in version 1.3.12.13.

No, unfortunately, it's not just the debugging that's stuck; the uninstallation doesn't work either.

I don't know where I should insert this line of code

Code: Select all

from waptutils import *
Is it in the setup.py file?

For your information, I don't have a C:\WAPT\waptutils.py file, but I do have a C:\WAPT\waptdevutils.py file, and it contains quite a bit of information. I'm trying to modify the file and adding the following line of code:

Code: Select all

from waptutils import *
.... ;)

Update: Well, it was a bad idea to try and mess with C:\WAPT\waptdevutils.py, so I put it back to how it was originally.
I'm no further ahead; I still can't uninstall the old versions of Java 8.121 :roll:
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

June 21, 2017 - 00:26

Sorry, I'm really struggling to resolve the issue.

Could you try version 1.3.12.15?
Locked