diff options
| author | Alexander Potashev <[email protected]> | 2019-07-15 00:14:51 +0300 |
|---|---|---|
| committer | Alexander Potashev <[email protected]> | 2019-07-15 01:39:15 +0300 |
| commit | 1aaafe178c77e234e08565cc24f58887a7d5e0be (patch) | |
| tree | f9345ba758d7747b8169cb245b9667e31273df45 /src/settings/services/servicemenudeinstallation | |
| parent | 95270333dc3061138cc3e1c6a8162bd29564492d (diff) | |
Rewrite servicemenu helper utility in C++
Summary:
- Also support MIME type "application/x-compressed-tar".
- Update tests in Ruby, remove SimpleCov.
BUG: 399229
Test Plan: Ruby tests passed
Reviewers: sitter, elvisangelaccio, ngraham
Reviewed By: elvisangelaccio
Subscribers: cfeck, kfm-devel
Tags: #dolphin
Differential Revision: https://phabricator.kde.org/D21878
Diffstat (limited to 'src/settings/services/servicemenudeinstallation')
| -rwxr-xr-x | src/settings/services/servicemenudeinstallation | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/src/settings/services/servicemenudeinstallation b/src/settings/services/servicemenudeinstallation deleted file mode 100755 index 9e090e2cd..000000000 --- a/src/settings/services/servicemenudeinstallation +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/env ruby - -# Copyright (C) 2009 Jonathan Schmidt-Dominé <[email protected]> -# Copyright (C) 2019 Harald Sitter <[email protected]> -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the -# Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -require 'fileutils' - -ARCHIVE = ARGV[0] - -# @param log_msg [String] error that gets logged to CLI -def fail(log_msg: nil) - # FIXME: this is not translated... - msg = 'Dolphin service menu installation failed' - warn log_msg if log_msg - system('kdialog', '--passivepopup', msg, '15') - abort -end - -if ARCHIVE.end_with?('.desktop') - data_location = `qtpaths --writable-path GenericDataLocation`.strip - unless $?.success? - fail(log_msg: "Could not get GenericDataLocation #{data_location}") - end - FileUtils.rm("#{data_location}/kservices5/ServiceMenus/#{File.basename(ARCHIVE)}") - exit(0) -end -dir = "#{ARCHIVE}-dir" - -deinstaller = nil -%w[deinstall.sh deinstall].find do |script| - deinstaller = Dir.glob("#{dir}/**/#{script}")[0] -end - -installer = nil -%w[install-it.sh install-it installKDE4.sh installKDE4 install.sh install].find do |script| - installer = Dir.glob("#{dir}/**/#{script}")[0] -end - -Dir.chdir(dir) do - deinstalled = false - - [deinstaller, installer].uniq.compact.each { |f| File.chmod(0o700, f) } - - if deinstaller - puts "[servicemenudeinstallation]: Trying to run deinstaller #{deinstaller}" - deinstalled = system(deinstaller) - elsif installer - puts "[servicemenudeinstallation]: Trying to run installer #{installer}" - %w[--remove --delete --uninstall --deinstall].any? do |arg| - deinstalled = system(installer, arg) - end - end - - fail unless deinstalled -end - -FileUtils.rm_r(dir) |
