From 935cc8a03bcb6088ff520d7161db14b9b6a29044 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sat, 24 Jul 2010 20:58:05 +0000 Subject: Sourcecode hierarchy cleanup: Move files from khns to settings/services (step 1/2) svn path=/trunk/KDE/kdebase/apps/; revision=1154135 --- src/CMakeLists.txt | 6 +- src/khns/servicemenu.knsrc | 8 --- src/khns/servicemenudeinstallation | 30 --------- src/khns/servicemenuinstallation | 82 ------------------------- src/settings/services/servicemenu.knsrc | 8 +++ src/settings/services/servicemenudeinstallation | 30 +++++++++ src/settings/services/servicemenuinstallation | 82 +++++++++++++++++++++++++ 7 files changed, 123 insertions(+), 123 deletions(-) delete mode 100644 src/khns/servicemenu.knsrc delete mode 100755 src/khns/servicemenudeinstallation delete mode 100755 src/khns/servicemenuinstallation create mode 100644 src/settings/services/servicemenu.knsrc create mode 100755 src/settings/services/servicemenudeinstallation create mode 100755 src/settings/services/servicemenuinstallation (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fe6b13ac3..bba1bf957 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -289,7 +289,7 @@ ${SERVICES_INSTALL_DIR} ) install( FILES settings/kcm/kcmdolphinnavigation.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) install( FILES settings/kcm/kcmdolphinservices.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) install( FILES settings/kcm/kcmdolphingeneral.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) -install( FILES khns/servicemenu.knsrc DESTINATION ${CONFIG_INSTALL_DIR} ) -install( PROGRAMS khns/servicemenuinstallation DESTINATION ${BIN_INSTALL_DIR} ) -install( PROGRAMS khns/servicemenudeinstallation DESTINATION ${BIN_INSTALL_DIR} ) +install( FILES settings/services/servicemenu.knsrc DESTINATION ${CONFIG_INSTALL_DIR} ) +install( PROGRAMS settings/services/servicemenuinstallation DESTINATION ${BIN_INSTALL_DIR} ) +install( PROGRAMS settings/services/servicemenudeinstallation DESTINATION ${BIN_INSTALL_DIR} ) diff --git a/src/khns/servicemenu.knsrc b/src/khns/servicemenu.knsrc deleted file mode 100644 index 7914f7c63..000000000 --- a/src/khns/servicemenu.knsrc +++ /dev/null @@ -1,8 +0,0 @@ -[KNewStuff2] -ProvidersUrl=http://download.kde.org/khotnewstuff/servicemenu-providers.xml -ChecksumPolicy=ifpossible -SignaturePolicy=ifpossible -TargetDir=servicemenu-download -Uncompress=never -InstallationCommand=servicemenuinstallation %f -UninstallCommand=servicemenudeinstallation %f diff --git a/src/khns/servicemenudeinstallation b/src/khns/servicemenudeinstallation deleted file mode 100755 index a1c71efa7..000000000 --- a/src/khns/servicemenudeinstallation +++ /dev/null @@ -1,30 +0,0 @@ -#!/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) diff --git a/src/khns/servicemenuinstallation b/src/khns/servicemenuinstallation deleted file mode 100755 index b99cc3b00..000000000 --- a/src/khns/servicemenuinstallation +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/env ruby -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 -$archivetypes = { "application/x-tar" => :"tar -xf %s -C %s", - "application/tar" => :"tar -xf %s -C %s", - "application/x-gzip" => :"tar -zxf %s -C %s", - "application/gzip" => :"tar -zxf %s -C %s", - "application/x-gzip-compressed-tar" => :"tar -zxf %s -C %s", - "application/gzip-compressed-tar" => :"tar -zxf %s -C %s", - "application/x-gzip-compressed" => :"tar -zxf %s -C %s", - "application/gzip-compressed" => :"tar -zxf %s -C %s", - "application/bzip" => :"tar -jxf %s -C %s", - "application/bzip2" => :"tar -jxf %s -C %s", - "application/x-bzip" => :"tar -jxf %s -C %s", - "application/x-bzip2" => :"tar -jxf %s -C %s", - "application/bzip-compressed" => :"tar -jxf %s -C %s", - "application/bzip2-compressed" => :"tar -jxf %s -C %s", - "application/x-bzip-compressed" => :"tar -jxf %s -C %s", - "application/x-bzip2-compressed" => :"tar -jxf %s -C %s", - "application/bzip-compressed-tar" => :"tar -jxf %s -C %s", - "application/bzip2-compressed-tar" => :"tar -jxf %s -C %s", - "application/x-bzip-compressed-tar" => :"tar -jxf %s -C %s", - "application/x-bzip2-compressed-tar" => :"tar -jxf %s -C %s", - "application/zip" => :"unzip %s -d %s", - "application/x-zip" => :"unzip %s -d %s", - "application/x-zip-compressed" => :"unzip %s -d %s", - "multipart/x-zip" => :"unzip %s -d %s", - "application/tgz" => :"tar -zxf %s -C %s", - "application/x-compressed-gtar" => :"tar -zxf %s -C %s", - "application/x-gtar" => :"tar -zxf %s -C %s", - "file/tgz" => :"tar -zxf %s -C %s", - "multipart/x-tar-gz" => :"tar -zxf %s -C %s", - "application/x-gunzip" => :"tar -zxf %s -C %s", - "application/gzipped" => :"tar -zxf %s -C %s", - "gzip/document" => :"tar -zxf %s -C %s", - "application/x-bz2 " => :"tar -jxf %s -C %s", - "application/x-gtar" => :"tar -xf %s -C %s", - "multipart/x-tar" => :"tar -xf %s -C %s" -} -def uncompress(filename, output) - system(sprintf($archivetypes[mimeType(filename)].to_s, filename, output)) -end -dir = archive + "-dir" -if File.exist?(dir) - FileUtils.rm_r(dir) -end -FileUtils.mkdir(dir) -exit(-1) if !uncompress(archive, dir) -# try: install-it.sh -# try: install-it -# 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 \"Installation failed\" 15") - exit(-1) -end -if !((File.exist?(file = "./install-it.sh") || File.exist?(file = "./install-it")) && 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 + " --local") && !system(file + "--local-install") && !system(file + " --install") -end diff --git a/src/settings/services/servicemenu.knsrc b/src/settings/services/servicemenu.knsrc new file mode 100644 index 000000000..7914f7c63 --- /dev/null +++ b/src/settings/services/servicemenu.knsrc @@ -0,0 +1,8 @@ +[KNewStuff2] +ProvidersUrl=http://download.kde.org/khotnewstuff/servicemenu-providers.xml +ChecksumPolicy=ifpossible +SignaturePolicy=ifpossible +TargetDir=servicemenu-download +Uncompress=never +InstallationCommand=servicemenuinstallation %f +UninstallCommand=servicemenudeinstallation %f 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) diff --git a/src/settings/services/servicemenuinstallation b/src/settings/services/servicemenuinstallation new file mode 100755 index 000000000..b99cc3b00 --- /dev/null +++ b/src/settings/services/servicemenuinstallation @@ -0,0 +1,82 @@ +#!/usr/bin/env ruby +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 +$archivetypes = { "application/x-tar" => :"tar -xf %s -C %s", + "application/tar" => :"tar -xf %s -C %s", + "application/x-gzip" => :"tar -zxf %s -C %s", + "application/gzip" => :"tar -zxf %s -C %s", + "application/x-gzip-compressed-tar" => :"tar -zxf %s -C %s", + "application/gzip-compressed-tar" => :"tar -zxf %s -C %s", + "application/x-gzip-compressed" => :"tar -zxf %s -C %s", + "application/gzip-compressed" => :"tar -zxf %s -C %s", + "application/bzip" => :"tar -jxf %s -C %s", + "application/bzip2" => :"tar -jxf %s -C %s", + "application/x-bzip" => :"tar -jxf %s -C %s", + "application/x-bzip2" => :"tar -jxf %s -C %s", + "application/bzip-compressed" => :"tar -jxf %s -C %s", + "application/bzip2-compressed" => :"tar -jxf %s -C %s", + "application/x-bzip-compressed" => :"tar -jxf %s -C %s", + "application/x-bzip2-compressed" => :"tar -jxf %s -C %s", + "application/bzip-compressed-tar" => :"tar -jxf %s -C %s", + "application/bzip2-compressed-tar" => :"tar -jxf %s -C %s", + "application/x-bzip-compressed-tar" => :"tar -jxf %s -C %s", + "application/x-bzip2-compressed-tar" => :"tar -jxf %s -C %s", + "application/zip" => :"unzip %s -d %s", + "application/x-zip" => :"unzip %s -d %s", + "application/x-zip-compressed" => :"unzip %s -d %s", + "multipart/x-zip" => :"unzip %s -d %s", + "application/tgz" => :"tar -zxf %s -C %s", + "application/x-compressed-gtar" => :"tar -zxf %s -C %s", + "application/x-gtar" => :"tar -zxf %s -C %s", + "file/tgz" => :"tar -zxf %s -C %s", + "multipart/x-tar-gz" => :"tar -zxf %s -C %s", + "application/x-gunzip" => :"tar -zxf %s -C %s", + "application/gzipped" => :"tar -zxf %s -C %s", + "gzip/document" => :"tar -zxf %s -C %s", + "application/x-bz2 " => :"tar -jxf %s -C %s", + "application/x-gtar" => :"tar -xf %s -C %s", + "multipart/x-tar" => :"tar -xf %s -C %s" +} +def uncompress(filename, output) + system(sprintf($archivetypes[mimeType(filename)].to_s, filename, output)) +end +dir = archive + "-dir" +if File.exist?(dir) + FileUtils.rm_r(dir) +end +FileUtils.mkdir(dir) +exit(-1) if !uncompress(archive, dir) +# try: install-it.sh +# try: install-it +# 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 \"Installation failed\" 15") + exit(-1) +end +if !((File.exist?(file = "./install-it.sh") || File.exist?(file = "./install-it")) && 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 + " --local") && !system(file + "--local-install") && !system(file + " --install") +end -- cgit v1.3