[packages/google-chrome] - set variables that binary wants (now google chrome correctly detects channel and enables more feat

arekm arekm at pld-linux.org
Thu Jan 26 20:21:01 CET 2017


commit 3594c02f4ac267c6e7dae203e7577ba80659ee9a
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Thu Jan 26 20:20:51 2017 +0100

    - set variables that binary wants (now google chrome correctly detects channel and enables more features (cryptic ids of features are listed in chrome://version Variations); sanitize stdin/out/err (needs bash)

 google-chrome.sh   | 18 ++++++++++++++++--
 google-chrome.spec |  2 ++
 2 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/google-chrome.spec b/google-chrome.spec
index 84062c3..f0e2021 100644
--- a/google-chrome.spec
+++ b/google-chrome.spec
@@ -118,6 +118,8 @@ install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name}/plugins,%{_mandir}/man1
 	$RPM_BUILD_ROOT%{_datadir}/%{name}/extensions
 
 install -p %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/%{name}
+sed -i -e 's#RPM_STATE#%{state}#g' $RPM_BUILD_ROOT%{_bindir}/%{name}
+
 %{__sed} -i -e 's, at libdir@,%{_libdir}/%{name},' $RPM_BUILD_ROOT%{_bindir}/%{name}
 cp -a chrome%{?gcsuffix}/* $RPM_BUILD_ROOT%{_libdir}/%{name}
 cp -p google-chrome%{?gcsuffix}.1 $RPM_BUILD_ROOT%{_mandir}/man1/google-chrome.1
diff --git a/google-chrome.sh b/google-chrome.sh
index 58a4127..8d1e1c0 100755
--- a/google-chrome.sh
+++ b/google-chrome.sh
@@ -1,9 +1,12 @@
-#!/bin/sh
+#!/bin/bash
 
 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
+# Let the wrapped binary know that it has been run through the wrapper.
+export CHROME_WRAPPER=$(readlink -f "$0")
+
 # Always use our ffmpeg libs.
 # Also symlinks for nss/nspr libs can be found from our dir.
 export LD_LIBRARY_PATH=@libdir@${LD_LIBRARY_PATH:+:"$LD_LIBRARY_PATH"}
@@ -11,6 +14,17 @@ export LD_LIBRARY_PATH=@libdir@${LD_LIBRARY_PATH:+:"$LD_LIBRARY_PATH"}
 # for to find xdg-settings
 export PATH=@libdir@${PATH:+:"$PATH"}
 
+export CHROME_VERSION_EXTRA="RPM_STATE"
+
+# We don't want bug-buddy intercepting our crashes. http://crbug.com/24120
+export GNOME_DISABLE_CRASH_DIALOG=SET_BY_GOOGLE_CHROME
+
+# Sanitize std{in,out,err} because they'll be shared with untrusted child
+# processes (http://crbug.com/376567).
+exec < /dev/null
+exec > >(exec cat)
+exec 2> >(exec cat >&2)
+
 # chrome needs /dev/shm being mounted
 m=$(awk '$2 == "/dev/shm" && $3 == "tmpfs" {print}' /proc/mounts)
 if [ -z "$m" ]; then
@@ -23,4 +37,4 @@ if [ -z "$m" ]; then
 	EOF
 fi
 
-exec @libdir@/chrome "$@"
+exec -a "$0" @libdir@/chrome "$@"
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/google-chrome.git/commitdiff/3594c02f4ac267c6e7dae203e7577ba80659ee9a



More information about the pld-cvs-commit mailing list