gnu: seahorse: Update to 3.34.
[jackhill/guix/guix.git] / gnu / packages / patches / ratpoison-shell.patch
1 Use $SHELL instead of hardcoding /bin/sh in ratpoison.
2
3 Patch by Mark H Weaver <mhw@netris.org>.
4
5 --- ratpoison/src/actions.c.orig 2014-09-14 16:46:08.000000000 +0200
6 +++ ratpoison/src/actions.c 2015-08-06 15:00:54.951575260 +0200
7 @@ -228,12 +228,12 @@
8 add_command ("escape", cmd_escape, 1, 1, 1,
9 "Key: ", arg_KEY);
10 add_command ("exec", cmd_exec, 1, 1, 1,
11 - "/bin/sh -c ", arg_SHELLCMD);
12 + "$SHELL -c ", arg_SHELLCMD);
13 add_command ("execa", cmd_execa, 1, 1, 1,
14 - "/bin/sh -c ", arg_SHELLCMD);
15 + "$SHELL -c ", arg_SHELLCMD);
16 add_command ("execf", cmd_execf, 2, 2, 2,
17 "frame to execute in:", arg_FRAME,
18 - "/bin/sh -c ", arg_SHELLCMD);
19 + "$SHELL -c ", arg_SHELLCMD);
20 add_command ("fdump", cmd_fdump, 1, 0, 0,
21 "", arg_NUMBER);
22 add_command ("focus", cmd_next_frame, 0, 0, 0);
23 @@ -367,7 +367,7 @@
24 add_command ("unsetenv", cmd_unsetenv, 1, 1, 1,
25 "Variable: ", arg_STRING);
26 add_command ("verbexec", cmd_verbexec, 1, 1, 1,
27 - "/bin/sh -c ", arg_SHELLCMD);
28 + "$SHELL -c ", arg_SHELLCMD);
29 add_command ("version", cmd_version, 0, 0, 0);
30 add_command ("vsplit", cmd_v_split, 1, 0, 0,
31 "Split: ", arg_STRING);
32 @@ -2671,6 +2671,9 @@
33 pid = fork();
34 if (pid == 0)
35 {
36 + char *shell_path;
37 + char *shell_name;
38 +
39 /* Some process setup to make sure the spawned process runs
40 in its own session. */
41 putenv(current_screen()->display_string);
42 @@ -2700,7 +2703,18 @@
43 /* raw means don't run it through sh. */
44 if (raw)
45 execl (cmd, cmd, (char *)NULL);
46 - execl("/bin/sh", "sh", "-c", cmd, (char *)NULL);
47 +
48 + shell_path = getenv ("SHELL");
49 + if (shell_path == NULL)
50 + shell_path = "/bin/sh";
51 +
52 + shell_name = strrchr (shell_path, '/');
53 + if (shell_name == NULL)
54 + shell_name = shell_path;
55 + else
56 + shell_name++;
57 +
58 + execl(shell_path, shell_name, "-c", cmd, (char *)NULL);
59 _exit(EXIT_FAILURE);
60 }
61
62 --- ratpoison/src/events.c.orig 2014-09-14 16:46:23.000000000 +0200
63 +++ ratpoison/src/events.c 2015-08-06 15:02:17.287578780 +0200
64 @@ -919,7 +919,7 @@
65 {
66 /* Report any child that didn't return 0. */
67 if (cur->status != 0)
68 - marked_message_printf (0,0, "/bin/sh -c \"%s\" finished (%d)",
69 + marked_message_printf (0,0, "$SHELL -c \"%s\" finished (%d)",
70 cur->cmd, cur->status);
71 list_del (&cur->node);
72 free (cur->cmd);
73 --- ratpoison/src/messages.h.orig 2014-04-09 01:22:08.000000000 +0200
74 +++ ratpoison/src/messages.h 2015-08-06 15:04:14.759583801 +0200
75 @@ -39,7 +39,7 @@
76
77 #define MESSAGE_PROMPT_SWITCH_TO_WINDOW "Switch to window: "
78 #define MESSAGE_PROMPT_NEW_WINDOW_NAME "Set window's title to: "
79 -#define MESSAGE_PROMPT_SHELL_COMMAND "/bin/sh -c "
80 +#define MESSAGE_PROMPT_SHELL_COMMAND "$SHELL -c "
81 #define MESSAGE_PROMPT_COMMAND ":"
82 #define MESSAGE_PROMPT_SWITCH_WM "Switch to wm: "
83 #define MESSAGE_PROMPT_XTERM_COMMAND MESSAGE_PROMPT_SHELL_COMMAND TERM_PROG " -e "