┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/settings/services/servicemenudeinstallation
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2010-07-24 20:58:05 +0000
committerPeter Penz <[email protected]>2010-07-24 20:58:05 +0000
commit935cc8a03bcb6088ff520d7161db14b9b6a29044 (patch)
tree92b2a7c5c0c36e2992b12fd06f4638b44de7009e /src/settings/services/servicemenudeinstallation
parent6f1a1d74074565ba7a290c496fde908d1dc0d8ff (diff)
Sourcecode hierarchy cleanup: Move files from khns to settings/services (step 1/2)
svn path=/trunk/KDE/kdebase/apps/; revision=1154135
Diffstat (limited to 'src/settings/services/servicemenudeinstallation')
-rwxr-xr-xsrc/settings/services/servicemenudeinstallation30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/settings/services/servicemenudeinstallation b/src/settings/services/servicemenudeinstallation
new file mode 100755
index 000000000..a1c71efa7
--- /dev/null
+++ b/src/settings/services/servicemenudeinstallation
@@ -0,0 +1,30 @@
+#!/usr/bin/env ruby
+require 'fileutils'
+archive = ARGV[0]
+if archive[(archive.length - 8)..(archive.length)] == ".desktop"
+ FileUtils.rm(`kde4-config --localprefix`.strip! + "share/kde4/services/ServiceMenus/" + File.basename(archive))
+ exit(0)
+end
+dir = archive + "-dir"
+# try: deinstall.sh
+# try: deinstall
+# try: installKDE4.sh
+# try: installKDE4
+# try: install.sh
+# try: install
+dd = Dir.new(dir)
+dd.read
+dd.read
+dir += "/" + dd.read
+dd = nil
+Dir.chdir(dir)
+def fail()
+ system("kdialog --passivepopup \"Deinstallation failed\" 15")
+ exit(-1)
+end
+if !((File.exist?(file = "./deinstall.sh") || File.exist?(file = "./deinstall")) && system(file))
+ fail() if !File.exist?(file = "./installKDE4.sh") && !File.exist?(file = "./installKDE4") && !File.exist?(file = "./install.sh") && !File.exist?(file = "./install")
+File.new(file).chmod(0700)
+ fail() if !system(file + " --remove") && !system(file + " --delete") && !system(file + " --uninstall") && !system(file + " --deinstall")
+end
+FileUtils.rm_r(dir)