apm_version_names_compare (public)

 apm_version_names_compare version_name_1 version_name_2

Defined in packages/acs-tcl/tcl/apm-install-procs.tcl

Compare two version names for which is earlier than the other. Example:

  • apm_version_names_compare "1.2d3" "3.5b" => -1
  • apm_version_names_compare "3.5b" "3.5b" => 0
  • apm_version_names_compare "3.5b" "1.2d3" => 1

Parameters:
version_name_1 (required)
the first version name
version_name_2 (required)
the second version name
Returns:
  • -1: the first version is smallest
  • 0: they're identical
  • 1: the second version is smallest
Author:
Lars Pind

Partial Call Graph (max 5 caller/called nodes):
%3 test_apm_version_names_compare apm_version_names_compare (test acs-tcl) apm_version_names_compare apm_version_names_compare test_apm_version_names_compare->apm_version_names_compare db_1row db_1row (public) apm_version_names_compare->db_1row Class ::xowiki::WikiForm Class ::xowiki::WikiForm (public) Class ::xowiki::WikiForm->apm_version_names_compare apm_dependency_check_new apm_dependency_check_new (public) apm_dependency_check_new->apm_version_names_compare apm_dependency_provided_p apm_dependency_provided_p (public) apm_dependency_provided_p->apm_version_names_compare apm_get_installed_provides apm_get_installed_provides (public) apm_get_installed_provides->apm_version_names_compare apm_git_build_repository apm_git_build_repository (private) apm_git_build_repository->apm_version_names_compare

Testcases:
apm_version_names_compare
Source code:
    #
    # This function is stable (returns always the same results for the
    # same input) and called with only a few different input
    # values. By using acs::per_thread_cache the performance improves
    # from 265 microseconds to 2 microseconds;
    #
    return [acs::per_thread_cache eval -key acs-tcl.apm_version_names_compare($version_name_1,$version_name_2) {
        db_1row select_sortable_versions {}
        string compare $sortable_version_1 $sortable_version_2
    }]
Generic XQL file:
packages/acs-tcl/tcl/apm-install-procs.xql

PostgreSQL XQL file:
<fullquery name="apm_version_names_compare.select_sortable_versions">
    <querytext>
      
	    select apm_package_version__sortable_version_name(:version_name_1) as sortable_version_1,
                   apm_package_version__sortable_version_name(:version_name_2) as sortable_version_2
            from   dual

      </querytext>
</fullquery>
packages/acs-tcl/tcl/apm-install-procs-postgresql.xql

Oracle XQL file:
<fullquery name="apm_version_names_compare.select_sortable_versions">
    <querytext>
      
	    select apm_package_version.sortable_version_name(:version_name_1) as sortable_version_1,
                   apm_package_version.sortable_version_name(:version_name_2) as sortable_version_2
            from   dual
	
      </querytext>
</fullquery>
packages/acs-tcl/tcl/apm-install-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: