[Libreoffice-commits] core.git: shell/Package_scripts_kde.mk shell/Package_scripts.mk shell/Package_scripts_tde.mk shell/source sysui/desktop

Bryan Quigley gquigs at gmail.com
Wed Mar 2 16:19:49 UTC 2016


 shell/Package_scripts.mk                   |    2 
 shell/Package_scripts_kde.mk               |    4 -
 shell/Package_scripts_tde.mk               |    4 -
 shell/source/unix/exec/shellexec.cxx       |   47 --------------
 shell/source/unix/misc/kde4-open-url.sh    |   21 ------
 shell/source/unix/misc/open-url.sh         |   96 -----------------------------
 shell/source/unix/misc/tde-open-url.sh     |   25 -------
 sysui/desktop/apparmor/program.open-url    |   30 ---------
 sysui/desktop/apparmor/program.soffice.bin |    2 
 9 files changed, 3 insertions(+), 228 deletions(-)

New commits:
commit cafd3adcbaa6714dc3674788401cf0f58fbbcb5e
Author: Bryan Quigley <gquigs at gmail.com>
Date:   Wed Jan 6 15:11:09 2016 -0500

    Just use xdg-open
    
    Remove kde4/tde/open-url.sh and have LO just use xdg-open.
    It's available on TDE builds as well as any recent KDE.  We recently
    did this just for gnome-open-url and have had no reported issues.
    
    Change-Id: I4e1ee6caef368051af92023fa382b6fed9d9397e
    Reviewed-on: https://gerrit.libreoffice.org/21173
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>

diff --git a/shell/Package_scripts.mk b/shell/Package_scripts.mk
index 1b310ca..6962fe5 100644
--- a/shell/Package_scripts.mk
+++ b/shell/Package_scripts.mk
@@ -9,6 +9,4 @@
 
 $(eval $(call gb_Package_Package,shell_scripts,$(SRCDIR)/shell/source/unix/misc))
 
-$(eval $(call gb_Package_add_file,shell_scripts,$(LIBO_BIN_FOLDER)/open-url,open-url.sh))
-
 # vim: set shiftwidth=4 tabstop=4 noexpandtab:
diff --git a/shell/Package_scripts_kde.mk b/shell/Package_scripts_kde.mk
index b9168d6..4dc1cf5 100644
--- a/shell/Package_scripts_kde.mk
+++ b/shell/Package_scripts_kde.mk
@@ -9,8 +9,4 @@
 
 $(eval $(call gb_Package_Package,shell_scripts_kde,$(SRCDIR)/shell/source/unix/misc))
 
-ifeq ($(ENABLE_KDE4),TRUE)
-$(eval $(call gb_Package_add_file,shell_scripts_kde,$(LIBO_BIN_FOLDER)/kde4-open-url,kde4-open-url.sh))
-endif
-
 # vim: set shiftwidth=4 tabstop=4 noexpandtab:
diff --git a/shell/Package_scripts_tde.mk b/shell/Package_scripts_tde.mk
index 0d1111f..d73d824 100644
--- a/shell/Package_scripts_tde.mk
+++ b/shell/Package_scripts_tde.mk
@@ -9,8 +9,4 @@
 
 $(eval $(call gb_Package_Package,shell_scripts_tde,$(SRCDIR)/shell/source/unix/misc))
 
-ifeq ($(ENABLE_TDE),TRUE)
-$(eval $(call gb_Package_add_file,shell_scripts_tde,$(LIBO_BIN_FOLDER)/tde-open-url,tde-open-url.sh))
-endif
-
 # vim: set shiftwidth=4 tabstop=4 noexpandtab:
diff --git a/shell/source/unix/exec/shellexec.cxx b/shell/source/unix/exec/shellexec.cxx
index 7dadfd2..89481bf 100644
--- a/shell/source/unix/exec/shellexec.cxx
+++ b/shell/source/unix/exec/shellexec.cxx
@@ -153,52 +153,9 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, const OUString& aPar
         //  the CWD) on stderr and SystemShellExecuteException.
         aBuffer.append("open --");
 #else
