mirror of
				https://github.com/GayPizzaSpecifications/darwin-apk.git
				synced 2025-11-04 07:59:38 +00:00 
			
		
		
		
	Fix compilation
This commit is contained in:
		@ -32,7 +32,7 @@ public class ApkPackageGraph {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    for (id, package) in pkgIndex.packages.enumerated() {
 | 
					    for (id, package) in pkgIndex.packages.enumerated() {
 | 
				
			||||||
      let children: [ApkIndexRequirementRef] = package.dependencies.compactMap { dependency in
 | 
					      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 {
 | 
					            let id = provides[dependency.requirement.name] else {
 | 
				
			||||||
          return nil
 | 
					          return nil
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@ -104,7 +104,7 @@ extension ApkPackageGraph {
 | 
				
			|||||||
    var working = self._nodes.reduce(into: [ApkPackageGraphNode: Set<ApkPackageGraphNode>]()) { d, node in
 | 
					    var working = self._nodes.reduce(into: [ApkPackageGraphNode: Set<ApkPackageGraphNode>]()) { d, node in
 | 
				
			||||||
      d[node] = Set(node.children.filter { child in
 | 
					      d[node] = Set(node.children.filter { child in
 | 
				
			||||||
        if case .dep(let version) = child.constraint {
 | 
					        if case .dep(let version) = child.constraint {
 | 
				
			||||||
          version != .conflict && child.packageID != node.packageID
 | 
					          !version.conflict && child.packageID != node.packageID
 | 
				
			||||||
        } else { false }
 | 
					        } else { false }
 | 
				
			||||||
      }.map { self._nodes[$0.packageID] })
 | 
					      }.map { self._nodes[$0.packageID] })
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
@ -24,7 +24,7 @@ struct ApkIndexRequirementRef {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  func normalize() -> 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 {
 | 
					extension ApkVersionSpecification.Operator: CustomStringConvertible {
 | 
				
			||||||
  var description: String {
 | 
					  var description: String {
 | 
				
			||||||
    switch self {
 | 
					    switch self {
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user