chocolatey / choco

Chocolatey - the package manager for Windows
https://chocolatey.org
Other
10.26k stars 900 forks source link

Choco list/find is showing inconsistent version than what's in the package #3415

Closed VishnuJin closed 6 months ago

VishnuJin commented 6 months ago

Checklist

What You Are Seeing?

For example - https://community.chocolatey.org/packages/DotNet4.6-TargetPack#versionhistory latest version of DotNet4.6-TargetPack is shown as 4.6.00081.20150925 in WebUi but choco list just shows

DotNet4.6-TargetPack 4.6.81.20150925

What is Expected?

also output DotNet4.6-TargetPack 4.6.00081.20150925

How Did You Get This To Happen?

  1. I ran choco find -e DotNet4.6-TargetPack

System Details

Installed Packages

N/A

Output Log

Chocolatey v2.2.2
Chocolatey is running on Windows v 10.0.19045.0
Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".
Attempting to delete file "C:\ProgramData\chocolatey\choco.exe.old".
Command line: "C:\ProgramData\chocolatey\choco.exe" find -e DotNet4.6-TargetPack -s https://community.chocolatey.org/api/v2/ --debug --verbose
Received arguments: find -e DotNet4.6-TargetPack -s https://community.chocolatey.org/api/v2/ --debug --verbose
RemovePendingPackagesTask is now ready and waiting for PreRunMessage.
Sending message 'PreRunMessage' out if there are subscribers...
[Pending] Removing all pending packages that should not be considered installed...
Performing validation checks.
Global Configuration Validation Checks:
 - Package Exit Code / Exit On Reboot = Checked
System State Validation Checks:
 Reboot Requirement Checks:
 - Pending Computer Rename = Checked
 - Pending Component Based Servicing = Checked
 - Pending Windows Auto Update = Checked
 - Pending File Rename Operations = Checked
 - Pending Windows Package Installer = Checked
 - Pending Windows Package Installer SysWow64 = Checked
Cache Folder Lockdown Checks:
 - Elevated State = Checked
 - Folder Exists = Checked
 - Folder lockdown = Checked
The source 'https://community.chocolatey.org/api/v2/' evaluated to a 'normal' source type

NOTE: Hiding sensitive configuration data! Please double and triple
 check to be sure no sensitive data is shown, especially if copying
 output to a gist for review.
Configuration: CommandName='find'|
CacheLocation='C:\Users\CKT2KOR\AppData\Local\Temp\chocolatey'|
CommandExecutionTimeoutSeconds='2700'|WebRequestTimeoutSeconds='30'|
Sources='https://community.chocolatey.org/api/v2/'|SourceType='normal'|
ShowOnlineHelp='False'|Debug='True'|Verbose='True'|Trace='False'|
Force='False'|Noop='False'|HelpRequested='False'|
UnsuccessfulParsing='False'|RegularOutput='True'|QuietOutput='False'|
PromptForConfirmation='True'|DisableCompatibilityChecks='False'|
AcceptLicense='False'|AllowUnofficialBuild='False'|
Input='DotNet4.6-TargetPack'|AllVersions='False'|
SkipPackageInstallProvider='False'|SkipHookScripts='False'|
Prerelease='False'|ForceX86='False'|OverrideArguments='False'|
NotSilent='False'|ApplyPackageParametersToDependencies='False'|
ApplyInstallArgumentsToDependencies='False'|IgnoreDependencies='False'|
CacheExpirationInMinutes='30'|AllowDowngrade='False'|
ForceDependencies='False'|PinPackage='False'|
Information.PlatformType='Windows'|
Information.PlatformVersion='10.0.19045.0'|
Information.PlatformName='Windows 10'|
Information.ChocolateyVersion='2.2.2.0'|
Information.ChocolateyProductVersion='2.2.2'|
Information.FullName='choco, Version=2.2.2.0, Culture=neutral, PublicKeyToken=79d02ea9cad655eb'|

