diff options
| author | Jeff McCune <jeff@puppetlabs.com> | 2011-08-09 16:29:34 -0700 |
|---|---|---|
| committer | Jeff McCune <jeff@puppetlabs.com> | 2011-08-09 16:29:34 -0700 |
| commit | 4ab915a02a6ce80d74ba404c46bda4cb03995ff6 (patch) | |
| tree | 21c9ba6091bee3632d67babb4f7be176d37a579d /lib/puppet/parser | |
| parent | 6d1418ca7069816353356db960fbeee623451856 (diff) | |
| parent | 76d45d22ad134d73e4a2b9b8abbc1955784c0a93 (diff) | |
| download | puppet-4ab915a02a6ce80d74ba404c46bda4cb03995ff6.tar.gz puppet-4ab915a02a6ce80d74ba404c46bda4cb03995ff6.tar.xz puppet-4ab915a02a6ce80d74ba404c46bda4cb03995ff6.zip | |
Merge pull request #24 from nfagerlund/maint/2.7.x/misc_doc_fixes
Merge branch 'maint/2.7.x/misc_doc_fixes' into 2.7.x
* maint/2.7.x/misc_doc_fixes:
(#7853) Clarify and complete docs for the tagmail report processor
Maint: Mention that audit metaparameter will accept "all"
Maint: Adjust wording for file type's content parameter
Maint: Fix poor documentation for versioncmp function.
Diffstat (limited to 'lib/puppet/parser')
| -rw-r--r-- | lib/puppet/parser/functions/versioncmp.rb | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/puppet/parser/functions/versioncmp.rb b/lib/puppet/parser/functions/versioncmp.rb index 6091e0923..a06866876 100644 --- a/lib/puppet/parser/functions/versioncmp.rb +++ b/lib/puppet/parser/functions/versioncmp.rb @@ -4,19 +4,19 @@ require 'puppet/util/package' Puppet::Parser::Functions::newfunction( :versioncmp, :type => :rvalue, - :doc => "Compares two versions + :doc => "Compares two version numbers. Prototype: \$result = versioncmp(a, b) -Where a and b are arbitrary version strings +Where a and b are arbitrary version strings. -This functions returns a number: +This function returns: -* Greater than 0 if version a is greater than version b -* Equal to 0 if both version are equals -* Less than 0 if version a is less than version b +* `1` if version a is greater than version b +* `0` if the versions are equal +* `-1` if version a is less than version b Example: @@ -24,6 +24,9 @@ Example: notice('2.6-1 is > than 2.4.5') } +This function uses the same version comparison algorithm used by Puppet's +`package` type. + ") do |args| unless args.length == 2 |
