Tue, 15 Jul 2008 22:18:03 -0400
Give extraction stderr more context, and suppress normal cpio stderr junk.
cpio will write a useless "N blocks" message to stderr without --quiet, so
use that.
When we show extraction's stderr to the user, first write a line explaining
what it is, and also don't forget to strip the trailing newline, since
.warning() writes its own.
63 | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" |
2 | "http://www.w3.org/TR/html4/strict.dtd"> | |
3 | ||
4 | <html><head><title>dtrx: Intelligent archive extraction</title> | |
5 | <link rel="stylesheet" href="common.css"> | |
6 | </head> | |
7 | <body> | |
8 | <h1>dtrx: Intelligent archive extraction</h1> | |
9 | ||
10 | <h2>Introduction</h2> | |
11 | ||
12 | <p><span class="pname">dtrx</span> stands for “Do The Right | |
13 | Extraction.” It's a tool for Unix-like systems that takes all the | |
14 | hassle out of extracting archives. Here's an example of how you use | |
15 | it:</p> | |
16 | ||
17 | <pre>$ dtrx linux-2.6.10.tar.bz2</pre> | |
18 | ||
19 | <p>That's basically the same thing as:</p> | |
20 | ||
21 | <pre>$ tar -jxf linux-2.6.10.tar.bz2</pre> | |
22 | ||
23 | <p>But there's more to it than that. You know those really annoying files | |
24 | that don't put everything in a dedicated directory, and have the | |
25 | permissions all wrong?</p> | |
26 | ||
27 | <pre>$ tar -zvxf random-tarball.tar.gz | |
28 | foo | |
29 | bar | |
30 | data/ | |
31 | data/text | |
32 | $ cd data/ | |
33 | cd: permission denied: data</pre> | |
34 | ||
35 | <p><span class="pname">dtrx</span> takes care of all those problems for | |
36 | you, too:</p> | |
37 | ||
38 | <pre>$ dtrx random-tarball.tar.gz | |
39 | $ cd random-tarball/data | |
40 | $ cat text | |
41 | This all works properly.</pre> | |
42 | ||
43 | <p><span class="pname">dtrx</span> is simple and powerful. Just use the | |
44 | same command for all your archive files, and they'll never frustrate you | |
45 | again.</p> | |
46 | ||
47 | <h2>Features</h2> | |
48 | ||
49 | <ul> | |
50 | ||
51 | <li><strong>Handles many archive types</strong>: You only need to remember | |
52 | one simple command to extract | |
53 | ||
54 | <span class="pname">tar</span>, | |
55 | <span class="pname">zip</span>, | |
56 | <span class="pname">cpio</span>, | |
57 | <span class="pname">deb</span>, | |
58 | <span class="pname">rpm</span>, | |
59 | <span class="pname">gem</span>, | |
60 | <span class="pname">7z</span>, | |
61 | <span class="pname">cab</span>, | |
62 | <span class="pname">gz</span>, | |
75
856de7e8f494
Update for 6.1, plus some tweaks here and there.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
64
diff
changeset
|
63 | <span class="pname">bz2</span>, |
856de7e8f494
Update for 6.1, plus some tweaks here and there.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
64
diff
changeset
|
64 | <span class="pname">lzma</span>, and many kinds of |
856de7e8f494
Update for 6.1, plus some tweaks here and there.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
64
diff
changeset
|
65 | <span class="pname">exe</span> files, including Microsoft Cabinet archives, |
856de7e8f494
Update for 6.1, plus some tweaks here and there.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
64
diff
changeset
|
66 | InstallShield archives, and self-extracting <span class="pname">zip</span> |
856de7e8f494
Update for 6.1, plus some tweaks here and there.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
64
diff
changeset
|
67 | files. |
63 | 68 | |
69 | If they have any extra compression, like <span | |
70 | class="pname">tar.bz2</span>, <span class="pname">dtrx</span> will take | |
71 | care of that for you, too.</li> | |
72 | ||
73 | <li><strong>Keeps everything organized</strong>: <span | |
74 | class="pname">dtrx</span> will make sure that archives are extracted into | |
75 | their own dedicated directories.</li> | |
76 | ||
77 | <li><strong>Sane permissions</strong>: <span class="pname">dtrx</span> makes | |
78 | sure you can read and write all the files you just extracted, while leaving | |
79 | the rest of the permissions intact.</li> | |
80 | ||
81 | <li><strong>Recursive extraction</strong>: <span class="pname">dtrx</span> can | |
82 | find archives inside the archive and extract those too.</li> | |
83 | ||
84 | </ul> | |
85 | ||
86 | <h2>Download</h2> | |
87 | ||
75
856de7e8f494
Update for 6.1, plus some tweaks here and there.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
64
diff
changeset
|
88 | <p><a href="dtrx-6.1.tar.gz">Download <span class="pname">dtrx</span> |
856de7e8f494
Update for 6.1, plus some tweaks here and there.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
64
diff
changeset
|
89 | 6.1</a>. The SHA1 checksum for this file |
856de7e8f494
Update for 6.1, plus some tweaks here and there.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
64
diff
changeset
|
90 | is <tt>2cd7c5e1ca2e83a942e5af58dceb0700063ce03d</tt>. New features in this |
63 | 91 | release include:</p> |
92 | ||
93 | <ul> | |
94 | ||
75
856de7e8f494
Update for 6.1, plus some tweaks here and there.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
64
diff
changeset
|
95 | <li>Add support for InstallShield archives, using |
856de7e8f494
Update for 6.1, plus some tweaks here and there.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
64
diff
changeset
|
96 | the <span class="pname">unshield</span> command.</li> |
856de7e8f494
Update for 6.1, plus some tweaks here and there.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
64
diff
changeset
|
97 | <li>The wording of many of the interactive prompts has been adjusted |
856de7e8f494
Update for 6.1, plus some tweaks here and there.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
64
diff
changeset
|
98 | to be clearer and provide more information to the user |
856de7e8f494
Update for 6.1, plus some tweaks here and there.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
64
diff
changeset
|
99 | immediately.</li> |
856de7e8f494
Update for 6.1, plus some tweaks here and there.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
64
diff
changeset
|
100 | <li><span class="pname">dtrx</span> 6.1 does a better job protecting |
856de7e8f494
Update for 6.1, plus some tweaks here and there.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
64
diff
changeset
|
101 | against race conditions when extracting a single file.</li> |
856de7e8f494
Update for 6.1, plus some tweaks here and there.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
64
diff
changeset
|
102 | <li>If you used the -f option, and extracted an archive that only contained |
856de7e8f494
Update for 6.1, plus some tweaks here and there.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
64
diff
changeset
|
103 | one file or directory, <span class="pname">dtrx</span> 6.0 would still |
856de7e8f494
Update for 6.1, plus some tweaks here and there.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
64
diff
changeset
|
104 | prompt you to ask how it should be |
856de7e8f494
Update for 6.1, plus some tweaks here and there.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
64
diff
changeset
|
105 | extracted. <span class="pname">dtrx</span> 6.1 fixes this, extracting the |
856de7e8f494
Update for 6.1, plus some tweaks here and there.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
64
diff
changeset
|
106 | contents to the current directory as -f requires.</li> |
856de7e8f494
Update for 6.1, plus some tweaks here and there.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
64
diff
changeset
|
107 | <li>Recursive extraction would not work well |
856de7e8f494
Update for 6.1, plus some tweaks here and there.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
64
diff
changeset
|
108 | in <span class="pname">dtrx</span> 6.0 when the contents of the original |
856de7e8f494
Update for 6.1, plus some tweaks here and there.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
64
diff
changeset
|
109 | archive were a single file. This has been fixed |
856de7e8f494
Update for 6.1, plus some tweaks here and there.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
64
diff
changeset
|
110 | in <span class="pname">dtrx</span> 6.1.</li> |
63 | 111 | |
112 | </ul> | |
113 | ||
64
d7b46cae939b
Add notes about the hg repo.
Brett Smith <brett@brettcsmith.org>
parents:
63
diff
changeset
|
114 | <p>If you would like to try the latest development version—or maybe do some |
75
856de7e8f494
Update for 6.1, plus some tweaks here and there.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
64
diff
changeset
|
115 | work on it yourself—you can check out the |
856de7e8f494
Update for 6.1, plus some tweaks here and there.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
64
diff
changeset
|
116 | project's <a href="http://www.selenic.com/mercurial/wiki/">Mercurial</a> |
856de7e8f494
Update for 6.1, plus some tweaks here and there.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
64
diff
changeset
|
117 | repository. A |
64
d7b46cae939b
Add notes about the hg repo.
Brett Smith <brett@brettcsmith.org>
parents:
63
diff
changeset
|
118 | <a href="http://www.brettcsmith.org/2007/dtrx/dtrx/">web repository</a> is |
d7b46cae939b
Add notes about the hg repo.
Brett Smith <brett@brettcsmith.org>
parents:
63
diff
changeset
|
119 | available, or you can just run:</p> |
d7b46cae939b
Add notes about the hg repo.
Brett Smith <brett@brettcsmith.org>
parents:
63
diff
changeset
|
120 | |
d7b46cae939b
Add notes about the hg repo.
Brett Smith <brett@brettcsmith.org>
parents:
63
diff
changeset
|
121 | <pre>$ hg clone http://www.brettcsmith.org/2007/dtrx/dtrx</pre> |
d7b46cae939b
Add notes about the hg repo.
Brett Smith <brett@brettcsmith.org>
parents:
63
diff
changeset
|
122 | |
63 | 123 | <h2>Requirements</h2> |
124 | ||
125 | <p>If you have Python 2.4 or greater, this should work out of the box. If | |
75
856de7e8f494
Update for 6.1, plus some tweaks here and there.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
64
diff
changeset
|
126 | you're stuck on Python 2.3, you can use this if you install |
856de7e8f494
Update for 6.1, plus some tweaks here and there.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
64
diff
changeset
|
127 | the <a href="http://www.lysator.liu.se/~astrand/popen5/">subprocess |
856de7e8f494
Update for 6.1, plus some tweaks here and there.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
64
diff
changeset
|
128 | module</a>. You'll need the usual tools for the archive types you want to |
856de7e8f494
Update for 6.1, plus some tweaks here and there.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
64
diff
changeset
|
129 | extract: for example, if you're extracting <span class="pname">zip</span> |
856de7e8f494
Update for 6.1, plus some tweaks here and there.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
64
diff
changeset
|
130 | files, you'll need <span class="pname">zipinfo</span> |
856de7e8f494
Update for 6.1, plus some tweaks here and there.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
64
diff
changeset
|
131 | and <span class="pname">unzip</span>. See the INSTALL file included |
856de7e8f494
Update for 6.1, plus some tweaks here and there.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
64
diff
changeset
|
132 | with <span class="pname">dtrx</span> for a complete list of necessary |
856de7e8f494
Update for 6.1, plus some tweaks here and there.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
64
diff
changeset
|
133 | utilities.</p> |
63 | 134 | |
135 | <h2>Installation</h2> | |
136 | ||
137 | <p>You can just put <span class="pname">scripts/dtrx</span> wherever is | |
138 | convenient for you, but if you want to install the program system-wide, you | |
139 | can also run the following command as root or equivalent:</p> | |
140 | ||
141 | <pre>python setup.py install</pre> | |
142 | ||
143 | <p>See the included <tt>INSTALL</tt> file for more information.</p> | |
144 | ||
145 | </body> | |
146 | </html> |