mirror of
				https://github.com/GayPizzaSpecifications/darwin-apk.git
				synced 2025-11-03 15:49:37 +00:00 
			
		
		
		
	Fix compilation
This commit is contained in:
		@ -32,7 +32,7 @@ public class ApkPackageGraph {
 | 
			
		||||
 | 
			
		||||
    for (id, package) in pkgIndex.packages.enumerated() {
 | 
			
		||||
      let children: [ApkIndexRequirementRef] = package.dependencies.compactMap { dependency in
 | 
			
		||||
        guard dependency.requirement.versionSpec != .conflict,
 | 
			
		||||
        guard !dependency.requirement.versionSpec.conflict,
 | 
			
		||||
            let id = provides[dependency.requirement.name] else {
 | 
			
		||||
          return nil
 | 
			
		||||
        }
 | 
			
		||||
@ -104,7 +104,7 @@ extension ApkPackageGraph {
 | 
			
		||||
    var working = self._nodes.reduce(into: [ApkPackageGraphNode: Set<ApkPackageGraphNode>]()) { d, node in
 | 
			
		||||
      d[node] = Set(node.children.filter { child in
 | 
			
		||||
        if case .dep(let version) = child.constraint {
 | 
			
		||||
          version != .conflict && child.packageID != node.packageID
 | 
			
		||||
          !version.conflict && child.packageID != node.packageID
 | 
			
		||||
        } else { false }
 | 
			
		||||
      }.map { self._nodes[$0.packageID] })
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -24,7 +24,7 @@ struct ApkIndexRequirementRef {
 | 
			
		||||
  }
 | 
			
		||||
  
 | 
			
		||||
  func normalize() -> ApkIndexRequirementRef {
 | 
			
		||||
    .init(self._graph!, id: self.packageID, constraint: .dep(version: .any))
 | 
			
		||||
    .init(self._graph!, id: self.packageID, constraint: .dep(version: .any()))
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -21,6 +21,17 @@ extension ApkVersionSpecification {
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
internal extension ApkVersionSpecification {
 | 
			
		||||
  @inlinable var conflict: Bool {
 | 
			
		||||
    switch self {
 | 
			
		||||
    case .any(invert: true), .constraint(invert: true, _, _):
 | 
			
		||||
      return true
 | 
			
		||||
    default:
 | 
			
		||||
      return false
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
extension ApkVersionSpecification.Operator: CustomStringConvertible {
 | 
			
		||||
  var description: String {
 | 
			
		||||
    switch self {
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user