Skip to content

Add a function to compare two versions using zypper versioncmp#25029

Draft
DeepthiYV wants to merge 1 commit intoos-autoinst:masterfrom
DeepthiYV:zypper_package_cmp
Draft

Add a function to compare two versions using zypper versioncmp#25029
DeepthiYV wants to merge 1 commit intoos-autoinst:masterfrom
DeepthiYV:zypper_package_cmp

Conversation

@DeepthiYV
Copy link
Contributor

@DeepthiYV DeepthiYV commented Mar 19, 2026

@github-actions
Copy link

Great PR! Please pay attention to the following items before merging:

Files matching lib/**.pm:

  • Consider adding or extending unit tests in t/

This is an automatically generated QA checklist based on modified files.

@DeepthiYV DeepthiYV requested review from dzedro and rfan1 and removed request for dzedro March 19, 2026 12:53
@DeepthiYV DeepthiYV marked this pull request as draft March 19, 2026 13:16

chomp($output);

if ($output =~ /older than/) {
Copy link
Contributor

@rfan1 rfan1 Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git-host:~/data/os-autoinst-distri-opensuse # zypper vcmp  0.15.3 0.15.3-2
0.15.3 is older than 0.15.3-2
git-host:~/data/os-autoinst-distri-opensuse # zypper vcmp  0.15.4 0.15.3-2
0.15.4 is newer than 0.15.3-2
git-host:~/data/os-autoinst-distri-opensuse # zypper vcmp  0.15.4 0.15.4
0.15.4 matches 0.15.4

matches when the pkg version is the same :)

return -1;
} elsif ($output =~ /newer than/) {
return 1;
} elsif ($output =~ /the same as/) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

elsif ($output =~ /matches)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants