Skip to content

armgit / peel

Public Imported from GitHub
0

Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.

Intel Software looks at TWAIN data sources

Țugui Dragoșfec189cd6077
diff --git a/Packages/PeelCore/Sources/PeelCore/Apps/IntelInspector.swift b/Packages/PeelCore/Sources/PeelCore/Apps/IntelInspector.swift
index 1fb6bf0a..b9a4fe57 100644
--- a/Packages/PeelCore/Sources/PeelCore/Apps/IntelInspector.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Apps/IntelInspector.swift
@@ -256,7 +256,8 @@ public enum IntelInspector {
return candidates.first { FileManager.default.isExecutableFile(atPath: $0.path(percentEncoded: false)) }
}
- static let driverExtensions: Set<String> = ["app", "plugin", "bundle", "driver", "qlgenerator", "mdimporter"]
+ /// `ds` is a TWAIN data source, which Apple's Technical Note TN2088 puts in `Image Capture/TWAIN Data Sources`.
+ static let driverExtensions: Set<String> = ["app", "plugin", "bundle", "driver", "qlgenerator", "mdimporter", "ds"]
static func bundles(in directories: [String]) -> [URL] {
directories.flatMap { directory -> [URL] in
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/IntelInspectorTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/IntelInspectorTests.swift
index 8f1d806e..5e9dda27 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/IntelInspectorTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/IntelInspectorTests.swift
@@ -102,6 +102,26 @@ struct IntelInspectorTests {
#expect(scan.findings.allSatisfy { $0.kind == .driver })
}
+ @Test func findsAnIntelTWAINDataSource() async throws {
+ let directory = try TemporaryDirectory()
+ _ = try bundle(directory, "root/Library/Image Capture/TWAIN Data Sources/Scanner.ds", cpuTypes: [intel])
+
+ let scan = await IntelInspector.scan(
+ installedApps: [],
+ plugins: [],
+ backgroundItems: [],
+ exclusions: .none,
+ environment: SearchEnvironment(
+ homeDirectory: directory.url.appending(path: "home", directoryHint: .isDirectory),
+ rootDirectory: directory.url.appending(path: "root", directoryHint: .isDirectory)
+ ),
+ measure: { _ in 1 }
+ )
+
+ #expect(scan.findings.map(\.name) == ["Scanner.ds"])
+ #expect(scan.findings.allSatisfy { $0.kind == .driver })
+ }
+
@Test func findsTheIntelProgramsAPrinterDriverKeeps() async throws {
let directory = try TemporaryDirectory()
let vendor = "root/Library/Printers/Vendor"