source: general/sysutils/unzip.xml@ 810c25c

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 9.1 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 810c25c was 810c25c, checked in by Xi Ruoyao <xry111@…>, 5 years ago

unzip: use bsdtar instead of unzip for convmv

The stupid conversion of unzip makes it impossible to use convmv to
restore the file names. So use bsdtar (which does not perform any
conversion) to extract the files, then use convmv to fix the names.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@22108 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 11.2 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
7 <!ENTITY unzip-download-http "&sourceforge-dl;/infozip/unzip60.tar.gz">
8 <!ENTITY unzip-download-ftp "ftp://ftp.info-zip.org/pub/infozip/src/unzip60.tgz">
9 <!ENTITY unzip-md5sum "62b490407489521db863b523a7f86375">
10 <!ENTITY unzip-size "1.3 MB">
11 <!ENTITY unzip-buildsize "9 MB">
12 <!ENTITY unzip-time "less than 0.1 SBU">
13]>
14
15<sect1 id="unzip" xreflabel="UnZip-&unzip-version;">
16 <?dbhtml filename="unzip.html"?>
17
18 <sect1info>
19 <othername>$LastChangedBy$</othername>
20 <date>$Date$</date>
21 </sect1info>
22
23 <title>UnZip-&unzip-version;</title>
24
25 <indexterm zone="unzip">
26 <primary sortas="a-UnZip">UnZip</primary>
27 </indexterm>
28
29 <sect2 role="package">
30 <title>Introduction to UnZip</title>
31
32 <para>The <application>UnZip</application> package contains
33 <filename>ZIP</filename> extraction utilities. These are useful for
34 extracting files from <filename>ZIP</filename> archives.
35 <filename>ZIP</filename> archives are created with
36 <application>PKZIP</application> or <application>Info-ZIP</application>
37 utilities, primarily in a DOS environment.</para>
38
39 &lfs90_checked;
40
41 <caution>
42 <para>The previous version of the <application>UnZip</application>
43 package had some locale related issues. Currently there are no BLFS
44 editors capable of testing these locale issues. Therefore, the
45 locale related information is left on this page, but has not been
46 tested. <!--Note that the patch recommended for the locale issues will not
47 apply to this version of <application>UnZip</application>. See the
48 discussion below in <xref linkend="unzip-locale-issues"/>. --> A more
49 general discussion of these problems can be found in the
50 <xref linkend="locale-assumed-encoding"/> section of the
51 <xref linkend="locale-issues"/> page.</para>
52 </caution>
53
54 <bridgehead renderas="sect3">Package Information</bridgehead>
55 <itemizedlist spacing="compact">
56 <listitem>
57 <para>Download (HTTP): <ulink url="&unzip-download-http;"/></para>
58 </listitem>
59 <listitem>
60 <para>Download (FTP): <ulink url="&unzip-download-ftp;"/></para>
61 </listitem>
62 <listitem>
63 <para>Download MD5 sum: &unzip-md5sum;</para>
64 </listitem>
65 <listitem>
66 <para>Download size: &unzip-size;</para>
67 </listitem>
68 <listitem>
69 <para>Estimated disk space required: &unzip-buildsize;</para>
70 </listitem>
71 <listitem>
72 <para>Estimated build time: &unzip-time;</para>
73 </listitem>
74 </itemizedlist>
75<!--
76 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
77 <itemizedlist spacing='compact'> -->
78 <!-- <listitem>
79 <para>Required patch: <ulink
80 url="&patch-root;/unzip-&unzip-version;-security_fix-1.patch"/></para>
81 </listitem>
82 <listitem>
83 <para>Required patch: <ulink
84 url="&patch-root;/unzip-&unzip-version;-security_fix-2.patch"/></para>
85 </listitem> -->
86 <!--
87 <listitem>
88 <para>Optional patch (will not apply properly): <ulink
89 url="&patch-root;/unzip-5.50-alt-iconv-v1.1.patch"/></para>
90 </listitem>
91 </itemizedlist>
92 -->
93 <para condition="html" role="usernotes">User Notes:
94 <ulink url="&blfs-wiki;/unzip"/></para>
95
96 </sect2>
97
98 <sect2 id="unzip-locale-issues">
99 <title>UnZip Locale Issues</title>
100
101 <note>
102 <para>Use of <application>UnZip</application> in the
103 <application>JDK</application>, <application>Mozilla</application>,
104 <application>DocBook</application> or any other BLFS package
105 installation is not a problem, as BLFS instructions never use
106 <application>UnZip</application> to extract a file with non-ASCII
107 characters in the file's name.</para>
108 </note>
109
110 <para>The <application>UnZip</application> package assumes that filenames
111 stored in the ZIP archives created on non-Unix systems are encoded in
112 CP850, and that they should be converted to ISO-8859-1 when writing files
113 onto the filesystem. Such assumptions are not always valid. In fact,
114 inside the ZIP archive, filenames are encoded in the DOS codepage that is
115 in use in the relevant country, and the filenames on disk should be in
116 the locale encoding. In MS Windows, the OemToChar() C function (from
117 <filename>User32.DLL</filename>) does the correct conversion (which is
118 indeed the conversion from CP850 to a superset of ISO-8859-1 if MS
119 Windows is set up to use the US English language), but there is no
120 equivalent in Linux.</para>
121
122 <para>When using <command>unzip</command> to unpack a ZIP archive
123 containing non-ASCII filenames, the filenames are damaged because
124 <command>unzip</command> uses improper conversion when any of its
125 encoding assumptions are incorrect. For example, in the ru_RU.KOI8-R
126 locale, conversion of filenames from CP866 to KOI8-R is required, but
127 conversion from CP850 to ISO-8859-1 is done, which produces filenames
128 consisting of undecipherable characters instead of words (the closest
129 equivalent understandable example for English-only users is rot13). There
130 are several ways around this limitation:</para>
131
132 <para>1) For unpacking ZIP archives with filenames containing non-ASCII
133 characters, use <ulink url="http://www.winzip.com/">WinZip</ulink> while
134 running the <ulink url="http://www.winehq.com/">Wine</ulink> Windows
135 emulator.</para>
136
137 <para>2) Use <command>bsdtar xf</command> from
138 <xref role="nodep" linkend="libarchive"/> to unpacking the ZIP archive,
139 then fix the damage made to
140 the filenames using the <command>convmv</command> tool
141 (<ulink url="http://j3e.de/linux/convmv/"/>). The following is an example
142 for the zh_CN.UTF-8 locale:</para>
143
144<screen><userinput>convmv -f cp936 -t utf-8 -r --nosmart --notest \
145 <replaceable>&lt;/path/to/unzipped/files&gt;</replaceable></userinput></screen>
146<!--
147 <para>3) Apply the optional
148 <filename>unzip-5.50-alt-iconv-v1.1.patch</filename> patch to
149 <application>UnZip</application>. It will apply with some offsets.</para>
150
151 <para>It allows to specify the assumed filename encoding in the ZIP
152 archive using the <option>-O charset_name</option> option and the
153 on-disk filename encoding using the <option>-I charset_name</option>
154 option. Defaults: the on-disk filename encoding is the locale encoding,
155 the encoding inside the ZIP archive is guessed according to the builtin
156 table based on the locale encoding. For US English users, this still
157 means that unzip converts from CP850 to ISO-8859-1 by default.</para>
158
159 <para>Caveat: this method works only with 8-bit locale encodings, not
160 with UTF-8. Attempting to use a patched <command>unzip</command> in UTF-8
161 locales may result in a segmentation fault and is probably a security
162 risk.</para>
163-->
164 </sect2>
165
166 <sect2 role="installation">
167 <title>Installation of UnZip</title>
168
169 <!-- <para>Note that if you applied the patch described above for locale issues,
170 the first required security patch will have some offsets. Now install
171 <application>UnZip</application> by running the following commands:</para> -->
172
173<screen><userinput>make -f unix/Makefile generic</userinput></screen>
174
175 <para>The test suite does not work for present target <quote>generic</quote>.</para>
176
177 <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
178
179<screen role="root"><userinput>make prefix=/usr MANDIR=/usr/share/man/man1 \
180 -f unix/Makefile install</userinput></screen>
181
182 </sect2>
183
184 <sect2 role="commands">
185 <title>Command Explanations</title>
186
187 <para><command>make -f unix/Makefile generic</command>:
188 This target begins by running a configure script (unlike the older targets
189 such as linux and linux_noasm) which creates a flags file that is then used
190 in the build. This ensures that the 32-bit x86 build receives the right
191 flags to unzip files which which are larger than 2GB when extracted.</para>
192
193 </sect2>
194
195 <sect2 role="content">
196 <title>Contents</title>
197
198 <segmentedlist>
199 <segtitle>Installed Programs</segtitle>
200 <segtitle>Installed Libraries</segtitle>
201 <segtitle>Installed Directories</segtitle>
202
203 <seglistitem>
204 <seg>funzip, unzip, unzipfsx, zipgrep, and zipinfo</seg>
205 <seg>None</seg>
206 <seg>None</seg>
207 </seglistitem>
208 </segmentedlist>
209
210 <variablelist>
211 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
212 <?dbfo list-presentation="list"?>
213 <?dbhtml list-presentation="table"?>
214
215 <varlistentry id="funzip">
216 <term><command>funzip</command></term>
217 <listitem>
218 <para>allows the output of <command>unzip</command> commands to be
219 redirected.</para>
220 <indexterm zone="unzip funzip">
221 <primary sortas="b-funzip">funzip</primary>
222 </indexterm>
223 </listitem>
224 </varlistentry>
225
226 <varlistentry id="unzip-prog">
227 <term><command>unzip</command></term>
228 <listitem>
229 <para>lists, tests or extracts files from a <filename>ZIP</filename>
230 archive.</para>
231 <indexterm zone="unzip unzip-prog">
232 <primary sortas="b-unzip">unzip</primary>
233 </indexterm>
234 </listitem>
235 </varlistentry>
236
237 <varlistentry id="unzipfsx">
238 <term><command>unzipfsx</command></term>
239 <listitem>
240 <para>is a self-extracting stub that can be prepended to a
241 <filename>ZIP</filename> archive. Files in this format allow the
242 recipient to decompress the archive without installing
243 <application>UnZip</application>.</para>
244 <indexterm zone="unzip unzipfsx">
245 <primary sortas="b-unzipfsx">unzipfsx</primary>
246 </indexterm>
247 </listitem>
248 </varlistentry>
249
250 <varlistentry id="zipgrep">
251 <term><command>zipgrep</command></term>
252 <listitem>
253 <para>searches files in a <filename>ZIP</filename> archive for
254 lines matching a pattern.</para>
255 <indexterm zone="unzip zipgrep">
256 <primary sortas="b-zipgrep">zipgrep</primary>
257 </indexterm>
258 </listitem>
259 </varlistentry>
260
261 <varlistentry id="zipinfo">
262 <term><command>zipinfo</command></term>
263 <listitem>
264 <para>produces technical information about the files in a
265 <filename>ZIP</filename> archive, including file access permissions,
266 encryption status, type of compression, etc.</para>
267 <indexterm zone="unzip zipinfo">
268 <primary sortas="b-zipinfo">zipinfo</primary>
269 </indexterm>
270 </listitem>
271 </varlistentry>
272<!--
273 <varlistentry id="libunzip">
274 <term><filename class='libraryfile'>libunzip.so</filename></term>
275 <listitem>
276 <para>contains the API functions required by the
277 <application>UnZip</application> programs.</para>
278 <indexterm zone="unzip libunzip">
279 <primary sortas="c-libunzip">libunzip.so</primary>
280 </indexterm>
281 </listitem>
282 </varlistentry>
283-->
284 </variablelist>
285
286 </sect2>
287
288</sect1>
Note: See TracBrowser for help on using the repository browser.