From 5697bea88099fbe65cdf408c0f5cfefed9f7cbe5 Mon Sep 17 00:00:00 2001 From: yuyx <237899745@qq.com> Date: Tue, 2 Dec 2025 11:30:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20HP=E6=8F=92=E4=BB=B6=E6=94=B9=E7=94=A8?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E6=89=A7=E8=A1=8C=E6=96=B9=E5=BC=8F=EF=BC=8C?= =?UTF-8?q?=E9=81=BF=E5=85=8D=E9=9C=80=E8=A6=81.asc=E7=AD=BE=E5=90=8D?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit hp-plugin 命令需要 GPG 签名文件,改用 yes | sh 直接执行更简单 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- cups-driver-manager/driver_manager.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/cups-driver-manager/driver_manager.py b/cups-driver-manager/driver_manager.py index a81dcde..db92d83 100644 --- a/cups-driver-manager/driver_manager.py +++ b/cups-driver-manager/driver_manager.py @@ -337,15 +337,10 @@ def install_script(filepath): # HP 插件需要特殊处理(非交互式安装) if 'hplip' in filename and 'plugin' in filename: - # 方法1:尝试使用 hp-plugin 命令安装 - hp_plugin_check = run_command(['which', 'hp-plugin']) - if hp_plugin_check['success']: - result = run_command(f'hp-plugin -i -p {filepath}', shell=True) - results.append(('使用 hp-plugin 安装 HP 插件', result)) - else: - # 方法2:使用 yes 命令自动确认交互式提示 - result = run_command(f'yes | {filepath}', shell=True) - results.append(('执行 HP 插件安装脚本', result)) + # 直接执行 .run 文件,使用 yes 自动确认交互式提示 + # 注意:hp-plugin 命令需要 .asc 签名文件,比较麻烦,所以直接执行 + result = run_command(f'yes | sh {filepath}', shell=True) + results.append(('执行 HP 插件安装脚本', result)) else: # 普通脚本直接执行 result = run_command(filepath, shell=True)