-        // The url launchers are expected to be in the $BRAND_BASE_DIR/LIBO_LIBEXEC_FOLDER
-        // directory:
-        css::uno::Reference< css::util::XMacroExpander > exp = css::util::theMacroExpander::get(m_xContext);
-        OUString aProgramURL;
-        try {
-            aProgramURL = exp->expandMacros( "$BRAND_BASE_DIR/" LIBO_LIBEXEC_FOLDER "/");
-        } catch (css::lang::IllegalArgumentException &)
-        {
-            throw SystemShellExecuteException(
-                "Could not expand $BRAND_BASE_DIR path",
-                static_cast < XSystemShellExecute * > (this), ENOENT );
-        }
-
-        OUString aProgram;
-        if ( FileBase::E_None != FileBase::getSystemPathFromFileURL(aProgramURL, aProgram))
-        {
-            throw SystemShellExecuteException(
-                "Cound not convert executable path",
-                static_cast < XSystemShellExecute * > (this), ENOENT );
-        }
-
-        OString aTmp = OUStringToOString(aProgram, osl_getThreadTextEncoding());
-        escapeForShell(aBuffer, aTmp);
-
-#ifdef SOLARIS
-        if ( m_aDesktopEnvironment.getLength() == 0 )
-             m_aDesktopEnvironment = OString("GNOME");
-#endif
-
-        // Respect the desktop environment - if there is an executable named
-        // <desktop-environement-is>-open-url, pass the url to this one instead
-        // of the default "open-url" script.
-        if ( !m_aDesktopEnvironment.isEmpty() )
-        {
-            OString aDesktopEnvironment(m_aDesktopEnvironment.toAsciiLowerCase());
-            OStringBuffer aCopy(aTmp);
-
-            aCopy.append(aDesktopEnvironment + "-open-url");
-
-            if ( 0 == access( aCopy.getStr(), X_OK) )
-            {
-                aBuffer.append(aDesktopEnvironment + "-");
-            }
-        }
+        // Just use xdg-open on non-Mac
 
-        aBuffer.append("open-url");
+        aBuffer.append("/usr/bin/xdg-open");
 #endif
         aBuffer.append(" ");
         escapeForShell(aBuffer, OUStringToOString(aURL, osl_getThreadTextEncoding()));
