software_center_download: Add option to search for latest packages #28
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Managing SAP Software lists is difficult because of frequent changes file changes, new patches and file retirements.
#24 was raised to add new parameter that will drive search logic to find new packages, if requested package is not available anymore.
Changes
softwarecenter_search_queryand introduce new clearer parametersearch_query. Deprecated variable is still compatible.Deprecatedestand introduce clearer parameterdownload_path.destis not backwards compatible, asdownload_pathis required parameter.Change reverted by later PR #34, prior to releasesearch_alternativesasbooleanthat will drive logic for searching usingsearch_queryS4CORE105_INST_EXPORT_1.zipcan be downloaded as19118000000000004323.dry_runcode with better output messages.Logic for search_alternatives:
Search for file using
search_queryand filter usingTitleorDescription(unchanged)Trigger
search_alternativesblock instead of failing which will:10012328inside ofIMDB_AFL100_010P_41-10012328.SARwhich is unique combination of Product and Platform, but it can span different versions and revisions)NOTE SAP CD Media does not contain ID, so we cannot run fuzzy search for latest as it would change actual Product, therefore failure is expected.
Attempt to filter fuzzy search results:
IMDB_SERVER20_06forIMDB_SERVER20_067_4-80002046.SARwhich isSPS06Sort resulting list (descending order) using new function for processing integer to resolve issue with string sorting, where 700 is higher than 3500.
Return
[0]from sorted list back for downloading.Test Example
New module was tested across wide range of packages, with most of them were adjusted to fail to trigger new functionality.
Test results
Test results show handling for packages above.