Files
darwin-apk/Sources/apk/Index/ApkIndexDependency.swift
a dinosaur e7fc47d640 make ApkIndexDependency conform to ApkIndexRequirementRef
dunno if this is necessary for the graph to work but we'll see
2024-11-10 21:00:07 +11:00

27 lines
606 B
Swift

/*
* darwin-apk © 2024 Gay Pizza Specifications
* SPDX-License-Identifier: Apache-2.0
*/
import Foundation
struct ApkIndexDependency: ApkIndexRequirementRef {
let name: String
let versionSpec: ApkVersionSpecification
init(name: String, version spec: ApkVersionSpecification) {
self.name = name
self.versionSpec = spec
}
}
extension ApkIndexDependency: CustomStringConvertible {
var description: String {
switch self.versionSpec {
case .any: self.name
case .conflict: "!\(self.name)"
case .constraint(let op, let version): "\(self.name)\(op)\(version)"
}
}
}