diff --git a/shell/source/unix/misc/kde4-open-url.sh b/shell/source/unix/misc/kde4-open-url.sh
deleted file mode 100755
index c6e8b17..0000000
--- a/shell/source/unix/misc/kde4-open-url.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-#   Licensed to the Apache Software Foundation (ASF) under one or more
-#   contributor license agreements. See the NOTICE file distributed
-#   with this work for additional information regarding copyright
-#   ownership. The ASF licenses this file to you under the Apache
-#   License, Version 2.0 (the "License"); you may not use this file
-#   except in compliance with the License. You may obtain a copy of
-#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-
-# use kde-open or xdg-open if available, falling back to our own open-url
-kde-open "$1" 2>/dev/null || xdg-open "$1" 2>/dev/null || `dirname "$0"`/open-url "$1" 2>/dev/null
diff --git a/shell/source/unix/misc/open-url.sh b/shell/source/unix/misc/open-url.sh
deleted file mode 100755
index 72aa566..0000000
--- a/shell/source/unix/misc/open-url.sh
+++ /dev/null
@@ -1,96 +0,0 @@
-#!/bin/sh
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-#   Licensed to the Apache Software Foundation (ASF) under one or more
-#   contributor license agreements. See the NOTICE file distributed
-#   with this work for additional information regarding copyright
-#   ownership. The ASF licenses this file to you under the Apache
-#   License, Version 2.0 (the "License"); you may not use this file
-#   except in compliance with the License. You may obtain a copy of
-#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-
-# tries to locate the executable specified
-# as first parameter in the user's path.
-which() {
-  if [ ! -z "$1" ]; then
-    for i in `echo $PATH | sed -e 's/^:/.:/g' -e 's/:$/:./g' -e 's/::/:.:/g' -e 's/:/ /g'`; do
-      if [ -x "$i/$1" -a ! -d "$i/$1" ]; then
-        echo "$i/$1"
-        break;
-      fi
-    done
-  fi
-}
-
-# checks for the original mozilla start script(s)
-# and restrict the "-remote" semantics to those.
-run_mozilla() {
-  if file "$1" | grep script > /dev/null && grep NPL "$1" > /dev/null; then
-    "$1" -remote 'ping()' 2>/dev/null >/dev/null
-    if [ $? -eq 2 ]; then
-      "$1" "$2" &
-    else
-      "$1" -remote \
-        "openURL($(printf '%s' "$2" \
-          | sed -e 's/(/%28/g' -e 's/)/%29/g' -e 's/,/%2C/g'),new-window)" &
-    fi
-  else
-    "$1" "$2" &
-  fi
-}
-
-# special handling for mailto: uris
-if echo "$1" | grep '^mailto:' > /dev/null; then
-  # check for xdg-email
-  mailer=`which xdg-email`
-  if [ ! -z "$mailer" ]; then
-    $mailer "$1" &
-    exit 0
-  fi
-  # check $MAILER variable
-  if [ ! -z "$MAILER" ]; then
-    $MAILER "$1" &
-    exit 0
-  fi
-  # mozilla derivates may need -remote semantics
-  for i in thunderbird mozilla netscape icedove iceape; do
-    mailer=`which $i`
-    if [ ! -z "$mailer" ]; then
-      run_mozilla "$mailer" "$1"
-      exit 0
-    fi
-  done
-  # handle all non mozilla mail clients below
-  # ..
-else
-  # check for xdg-open
-  browser=`which xdg-open`
-  if [ ! -z "$browser" ]; then
-    $browser "$1" &
-    exit 0
-  fi
-  # check $BROWSER variable
-  if [ ! -z "$BROWSER" ]; then
-    $BROWSER "$1" &
-    exit 0
-  fi
-  # mozilla derivates may need -remote semantics
-  for i in chrome seamonkey firefox iceweasel iceape; do
-    browser=`which $i`
-    if [ ! -z "$browser" ]; then
-      run_mozilla "$browser" "$1"
-      exit 0
-    fi
-  done
-  # handle all non mozilla browsers below
-  # ..
-fi
-exit 1
diff --git a/shell/source/unix/misc/tde-open-url.sh b/shell/source/unix/misc/tde-open-url.sh
deleted file mode 100755
index b0eac27..0000000
--- a/shell/source/unix/misc/tde-open-url.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-#   Licensed to the Apache Software Foundation (ASF) under one or more
-#   contributor license agreements. See the NOTICE file distributed
-#   with this work for additional information regarding copyright
-#   ownership. The ASF licenses this file to you under the Apache
-#   License, Version 2.0 (the "License"); you may not use this file
-#   except in compliance with the License. You may obtain a copy of
-#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-
-# special handling for mailto: uris
-if echo $1 | grep '^mailto:' > /dev/null; then
-  kmailservice "$1" &
-else
-  kfmclient openURL "$1" &
-fi
diff --git a/sysui/desktop/apparmor/program.open-url b/sysui/desktop/apparmor/program.open-url
deleted file mode 100644
index 1d3d466..0000000
--- a/sysui/desktop/apparmor/program.open-url
+++ /dev/null
@@ -1,30 +0,0 @@
-# ------------------------------------------------------------------
-#
-#    Copyright (C) 2015 Canonical Ltd.
-#
-#    This Source Code Form is subject to the terms of the Mozilla Public
-#    License, v. 2.0. If a copy of the MPL was not distributed with this
-#    file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-#    Author: Bryan Quigley <bryan.quigley at canonical.com>
-#
-# ------------------------------------------------------------------
-
-#include <tunables/global>
-
-profile libreoffice-open-url INSTDIR-program/open-url {
-  #include <abstractions/base>
-  #include <abstractions/ubuntu-helpers>
-
-  owner /tmp/lu**       rw,    #makes files like luRRRRR.tmp/lubRRRR.tmp where R is random
-                               #Note, usually it's lub or luc, don't know why.
-  /bin/sh               rmix,
-  /bin/dash             rmix,
-  /bin/bash             rmix,
-  /bin/sed              rmix,
-  /bin/grep             rmix,
-  /usr/bin/xdg-open     Cxr -> sanitized_helper,
-  /dev/null             rw,
-  /usr/share/libreoffice/share/config/*    r,
-  owner @{HOME}/.config/libreoffice{,dev}/?/user/uno_packages/cache/log.txt        rw,
-}
diff --git a/sysui/desktop/apparmor/program.soffice.bin b/sysui/desktop/apparmor/program.soffice.bin
index bbb0100..e62216c 100644
--- a/sysui/desktop/apparmor/program.soffice.bin
+++ b/sysui/desktop/apparmor/program.soffice.bin
@@ -124,7 +124,7 @@ profile libreoffice-soffice INSTDIR-program/soffice.bin {
   INSTDIR-**.so                     rm,
   INSTDIR-program/soffice.bin       rmix,
   INSTDIR-program/xpdfimport        rPx,
-  INSTDIR-program/open-url          rPx,
+  /usr/bin/xdg-open                 rPUx,
   INSTDIR-program/senddoc           rPx,
 
   /usr/share/java/**.jar                r,


More information about the Libreoffice-commits mailing list