summaryrefslogtreecommitdiffstats
path: root/mandriva/2010.2/kdebase/kdebase-3.5.7-lzma_support.patch
blob: 3bb8bbb884e5fdd8bbc1af6e52eacd5c8c883191 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
diff -purN kdebase-3.5.7.orig/doc/kioslave/index.docbook kdebase-3.5.7/doc/kioslave/index.docbook
--- kdebase-3.5.7.orig/doc/kioslave/index.docbook	2007-09-13 18:41:54.000000000 +0200
+++ kdebase-3.5.7/doc/kioslave/index.docbook	2007-09-13 18:46:13.000000000 +0200
@@ -20,6 +20,7 @@
 <!ENTITY kio-info SYSTEM "info.docbook">
 <!ENTITY kio-lan SYSTEM "lan.docbook">
 <!ENTITY kio-ldap SYSTEM "ldap.docbook">
+<!ENTITY kio-lzma SYSTEM "lzma.docbook">
 <!ENTITY kio-mailto SYSTEM "mailto.docbook">
 <!ENTITY kio-mac SYSTEM "mac.docbook">
 <!ENTITY kio-man SYSTEM "man.docbook">
@@ -68,6 +69,7 @@
 &kio-info;
 &kio-lan;
 &kio-ldap;
+&kio-lzma;
 &kio-mailto;
 &kio-mac;
 &kio-man;
diff -purN kdebase-3.5.7.orig/doc/kioslave/lzma.docbook kdebase-3.5.7/doc/kioslave/lzma.docbook
--- kdebase-3.5.7.orig/doc/kioslave/lzma.docbook	1970-01-01 01:00:00.000000000 +0100
+++ kdebase-3.5.7/doc/kioslave/lzma.docbook	2007-09-13 18:46:13.000000000 +0200
@@ -0,0 +1,30 @@
+<article lang="&language;" id="lzma">
+<title>lzma</title>
+<articleinfo>
+<authorgroup>
+<author>&Lauri.Watts; &Lauri.Watts.mail;</author>
+<!-- TRANS:ROLES_OF_TRANSLATORS -->
+</authorgroup>
+</articleinfo>
+
+<para><command>lzma</command> is a compression program</para>
+
+<para>The lzma kioslave is not directly usable, and is intended for use
+as a filter.  For example, the tar kioslave can filter a file through
+the lzma kioslave, in order to display the contents of a <literal
+role="extension">tar.lzma</literal> file directly in a &konqueror;
+window.</para>
+
+<para>If you click on a file compressed with a <literal
+role="extension">lzma</literal> extension in &konqueror;, this kioslave is
+used to uncompress it and display it as a normal (uncompressed)
+file.</para>
+
+<para>If you are a developer, and would like to use the lzma filter, you
+can find documentation on using kioslaves at <ulink
+url="http://developer.kde.org">http://developer.kde.org</ulink></para>
+
+<para> See the manual: <ulink url="man:/lzma">lzma</ulink>.
+</para>
+
+</article>
diff -purN kdebase-3.5.7.orig/kioslave/filter/lzma.protocol kdebase-3.5.7/kioslave/filter/lzma.protocol
--- kdebase-3.5.7.orig/kioslave/filter/lzma.protocol	1970-01-01 01:00:00.000000000 +0100
+++ kdebase-3.5.7/kioslave/filter/lzma.protocol	2007-09-13 18:46:13.000000000 +0200
@@ -0,0 +1,10 @@
+[Protocol]
+exec=kio_filter
+protocol=lzma
+mimetype=application/lzma
+input=stream
+output=stream
+reading=true
+source=false
+DocPath=kioslave/lzma.html
+Icon=ark
diff -purN kdebase-3.5.7.orig/kioslave/filter/Makefile.am kdebase-3.5.7/kioslave/filter/Makefile.am
--- kdebase-3.5.7.orig/kioslave/filter/Makefile.am	2007-09-13 18:41:35.000000000 +0200
+++ kdebase-3.5.7/kioslave/filter/Makefile.am	2007-09-13 18:47:03.000000000 +0200
@@ -17,5 +17,5 @@ if include_BZIP2
 BZIP2FILES=bzip.protocol bzip2.protocol
 endif
 
-protocol_DATA = gzip.protocol $(BZIP2FILES)
+protocol_DATA = gzip.protocol $(BZIP2FILES) lzma.protocol
 
diff -purN kdebase-3.5.7.orig/kioslave/info/kde-info2html kdebase-3.5.7/kioslave/info/kde-info2html
--- kdebase-3.5.7.orig/kioslave/info/kde-info2html	2007-09-13 18:41:35.000000000 +0200
+++ kdebase-3.5.7/kioslave/info/kde-info2html	2007-09-13 18:46:13.000000000 +0200
@@ -39,6 +39,8 @@
 #   March 9 2003      Add support for browsing by file. by Luis Pedro Coelho
 #   June  11 2003     Update the layout of the sides to the new infopageslayout.
 #                     by Sven Leiber <s.leiber@web.de>
+#   August 30 2007    Add lzma support.
+#                     by Per Øyvind Karlsen <peroyvind@mandriva.org>                  
 #
 #-------------------------------------------------------
 
