Swift implementation of robust dpkg semi-semantic version management.
- Parse Debian package version strings (epoch:version-revision format)
- Validate version strings according to Debian policy
- Compare version strings using the same algorithm as
dpkg - Written in pure Swift with no dependencies
Add the following to your Package.swift file:
dependencies: [
.package(url: "https://github.com/Lakr233/DpkgVersion.git", from: "1.0.0")
]Then import the library in your Swift file:
import DpkgVersionimport DpkgVersion
#expect(Version.compare("1.0.0", "1.0.0+1") < 0)
#expect(Version.compare("1.0.0+2", "1.0.0+1") > 0)
#expect(Version.compare("1.0.0+", "1.0.0+") == 0)This project is licensed under the MIT License - see the LICENSE file for details.
Copyright © 2025 Lakr Aream, All rights reserved.