]>
cloud.milkyroute.net Git - dolphin.git/blob - src/khns/servicemenuinstallation
6 IO
.popen("file --mime-type -b " + filename
).gets().strip!
()
8 $archivetypes = { "application/x-tar" => :"tar -xf %s -C %s",
9 "application/tar" => :"tar -xf %s -C %s",
10 "application/x-gzip" => :"tar -zxf %s -C %s",
11 "application/gzip" => :"tar -zxf %s -C %s",
12 "application/x-gzip-compressed-tar" => :"tar -zxf %s -C %s",
13 "application/gzip-compressed-tar" => :"tar -zxf %s -C %s",
14 "application/x-gzip-compressed" => :"tar -zxf %s -C %s",
15 "application/gzip-compressed" => :"tar -zxf %s -C %s",
16 "application/bzip" => :"tar -jxf %s -C %s",
17 "application/bzip2" => :"tar -jxf %s -C %s",
18 "application/x-bzip" => :"tar -jxf %s -C %s",
19 "application/x-bzip2" => :"tar -jxf %s -C %s",
20 "application/bzip-compressed" => :"tar -jxf %s -C %s",
21 "application/bzip2-compressed" => :"tar -jxf %s -C %s",
22 "application/x-bzip-compressed" => :"tar -jxf %s -C %s",
23 "application/x-bzip2-compressed" => :"tar -jxf %s -C %s",
24 "application/bzip-compressed-tar" => :"tar -jxf %s -C %s",
25 "application/bzip2-compressed-tar" => :"tar -jxf %s -C %s",
26 "application/x-bzip-compressed-tar" => :"tar -jxf %s -C %s",
27 "application/x-bzip2-compressed-tar" => :"tar -jxf %s -C %s",
28 "application/zip" => :"unzip %s -d %s",
29 "application/x-zip" => :"unzip %s -d %s",
30 "application/x-zip-compressed" => :"unzip %s -d %s",
31 "multipart/x-zip" => :"unzip %s -d %s",
32 "application/tgz" => :"tar -zxf %s -C %s",
33 "application/x-compressed-gtar" => :"tar -zxf %s -C %s",
34 "application/x-gtar" => :"tar -zxf %s -C %s",
35 "file/tgz" => :"tar -zxf %s -C %s",
36 "multipart/x-tar-gz" => :"tar -zxf %s -C %s",
37 "application/x-gunzip" => :"tar -zxf %s -C %s",
38 "application/gzipped" => :"tar -zxf %s -C %s",
39 "gzip/document" => :"tar -zxf %s -C %s",
40 "application/x-bz2 " => :"tar -jxf %s -C %s",
41 "application/x-gtar" => :"tar -xf %s -C %s",
42 "multipart/x-tar" => :"tar -xf %s -C %s"
44 def uncompress(filename
, output
)
45 system(sprintf($archivetypes[mimeType(filename
)].to_s
, filename
, output
))
47 dir
= archive +
"-dir"
52 exit(-1) if !
uncompress(archive
, dir
)
65 system("kdialog --passivepopup \"Installation failed\" 15")
68 if !
((File
.exist
?(file
= dir +
"/install-it.sh") || File
.exist
?(file
= dir +
"/install-it")) && system(file
))
69 fail() if !File
.exist
?(file
= dir +
"/installKDE4.sh") && !File
.exist
?(file
= dir +
"/installKDE4") && !File
.exist
?(file
= dir +
"/install.sh") && !File
.exist
?(file
= dir +
"/install")
70 File
.new(file
).chmod(0700)
71 fail() if !
system(file +
" --local") && !
system(file +
"--local-install") && !
system(file +
" --install")