@@ -143,6 +145,9 @@ sub FileNotFound {
 	elsif ($DirFileName =~ m/.info.gz$/ ) {
 		open DIR, "-|", "gzip", "-dc", $DirFileName;
 	}
+	elsif ($DirFileName =~ m/.info.lzma$/ ) {
+		open DIR, "-|", "lzma", "-dc", $DirFileName;
+	}
 	else {
 		open DIR, $DirFileName;
 	}
@@ -252,6 +257,9 @@ sub infocat {
 			elsif ($infofile =~ m/.info.gz$/ ) {
 				open INFOFILE, "-|", "gzip", "-dc", "$dir/$infofile";
 			}
+			elsif ($infofile =~ m/.info.lzma$/ ) {
+ 				open INFOFILE, "-|", "lzma", "-dc", "$dir/$infofile";
+			}
 			elsif ($infofile =~ m/.info$/) {
 				open INFOFILE, "-|", "$dir/$infofile";
 			}
@@ -427,6 +435,9 @@ sub ReadIndirectTable {
     open FH1, "-|", "gunzip", "-q", "-d", "-c", $FileName || &DieFileNotFound($FileName);
   } elsif ($FileName =~ /\.bz2$/) {
     open FH1, "-|", "bunzip2", "-q", "-d", "-c", $FileName || &DieFileNotFound($FileName);
+  } elsif ($FileName =~ /\.lzma$/) {
+    open FH1, "-|", "unlzma", "-q", "-d", "-c", $FileName || &DieFileNotFound($FileName);
+
   } else {
     open(FH1, $FileName) || &DieFileNotFound($FileName);
   }
@@ -473,6 +484,8 @@ sub ReadTagTable {
     open FH, "-|", "gunzip", "-q", "-d", "-c", $FileName || &DieFileNotFound($FileName);
   } elsif ($FileName =~ /\.bz2$/) {
     open FH, "-|", "bunzip2", "-q", "-d", "-c", $FileName || &DieFileNotFound($FileName);
+  } elsif ($FileName =~ /\.lzma$/) {
+    open FH, "-|", "unlzma", "-q", "-d", "-c", $FileName || &DieFileNotFound($FileName);
   } else {
     open FH, $FileName || &DieFileNotFound($FileName);
   }
@@ -756,6 +769,8 @@ sub InfoNode2HTML {
     open FH2, "-|", "gunzip", "-q", "-d", "-c", $FileName || &DieFileNotFound($FileName);
   } elsif ($FileName =~ /\.bz2$/) {
     open FH2, "-|", "bunzip2", "-q", "-d", "-c", $FileName || &DieFileNotFound($FileName);
+  } elsif ($FileName =~ /\.lzma$/) {
+    open FH2, "-|", "unlzma", "-q", "-d", "-c", $FileName || &DieFileNotFound($FileName);
   } else {
     open FH2, $FileName || &DieFileNotFound($FileName);
   }
@@ -985,17 +1000,21 @@ sub FindFile {
     foreach my $Name ($File, $Alt) {
         my $gzName  = $Name . '.gz';
         my $bz2Name = $Name . '.bz2';
+	my $lzmaName = $Name . '.lzma';
 
         foreach (@info2html::config::INFODIR) {
             return "$_/$Name"    if -e "$_/$Name";
             return "$_/$gzName"  if -e "$_/$gzName";
             return "$_/$bz2Name" if -e "$_/$bz2Name";
+	    return "$_/$lzmaName" if -e "$_/$lzmaName";
+	    
         }
         next unless $ENV{INFOPATH};
         foreach my $i (split(/:/, $ENV{INFOPATH})) {
             return "$i/$Name"    if -e "$i/$Name";
             return "$i/$gzName"  if -e "$i/$gzName";
             return "$i/$bz2Name" if -e "$i/$bz2Name";
+	    return "$i/$lzmaName" if -e "$i/$lzmaName";
         }
     }
     return "";
diff -purN kdebase-3.5.7.orig/kioslave/man/kio_man.cpp kdebase-3.5.7/kioslave/man/kio_man.cpp
--- kdebase-3.5.7.orig/kioslave/man/kio_man.cpp	2007-09-13 18:41:35.000000000 +0200
+++ kdebase-3.5.7/kioslave/man/kio_man.cpp	2007-09-13 18:46:13.000000000 +0200
@@ -68,6 +68,8 @@ void stripExtension( QString *name )
         pos -= 4;
     else if ( name->find(".bz", -3) != -1 )
         pos -= 3;
+    else if ( name->find(".lzma", -5) != -1 )
+ 	pos -= 5;
 
     if ( pos > 0 )
         pos = name->findRev('.', pos-1);
@@ -1311,6 +1313,8 @@ void MANProtocol::showIndex(const QStrin
 	    end -= 2;
 	else if ( len >= 4 && strcmp( end-3, ".bz2" ) == 0 )
 	    end -= 4;
+	else if ( len >= 5 && strcmp( end-4, ".lzma" ) == 0 )
+  	    end -= 5;
 
 	while ( end >= begin && *end != '.' )
 	    end--;