Information.Is64BitOperatingSystem='True'|
Information.Is64BitProcess='True'|Information.IsInteractive='True'|
Information.UserName='ckt2kor'|Information.UserDomainName='APAC'|
Information.IsUserAdministrator='True'|
Information.IsUserSystemAccount='False'|
Information.IsUserRemoteDesktop='False'|
Information.IsUserRemote='True'|
Information.IsProcessElevated='True'|
Information.IsLicensedVersion='False'|
Information.IsLicensedAssemblyLoaded='False'|
Information.LicenseType='Foss'|
Information.CurrentDirectory='C:\Windows\system32'|
Features.AutoUninstaller='True'|Features.ChecksumFiles='True'|
Features.AllowEmptyChecksums='False'|
Features.AllowEmptyChecksumsSecure='True'|
Features.FailOnAutoUninstaller='False'|
Features.FailOnStandardError='False'|Features.UsePowerShellHost='True'|
Features.LogEnvironmentValues='False'|Features.LogWithoutColor='False'|
Features.VirusCheck='False'|
Features.FailOnInvalidOrMissingLicense='False'|
Features.IgnoreInvalidOptionsSwitches='True'|
Features.UsePackageExitCodes='True'|
Features.UseEnhancedExitCodes='False'|
Features.UseFipsCompliantChecksums='False'|
Features.ShowNonElevatedWarnings='True'|
Features.ShowDownloadProgress='True'|
Features.StopOnFirstPackageFailure='False'|
Features.UseRememberedArgumentsForUpgrades='False'|
Features.IgnoreUnfoundPackagesOnUpgradeOutdated='False'|
Features.SkipPackageUpgradesWhenNotInstalled='False'|
Features.RemovePackageInformationOnUninstall='False'|
Features.ExitOnRebootDetected='False'|
Features.LogValidationResultsOnWarnings='True'|
Features.UsePackageRepositoryOptimizations='True'|
ListCommand.LocalOnly='False'|ListCommand.IdOnly='False'|
ListCommand.IncludeRegistryPrograms='False'|ListCommand.PageSize='25'|
ListCommand.Exact='True'|ListCommand.ByIdOnly='False'|
ListCommand.ByTagOnly='False'|ListCommand.IdStartsWith='False'|
ListCommand.OrderByPopularity='False'|ListCommand.ApprovedOnly='False'|
ListCommand.DownloadCacheAvailable='False'|
ListCommand.NotBroken='False'|
ListCommand.IncludeVersionOverrides='False'|
ListCommand.ExplicitPageSize='False'|
ListCommand.ExplicitSource='False'|
UpgradeCommand.FailOnUnfound='False'|
UpgradeCommand.FailOnNotInstalled='False'|
UpgradeCommand.NotifyOnlyAvailableUpgrades='False'|
UpgradeCommand.ExcludePrerelease='False'|
NewCommand.AutomaticPackage='False'|
NewCommand.UseOriginalTemplate='False'|SourceCommand.Command='unknown'|
SourceCommand.Priority='0'|SourceCommand.BypassProxy='False'|
SourceCommand.AllowSelfService='False'|
SourceCommand.VisibleToAdminsOnly='False'|
FeatureCommand.Command='unknown'|ConfigCommand.Command='Unknown'|
ApiKeyCommand.Command='Unknown'|PinCommand.Command='Unknown'|
OutdatedCommand.IgnorePinned='False'|
ExportCommand.IncludeVersionNumbers='False'|Proxy.BypassOnLocal='True'|
TemplateCommand.Command='unknown'|CacheCommand.Command='Unknown'|
CacheCommand.RemoveExpiredItemsOnly='False'|
_ Chocolatey:ChocolateySearchCommand - Normal Run Mode _
Searching for package information
Running list with the following filter = 'DotNet4.6-TargetPack'
--- Start of List ---
Resolving resource ListResource for source https://community.chocolatey.org/api/v2/
[NuGet]   CACHE https://community.chocolatey.org/api/v2/$metadata
[NuGet]   CACHE https://community.chocolatey.org/api/v2/Packages()?$filter=(tolower(Id)%20eq%20'dotnet4.6-targetpack')%20and%20IsLatestVersion&semVerLevel=2.0.0
DotNet4.6-TargetPack 4.6.81.20150925 [Approved] - Possibly broken
 Title: Microsoft .NET Framework 4.6 Targeting Pack | Published: 26/09/2015
 Package approved by jberezanski on Sep 28 2015 08:44:35.
 Package testing status: Failing on Jan 01 0001 00:00:00.
 Number of Downloads: 188817 | Downloads for this version: 188700
 Package url https://community.chocolatey.org/packages/DotNet4.6-TargetPack/4.6.00081.20150925
 Chocolatey Package Source: https://github.com/jivkok/Chocolatey-Packages/tree/master/DotNet4.6-TargetPack
 Package Checksum: 'An7bZlomjQE1ueKRMvWHTWeiCddIuMaMUXQSeAgfF74WTS3lAtqdEqzzRxRY8pVn0pi51+NS5gSDYC01tB4aQg==' (SHA512)
 Tags: microsoft .net framework 4.6 developer target pack
 Software Site: http://www.microsoft.com/en-us/download/details.aspx?id=48136
 Software License: http://msdn.microsoft.com/en-US/cc300389.aspx
 Summary: Microsoft .NET Framework 4.6 Targeting Pack
 Description: The .NET Framework 4.6 Targeting Pack is a package that enables developers to build applications targeting the .NET Framework 4.6 using either Visual Studio 2013, Visual Studio 2012 or third party IDEs.

  Restart requirement - you may have to restart the computer after you install this package. It is recommended that you close all applications that are using the .NET Framework before installing this package.

--- End of List ---
1 packages found.
Sending message 'PostRunMessage' out if there are subscribers...
Exiting with 0

Additional Context

No response

pauby commented 6 months ago

The version numbers in Chocolatey CLI are normalized when returning them. In Semver v2, leading zeroes are removed from version number 'parts', so 4.6.00081.20150925 becomes 4.6.81.20150925.

In previous versions of Chocolatey CLI (pre 2.x), the version number provided would be the version number used (so if you had zeroes in your version number, it would be used on the Chocolatey Community Repository).

In 2.x versions of Chocolatey, if you provide a version number with leading zeroes in your package, it will be normalized to remove them. So when it is submitted to the Chocolatey Community Repository, those zeroes will not be there.

Because of the age of that package (it was submitted on 26 September 2015), it was submitted with a pre 2.x version of Chocolatey CLI, it uses the package version with leading zeroes.

We do some work behind the scenes to ensure that we can match those versions when you are managing or searching for packages.

I'm going to go ahead and close this as there is nothing for us to do here.