]> cloud.milkyroute.net Git - dolphin.git/blob - src/settings/services/servicemenudeinstallation
Sourcecode hierarchy cleanup: Move files from khns to settings/services (step 1/2)
[dolphin.git] / src / settings / services / servicemenudeinstallation
1 #!/usr/bin/env ruby
2 require 'fileutils'
3 archive = ARGV[0]
4 if archive[(archive.length - 8)..(archive.length)] == ".desktop"
5 FileUtils.rm(`kde4-config --localprefix`.strip! + "share/kde4/services/ServiceMenus/" + File.basename(archive))
6 exit(0)
7 end
8 dir = archive + "-dir"
9 # try: deinstall.sh
10 # try: deinstall
11 # try: installKDE4.sh
12 # try: installKDE4
13 # try: install.sh
14 # try: install
15 dd = Dir.new(dir)
16 dd.read
17 dd.read
18 dir += "/" + dd.read
19 dd = nil
20 Dir.chdir(dir)
21 def fail()
22 system("kdialog --passivepopup \"Deinstallation failed\" 15")
23 exit(-1)
24 end
25 if !((File.exist?(file = "./deinstall.sh") || File.exist?(file = "./deinstall")) && system(file))
26 fail() if !File.exist?(file = "./installKDE4.sh") && !File.exist?(file = "./installKDE4") && !File.exist?(file = "./install.sh") && !File.exist?(file = "./install")
27 File.new(file).chmod(0700)
28 fail() if !system(file + " --remove") && !system(file + " --delete") && !system(file + " --uninstall") && !system(file + " --deinstall")
29 end
30 FileUtils.rm_r(dir)