-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Compatible with printer driver which runs on V20 (#4)
- Loading branch information
1 parent
3740b1b
commit ed6e8d8
Showing
3 changed files
with
81 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
cups (2.4.2-5deepin2) unstable; urgency=medium | ||
|
||
* Compatible with printer driver which runs on V20. | ||
|
||
-- reddevillg <[email protected]> Wed, 04 Dec 2024 16:06:25 +0800 | ||
|
||
cups (2.4.2-5deepin1) unstable; urgency=medium | ||
|
||
* Fix Refactor part of server settings code. | ||
|
74 changes: 74 additions & 0 deletions
74
debian/patches/0017-Compatible-with-printer-driver-which-runs-on-V20.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
From: reddevillg <[email protected]> | ||
Date: Wed, 4 Dec 2024 15:28:30 +0800 | ||
Subject: [PATCH] Compatible with printer driver which runs on V20 | ||
|
||
If deepin-compatible-ctl exist, use it to run external process. | ||
--- | ||
scheduler/process.c | 39 +++++++++++++++++++++++++++------------ | ||
1 file changed, 27 insertions(+), 12 deletions(-) | ||
|
||
diff --git a/scheduler/process.c b/scheduler/process.c | ||
index 1492e76..7c15db5 100644 | ||
--- a/scheduler/process.c | ||
+++ b/scheduler/process.c | ||
@@ -555,30 +555,45 @@ cupsdStartProcess( | ||
if (profile) | ||
#endif /* !USE_POSIX_SPAWN */ | ||
{ | ||
+ struct stat fileinfo; | ||
+ int idx = 0; | ||
+ | ||
snprintf(cups_exec, sizeof(cups_exec), "%s/daemon/cups-exec", ServerBin); | ||
snprintf(user_str, sizeof(user_str), "%d", user); | ||
snprintf(group_str, sizeof(group_str), "%d", Group); | ||
snprintf(nice_str, sizeof(nice_str), "%d", FilterNice); | ||
|
||
- real_argv[0] = cups_exec; | ||
- real_argv[1] = (char *)"-g"; | ||
- real_argv[2] = group_str; | ||
- real_argv[3] = (char *)"-n"; | ||
- real_argv[4] = nice_str; | ||
- real_argv[5] = (char *)"-u"; | ||
- real_argv[6] = user_str; | ||
- real_argv[7] = profile ? profile : "none"; | ||
- real_argv[8] = (char *)command; | ||
+ if (!stat("/usr/bin/deepin-compatible-ctl", &fileinfo)) | ||
+ { | ||
+ real_argv[0] = (char *)"deepin-compatible-ctl"; | ||
+ real_argv[1] = (char *)"app"; | ||
+ real_argv[2] = (char *)"--ldrd"; | ||
+ real_argv[3] = (char *)"run"; | ||
+ real_argv[4] = (char *)"--"; | ||
+ idx = 5; | ||
+ exec_path = "/usr/bin/deepin-compatible-ctl"; | ||
+ } else { | ||
+ exec_path = cups_exec; | ||
+ } | ||
+ | ||
+ real_argv[idx + 0] = cups_exec; | ||
+ real_argv[idx + 1] = (char *)"-g"; | ||
+ real_argv[idx + 2] = group_str; | ||
+ real_argv[idx + 3] = (char *)"-n"; | ||
+ real_argv[idx + 4] = nice_str; | ||
+ real_argv[idx + 5] = (char *)"-u"; | ||
+ real_argv[idx + 6] = user_str; | ||
+ real_argv[idx + 7] = profile ? profile : "none"; | ||
+ real_argv[idx + 8] = (char *)command; | ||
|
||
for (i = 0; | ||
i < (int)(sizeof(real_argv) / sizeof(real_argv[0]) - 10) && argv[i]; | ||
i ++) | ||
- real_argv[i + 9] = argv[i]; | ||
+ real_argv[idx + i + 9] = argv[i]; | ||
|
||
- real_argv[i + 9] = NULL; | ||
+ real_argv[idx + i + 9] = NULL; | ||
|
||
argv = real_argv; | ||
- exec_path = cups_exec; | ||
} | ||
|
||
if (LogLevel == CUPSD_LOG_DEBUG2) | ||
-- | ||
2.45.2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters