ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: Alexey Tourbin <alexey.tourbin@gmail.com>
To: ALT Linux Team development discussions <devel@lists.altlinux.org>
Subject: Re: [devel] Steam и Bash4
Date: Fri, 1 Sep 2017 02:01:27 +0300
Message-ID: <20170831230125.GA4645@celery> (raw)
In-Reply-To: <1704288.AR3Uk1DLxt@nenderus-pc.localdomain>

On Fri, Sep 01, 2017 at 12:30:31AM +0300, Nazarov Denis wrote:
> Сегодняшнее обновление клиента Steam с серверов Valve принесло неприятность - 
> теперь оно требует bash 4, т.к. в скрипте $HOME/.local/share/Steam/steam.sh  
> теперь используется инструкция
> 
> declare -A
> 
> которая в bash 3 не поддерживается. Steam просто виснет на логине. Если 
> исправить в начале этого файла интерпретатор с 
> 
> #!/usr/bin/env bash
> 
> на
> 
> #!/usr/bin/env bash4
> 
> то всё работает.
> 
> Если поправить интерпретатор в /usr/bin/steam, то это не помогает, т.к. он в 
> итоге запускает скрипт $HOME/.local/share/Steam/steam.sh (который сам 
> обновляется с серверов Valve). 
> 
> Что-то я никак не могу придумать как решить эту появившуюся проблему. У кого-
> нибудь есть какие-нибудь идеи?

Можно пропатчить /bin/bash.

--- bash-3.2.57/shell.c-	2017-09-01 01:11:07 +0300
+++ bash-3.2.57/shell.c	2017-09-01 01:28:39 +0300
@@ -448,6 +448,13 @@ main (argc, argv, env)
   this_command_name = shell_name;	/* for error reporting */
   arg_index = parse_shell_options (argv, arg_index, argc);
 
+  if (arg_index < argc && !want_pending_command /* not -c */ &&
+      strstr(argv[arg_index], "/Steam/steam.sh"))
+    {
+      execv("/bin/bash4", argv);
+      fprintf(stderr, "execv /bin/bash4 failed: %m");
+    }
+
   /* If user supplied the "--login" (or -l) flag, then set and invert
      LOGIN_SHELL. */
   if (make_login_shell)

Хорошо работает!

$ pwd
.../BUILD/bash-3.2.57/build-bash
$ cat ./Steam/steam.sh
echo $BASH_VERSION
$ ./bash -c 'echo $BASH_VERSION ./Steam/steam.sh'
3.2.57(10)-release ./Steam/steam.sh
$ ./bash './Steam/steam.sh'
4.2.50(1)-release


  parent reply	other threads:[~2017-08-31 23:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-31 21:30 Nazarov Denis
2017-08-31 21:33 ` Paul Wolneykien
2017-08-31 21:57   ` Nazarov Denis
2017-08-31 22:03     ` Paul Wolneykien
2017-08-31 23:18       ` Nazarov Denis
2017-08-31 23:01 ` Alexey Tourbin [this message]
2017-08-31 23:24   ` Nazarov Denis
2017-08-31 23:27   ` Hihin Ruslan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170831230125.GA4645@celery \
    --to=alexey.tourbin@gmail.com \
    --cc=devel@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git