Add split_version function to split version, release and build parts of a package version

This commit is contained in:
Fatih Aşıcı
2010-03-08 09:26:05 +00:00
parent 813e93e702
commit 663376fbbc
+9
View File
@@ -618,6 +618,15 @@ def parse_delta_package_name(package_name):
return name, buildFrom, buildTo
def split_version(package_version):
"""Split version, release and build parts of a package version
example: 1.0.3-5-2 -> (1.0.3, 5, 2)
"""
version, sep, release_and_build = package_version.partition("-")
release, sep, build = release_and_build.partition("-")
return version, release, build
def filter_latest_packages(package_paths):
""" For a given pisi package paths list where there may also be multiple versions
of the same package, filters only the latest versioned ones """