Annotation of /trunk/xorg-old/patches-6.9.0-r1/0205_all_6.7.99.1-xman-bzip2-v2.patch
Parent Directory | Revision Log
Revision 167 -
(hide annotations)
(download)
Tue May 8 20:58:51 2007 UTC (17 years, 4 months ago) by niro
File size: 4998 byte(s)
Tue May 8 20:58:51 2007 UTC (17 years, 4 months ago) by niro
File size: 4998 byte(s)
-import
1 | niro | 167 | diff -urN xc-orig/programs/xman/man.c xc/programs/xman/man.c |
2 | --- xc-orig/programs/xman/man.c 2004-08-11 13:46:30.000000000 -0400 | ||
3 | +++ xc/programs/xman/man.c 2004-08-11 15:12:29.000000000 -0400 | ||
4 | @@ -447,6 +447,10 @@ | ||
5 | else if (streq(ptr + 1, GZIP_EXTENSION)) | ||
6 | *ptr = '\0'; | ||
7 | #endif | ||
8 | +#ifdef BZIP2_EXTENSION | ||
9 | + else if (streq(ptr + 1, BZIP2_EXTENSION)) | ||
10 | + *ptr = '\0'; | ||
11 | +#endif | ||
12 | } | ||
13 | |||
14 | nentries = local_manual->nentries; | ||
15 | @@ -485,6 +489,10 @@ | ||
16 | else if (streq(ptr + 1, GZIP_EXTENSION)) | ||
17 | *ptr = '\0'; | ||
18 | #endif | ||
19 | +#ifdef BZIP2_EXTENSION | ||
20 | + else if (streq(ptr + 1, BZIP2_EXTENSION)) | ||
21 | + *ptr = '\0'; | ||
22 | +#endif | ||
23 | #ifdef IGNORE_EXTENSION | ||
24 | /* skip files with specified extension - they're not real man pages */ | ||
25 | else if (streq(ptr + 1, IGNORE_EXTENSION)) { | ||
26 | diff -urN xc-orig/programs/xman/man.h xc/programs/xman/man.h | ||
27 | --- xc-orig/programs/xman/man.h 2004-08-11 13:46:30.000000000 -0400 | ||
28 | +++ xc/programs/xman/man.h 2004-08-11 15:14:23.000000000 -0400 | ||
29 | @@ -165,6 +165,7 @@ | ||
30 | page from. */ | ||
31 | Boolean compress; /* Compress file on save? */ | ||
32 | Boolean gzip; /* Gzip file on save? */ | ||
33 | + Boolean bzip2; /* Bzip2 file on save? */ | ||
34 | Boolean deletetempfile; /* Need to delete tempfile when done? */ | ||
35 | char ** section_name; /* The name of each of the sections */ | ||
36 | |||
37 | diff -urN xc-orig/programs/xman/misc.c xc/programs/xman/misc.c | ||
38 | --- xc-orig/programs/xman/misc.c 2004-08-11 13:46:30.000000000 -0400 | ||
39 | +++ xc/programs/xman/misc.c 2004-08-11 15:16:24.000000000 -0400 | ||
40 | @@ -251,6 +251,22 @@ | ||
41 | return(file); | ||
42 | } | ||
43 | #endif | ||
44 | +#ifdef BZIP2_EXTENSION | ||
45 | + { | ||
46 | + sprintf(filename, "%s/%s%s/%s.%s", path, CAT, | ||
47 | + section + len_cat, page, BZIP2_EXTENSION); | ||
48 | + if ( (file = Uncompress(man_globals, filename)) != NULL) | ||
49 | + return(file); | ||
50 | + } | ||
51 | +#endif | ||
52 | +#ifdef BZIP2_EXTENSION | ||
53 | + { | ||
54 | + sprintf(filename, "%s/%s%s/%s.%s", path, CAT, | ||
55 | + section + len_cat, page, BZIP2_EXTENSION); | ||
56 | + if ( (file = Uncompress(man_globals, filename)) != NULL) | ||
57 | + return(file); | ||
58 | + } | ||
59 | +#endif | ||
60 | #else | ||
61 | for(i = 0; i < strlen(COMPRESSION_EXTENSIONS); i++) { | ||
62 | snprintf(filename, sizeof(filename), "%s/%s%s/%s.%c", path, CAT, | ||
63 | @@ -377,6 +393,18 @@ | ||
64 | snprintf(cmdbuf, sizeof(cmdbuf), GUNZIP_FORMAT, filename, output); | ||
65 | else | ||
66 | #endif | ||
67 | +#ifdef BZIP2_EXTENSION | ||
68 | + if (streq(filename + strlen(filename) - strlen(BZIP2_EXTENSION), | ||
69 | + BZIP2_EXTENSION)) | ||
70 | + sprintf(cmdbuf, BUNZIP2_FORMAT, filename, output); | ||
71 | + else | ||
72 | +#endif | ||
73 | +#ifdef BZIP2_EXTENSION | ||
74 | + if (streq(filename + strlen(filename) - strlen(BZIP2_EXTENSION), | ||
75 | + BZIP2_EXTENSION)) | ||
76 | + sprintf(cmdbuf, BUNZIP2_FORMAT, filename, output); | ||
77 | + else | ||
78 | +#endif | ||
79 | snprintf(cmdbuf, sizeof(cmdbuf), UNCOMPRESS_FORMAT, filename, output); | ||
80 | if(system(cmdbuf) == 0) /* execute search. */ | ||
81 | return(TRUE); | ||
82 | @@ -803,6 +831,10 @@ | ||
83 | |||
84 | ParseEntry(entry, path, section, page); | ||
85 | |||
86 | + man_globals->bzip2 = FALSE; | ||
87 | + | ||
88 | + man_globals->bzip2 = FALSE; | ||
89 | + | ||
90 | #if defined(__OpenBSD__) || defined(__NetBSD__) | ||
91 | /* | ||
92 | * look for uncompressed file in machine subdir first | ||
93 | @@ -852,6 +884,25 @@ | ||
94 | } | ||
95 | #endif /* GZIP_EXTENSION */ | ||
96 | #endif /* __OpenBSD__ || __NetBSD__ */ | ||
97 | + | ||
98 | +#ifdef BZIP2_EXTENSION | ||
99 | + { | ||
100 | + sprintf(input, "%s.%s", filename, BZIP2_EXTENSION); | ||
101 | +#ifndef HAS_MKSTEMP | ||
102 | + if ( UncompressNamed(man_globals, input, filename) ) { | ||
103 | +#else | ||
104 | + if ( UncompressNamed(man_globals, input, filename, file) ) { | ||
105 | +#endif | ||
106 | + man_globals->compress = TRUE; | ||
107 | + man_globals->gzip = FALSE; | ||
108 | + man_globals->bzip2 = TRUE; | ||
109 | + sprintf(man_globals->save_file, "%s/%s%s/%s.%s", path, | ||
110 | + CAT, section + len_cat, page, BZIP2_EXTENSION); | ||
111 | + return(TRUE); | ||
112 | + } | ||
113 | + } | ||
114 | +#endif /* BZIP2_EXTENSION */ | ||
115 | + | ||
116 | /* | ||
117 | * Look for uncompressed file first. | ||
118 | */ | ||
119 | @@ -921,6 +972,24 @@ | ||
120 | } | ||
121 | } | ||
122 | #endif | ||
123 | + | ||
124 | +#ifdef BZIP2_EXTENSION | ||
125 | + { | ||
126 | + sprintf(input, "%s.%s", filename, BZIP2_EXTENSION); | ||
127 | +#ifndef HAS_MKSTEMP | ||
128 | + if ( UncompressNamed(man_globals, input, filename) ) { | ||
129 | +#else | ||
130 | + if ( UncompressNamed(man_globals, input, filename, file) ) { | ||
131 | +#endif | ||
132 | + man_globals->compress = TRUE; | ||
133 | + man_globals->gzip = TRUE; | ||
134 | + sprintf(man_globals->save_file, "%s/%s%s/%s.%s", path, | ||
135 | + CAT, section + len_cat, page, BZIP2_EXTENSION); | ||
136 | + return(TRUE); | ||
137 | + } | ||
138 | + } | ||
139 | +#endif | ||
140 | + | ||
141 | /* | ||
142 | * And lastly files in a compressed directory. | ||
143 | */ | ||
144 | diff -urN xc-orig/programs/xman/vendor.h xc/programs/xman/vendor.h | ||
145 | --- xc-orig/programs/xman/vendor.h 2004-08-11 13:46:30.000000000 -0400 | ||
146 | +++ xc/programs/xman/vendor.h 2004-08-11 15:10:52.000000000 -0400 | ||
147 | @@ -132,6 +132,13 @@ | ||
148 | # define GUNZIP_FORMAT "gzip -c -d < %s >> %s" | ||
149 | # endif | ||
150 | # define GZIP_COMPRESS "gzip" | ||
151 | +# define BZIP2_EXTENSION "bz2" | ||
152 | +# ifndef HAS_MKSTEMP | ||
153 | +# define BUNZIP2_FORMAT "bunzip2 -c -d < %s > %s" | ||
154 | +# else | ||
155 | +# define BUNZIP2_FORMAT "bunzip2 -c -d < %s >> %s" | ||
156 | +# endif | ||
157 | +# define BZIP2_COMPRESS "bzip2" | ||
158 | #endif | ||
159 | |||
160 | |||
161 | @@ -175,7 +182,7 @@ | ||
162 | # define TBL "tbl" | ||
163 | #else /* HANDLE_ROFFSEQ */ | ||
164 | # if defined(linux) | ||
165 | -# define ZSOELIM "zsoelim" | ||
166 | +# define ZSOELIM "soelim" | ||
167 | # else | ||
168 | # define ZSOELIM "soelim" | ||
169 | #endif |