svn path=/trunk/KDE/kdebase/apps/; revision=
1046238
#!/usr/bin/env ruby
require 'fileutils'
-topdir = ARGV[0] + "-dir"
+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
+topdir = archive + "-dir"
# try: deinstall.sh
# try: deinstall
# try: installKDE4.sh
File.new(file).chmod(0700)
fail() if !system(file + " --remove") && !system(file + " --delete") && !system(file + " --uninstall") && !system(file + " --deinstall")
end
-FileUtils.rm_r(topdir)
\ No newline at end of file
+FileUtils.rm_r(topdir)
require 'pathname'
require 'fileutils'
archive = ARGV[0]
+$servicedir = `kde4-config --localprefix`.strip! + "share/kde4/services/ServiceMenus/"
+FileUtils.mkdir_p($servicedir) if !File.exist?($servicedir)
+if archive[(archive.length - 8)..(archive.length - 1)] == ".desktop"
+ puts "Single-File Service-Menu"
+ puts archive
+ puts $servicedir
+ FileUtils.cp(archive, $servicedir);
+ exit(0)
+end
def mimeType(filename)
IO.popen("file --mime-type -b " + filename).gets().strip!()
end