diff --git a/installsystems/tools.py b/installsystems/tools.py index c15e189a9e59b1c1a4218333dde6c165837fce10..f69588c84cbd29c54e44a48dc254afde7338cd1f 100644 --- a/installsystems/tools.py +++ b/installsystems/tools.py @@ -505,6 +505,13 @@ def chroot(path, shell="/bin/bash", mount=True): # revert preparation of chroot unprepare_chroot(path, mount) +def is_version(version): + ''' + Check if version is valid + ''' + if re.match("^(\d+)(?:([-~+]).*)?$", version) is None: + raise TypeError("Invalid version format %s" % buf) + def compare_versions(v1, v2): ''' This function compare version :param v1: and version :param v2: