Version: 5

# As CMake publishes release candidates (which we usually do not want to
# package), we need to pick the location with the latest stable release, i.e,
# the "LatestRelease" directory. However, if a particular version is requested
# by --download-version, it might not be in the "LatestRelease" directory any
# more, so we *also* need to check the versioned "v\d+\.\d+" subdirectories.
#
# The following directory regex matches all the versioned directories *and*
# LatestRelease, and we mangle the version so that "LatestRelease" compares
# newer than any other version. If no particular download version is
# requested, the "LatestRelease" directory will win and give us the latest
# (stable) release.
#
# On the other hand, if a download version *is* given to uscan, the matching
# directory will win over all the others regardless of sorting order, and the
# correct directory is chosen for the matching upstream tarball.
#
Source: https://cmake.org/files/(?:v(\d+\.\d+)|LatestRelease)/
Dirversion-Mangle: s/^$/999/;
Matching-Pattern: @PACKAGE@@STABLE_VERSION@@ARCHIVE_EXT@

