You are looking at historical revision 23981 of this page. It may differ significantly from its current revision.

versions

Introduction

This extension provides procedures for handling versioning of arbitrary packages. It should simplify determining when new packages are available based on some string containing version data. This should, hopefully, make life easier for maintainers.

Version Strings

Version strings have the following format:

[LABEL][MAJOR][MINOR][MICRO][PATCH][EXTRA]

MAJOR, MINOR, MICRO (if given), and all segments of PATCH (if given) must be separated by dots (.). The version strings have the following semantics:

[any chars]
Segment Required? Format Description
LABEL no [any chars] Any characters, including digits, are allowed. If the LABEL ends with a digit character, some separator character BESIDES . is required; otherwise, the end of LABEL will be parsed as the MAJOR value. The LABEL segment usually corresponds to the name of the package.
MAJOR yes [integer] Major release version.
MINOR yes [integer] Minor release version.
MICRO no [integer] Micro release version.
PATCH no ([integer])... Patch version. This may be composed of any number of segments; there is no limit. (This is to allow parsing of version control tree versions.)
EXTRA no Extra version suffix, usually for local or maintainer versions. It must be separated from the final element by a non-digit, non-dot character.

Version Records

[record] version
[procedure] (make-version MAJOR MINOR #!key (label #f) (micro #f) (patch #f) (extra #f))

Creates a new version record with the given components. MAJOR, MINOR, and MICRO (if given) must be exact non-negative integers. LABEL and EXTRA, if given, must be non-null strings. PATCH (if given) must be either a non-negative exact integer or a list/vector composed of non-negative exact integers.

[procedure] (version? OBJ)

Returns #t if OBJ is a version record.

[procedure] (version:label VERSION)
[procedure] (version:major VERSION)
[procedure] (version:minor VERSION)
[procedure] (version:micro VERSION)
[procedure] (version:patch VERSION)
[procedure] (version:extra VERSION)
Returns the specified field of the VERSION record.