This file is indexed.

/usr/share/doc/python-apt/html/library/apt_inst.html is in python-apt-doc 0.8.3ubuntu7.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>apt_inst - Working with local Debian packages &mdash; python-apt 0.8.3ubuntu7 documentation</title>
    
    <link rel="stylesheet" href="../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '0.8.3ubuntu7',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <link rel="top" title="python-apt 0.8.3ubuntu7 documentation" href="../index.html" />
    <link rel="up" title="Python APT Library" href="index.html" />
    <link rel="next" title="apt.cache — The Cache class" href="apt.cache.html" />
    <link rel="prev" title="apt_pkg — The low-level bindings for apt-pkg" href="apt_pkg.html" />
    <link rel="shortcut icon" type="image/png" href="../_static/py.png" />
 

  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="apt.cache.html" title="apt.cache — The Cache class"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="apt_pkg.html" title="apt_pkg — The low-level bindings for apt-pkg"
             accesskey="P">previous</a> |</li>
        <li><img src="../_static/py.png" alt=""
                 style="vertical-align: middle; margin-top: -1px"/></li>
        <li><a href="../index.html">python-apt 0.8.3ubuntu7 documentation</a> &raquo;</li>

          <li><a href="index.html" accesskey="U">Python APT Library</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="module-apt_inst">
<span id="apt-inst-working-with-local-debian-packages"></span><h1><a class="reference internal" href="#module-apt_inst" title="apt_inst"><tt class="xref py py-mod docutils literal"><span class="pre">apt_inst</span></tt></a> - Working with local Debian packages<a class="headerlink" href="#module-apt_inst" title="Permalink to this headline"></a></h1>
<p>This module provides useful classes and functions to work with archives,
modelled after the <tt class="xref py py-class docutils literal"><span class="pre">tarfile.TarFile</span></tt> class. For working with Debian
packages, the <a class="reference internal" href="#apt_inst.DebFile" title="apt_inst.DebFile"><tt class="xref py py-class docutils literal"><span class="pre">DebFile</span></tt></a> class should be used as it provides easy access
to the control.tar.* and data.tar.* members.</p>
<p>The classes are mostly modeled after the <tt class="xref py py-class docutils literal"><span class="pre">tarfile.TarFile</span></tt> class and
enhanced with APT-specific methods. Because APT only provides a stream based
view on a tar archive, this module&#8217;s <a class="reference internal" href="#apt_inst.TarFile" title="apt_inst.TarFile"><tt class="xref py py-class docutils literal"><span class="pre">TarFile</span></tt></a> class only provides a
very small subset of those functions.</p>
<div class="section" id="ar-archives">
<h2>AR Archives<a class="headerlink" href="#ar-archives" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="apt_inst.ArArchive">
<em class="property">class </em><tt class="descclassname">apt_inst.</tt><tt class="descname">ArArchive</tt><big>(</big><em>file</em><big>)</big><a class="headerlink" href="#apt_inst.ArArchive" title="Permalink to this definition"></a></dt>
<dd><p>An ArArchive object represents an archive in the 4.4 BSD AR format,
which is used for e.g. deb packages.</p>
<p>The parameter <em>file</em> may be a string specifying the path of a file, or
a <tt class="xref py py-class docutils literal"><span class="pre">file</span></tt>-like object providing the <tt class="xref py py-meth docutils literal"><span class="pre">fileno()</span></tt> method. It may
also be an int specifying a file descriptor (returned by e.g.
<tt class="xref py py-func docutils literal"><span class="pre">os.open()</span></tt>). The recommended way is to pass in the path to the file.</p>
<p>ArArchive (and its subclasses) support the iterator protocol, meaning that
an <a class="reference internal" href="#apt_inst.ArArchive" title="apt_inst.ArArchive"><tt class="xref py py-class docutils literal"><span class="pre">ArArchive</span></tt></a> object can be iterated over yielding the members in
the archive (same as <a class="reference internal" href="#apt_inst.ArArchive.getmembers" title="apt_inst.ArArchive.getmembers"><tt class="xref py py-meth docutils literal"><span class="pre">getmembers()</span></tt></a>).</p>
<dl class="describe">
<dt>
<tt class="descname">archive[key]</tt></dt>
<dd><p>Return a ArMember object for the member given by <em>key</em>. Raise
LookupError if there is no ArMember with the given name.</p>
</dd></dl>

<dl class="describe">
<dt>
<tt class="descname">key in archive</tt></dt>
<dd><p>Return True if a member with the name <em>key</em> is found in the archive, it
is the same function as <a class="reference internal" href="#apt_inst.ArArchive.getmember" title="apt_inst.ArArchive.getmember"><tt class="xref py py-meth docutils literal"><span class="pre">getmember()</span></tt></a>.</p>
</dd></dl>

<dl class="method">
<dt id="apt_inst.ArArchive.extract">
<tt class="descname">extract</tt><big>(</big><em>name</em><span class="optional">[</span>, <em>target: str</em><span class="optional">]</span><big>)</big> &rarr; bool<a class="headerlink" href="#apt_inst.ArArchive.extract" title="Permalink to this definition"></a></dt>
<dd><p>Extract the member given by <em>name</em> into the directory given by
<em>target</em>. If the extraction failed, an error is raised. Otherwise,
the method returns True if the owner could be set or False if the
owner could not be changed. It may also raise LookupError if there
is no member with the given name.</p>
<p>The parameter <em>target</em> is completely optional. If it is not given, the
function extracts into the current directory.</p>
</dd></dl>

<dl class="method">
<dt id="apt_inst.ArArchive.extractall">
<tt class="descname">extractall</tt><big>(</big><span class="optional">[</span><em>target: str</em><span class="optional">]</span><big>)</big> &rarr; bool<a class="headerlink" href="#apt_inst.ArArchive.extractall" title="Permalink to this definition"></a></dt>
<dd><p>Extract all into the directory given by target or the current
directory if target is not given. If the extraction failed, an error
is raised. Otherwise, the method returns True if the owner could be
set or False if the owner could not be changed.</p>
</dd></dl>

<dl class="method">
<dt id="apt_inst.ArArchive.extractdata">
<tt class="descname">extractdata</tt><big>(</big><em>name: str</em><big>)</big> &rarr; bytes<a class="headerlink" href="#apt_inst.ArArchive.extractdata" title="Permalink to this definition"></a></dt>
<dd><p>Return the contents of the member given by <em>name</em>, as a bytes object.
Raise LookupError if there is no ArMember with the given name.</p>
</dd></dl>

<dl class="method">
<dt id="apt_inst.ArArchive.getmember">
<tt class="descname">getmember</tt><big>(</big><em>name: str</em><big>)</big> &rarr; ArMember<a class="headerlink" href="#apt_inst.ArArchive.getmember" title="Permalink to this definition"></a></dt>
<dd><p>Return a ArMember object for the member given by <em>name</em>. Raise
LookupError if there is no ArMember with the given name.</p>
</dd></dl>

<dl class="method">
<dt id="apt_inst.ArArchive.getmembers">
<tt class="descname">getmembers</tt><big>(</big><big>)</big> &rarr; list<a class="headerlink" href="#apt_inst.ArArchive.getmembers" title="Permalink to this definition"></a></dt>
<dd><p>Return a list of all members in the AR archive.</p>
</dd></dl>

<dl class="method">
<dt id="apt_inst.ArArchive.getnames">
<tt class="descname">getnames</tt><big>(</big><big>)</big> &rarr; list<a class="headerlink" href="#apt_inst.ArArchive.getnames" title="Permalink to this definition"></a></dt>
<dd><p>Return a list of the names of all members in the AR archive.</p>
</dd></dl>

<dl class="method">
<dt id="apt_inst.ArArchive.gettar">
<tt class="descname">gettar</tt><big>(</big><em>name: str</em>, <em>comp: str</em><big>)</big> &rarr; TarFile<a class="headerlink" href="#apt_inst.ArArchive.gettar" title="Permalink to this definition"></a></dt>
<dd><p>Return a TarFile object for the member given by <em>name</em> which will be
decompressed using the compression algorithm given by <em>comp</em>.
This is almost equal to:</p>
<div class="highlight-python"><pre>member = arfile.getmember(name)
tarfile = TarFile(file, member.start, member.size, 'gzip')'</pre>
</div>
<p>It just opens a new TarFile on the given position in the stream.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="apt_inst.ArMember">
<em class="property">class </em><tt class="descclassname">apt_inst.</tt><tt class="descname">ArMember</tt><a class="headerlink" href="#apt_inst.ArMember" title="Permalink to this definition"></a></dt>
<dd><p>An ArMember object represents a single file within an AR archive. For
Debian packages this can be e.g. control.tar.gz. This class provides
information about this file, such as the mode and size. It has no
constructor.</p>
<dl class="attribute">
<dt id="apt_inst.ArMember.gid">
<tt class="descname">gid</tt><a class="headerlink" href="#apt_inst.ArMember.gid" title="Permalink to this definition"></a></dt>
<dd><p>The group id of the owner.</p>
</dd></dl>

<dl class="attribute">
<dt id="apt_inst.ArMember.mode">
<tt class="descname">mode</tt><a class="headerlink" href="#apt_inst.ArMember.mode" title="Permalink to this definition"></a></dt>
<dd><p>The mode of the file.</p>
</dd></dl>

<dl class="attribute">
<dt id="apt_inst.ArMember.mtime">
<tt class="descname">mtime</tt><a class="headerlink" href="#apt_inst.ArMember.mtime" title="Permalink to this definition"></a></dt>
<dd><p>Last time of modification.</p>
</dd></dl>

<dl class="attribute">
<dt id="apt_inst.ArMember.name">
<tt class="descname">name</tt><a class="headerlink" href="#apt_inst.ArMember.name" title="Permalink to this definition"></a></dt>
<dd><p>The name of the file.</p>
</dd></dl>

<dl class="attribute">
<dt id="apt_inst.ArMember.size">
<tt class="descname">size</tt><a class="headerlink" href="#apt_inst.ArMember.size" title="Permalink to this definition"></a></dt>
<dd><p>The size of the files.</p>
</dd></dl>

<dl class="attribute">
<dt id="apt_inst.ArMember.start">
<tt class="descname">start</tt><a class="headerlink" href="#apt_inst.ArMember.start" title="Permalink to this definition"></a></dt>
<dd><p>The offset in the archive where the file starts.</p>
</dd></dl>

<dl class="attribute">
<dt id="apt_inst.ArMember.uid">
<tt class="descname">uid</tt><a class="headerlink" href="#apt_inst.ArMember.uid" title="Permalink to this definition"></a></dt>
<dd><p>The user id of the owner.</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="debian-packages">
<h2>Debian Packages<a class="headerlink" href="#debian-packages" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="apt_inst.DebFile">
<em class="property">class </em><tt class="descclassname">apt_inst.</tt><tt class="descname">DebFile</tt><big>(</big><em>file</em><big>)</big><a class="headerlink" href="#apt_inst.DebFile" title="Permalink to this definition"></a></dt>
<dd><p>A DebFile object represents a file in the .deb package format. It inherits
<a class="reference internal" href="#apt_inst.ArArchive" title="apt_inst.ArArchive"><tt class="xref py py-class docutils literal"><span class="pre">ArArchive</span></tt></a>. In addition to the attributes and methods from
<a class="reference internal" href="#apt_inst.ArArchive" title="apt_inst.ArArchive"><tt class="xref py py-class docutils literal"><span class="pre">ArArchive</span></tt></a>, DebFile provides the following methods:</p>
<dl class="attribute">
<dt id="apt_inst.DebFile.control">
<tt class="descname">control</tt><a class="headerlink" href="#apt_inst.DebFile.control" title="Permalink to this definition"></a></dt>
<dd><p>The <a class="reference internal" href="#apt_inst.TarFile" title="apt_inst.TarFile"><tt class="xref py py-class docutils literal"><span class="pre">TarFile</span></tt></a> object associated with the control.tar.gz member.</p>
</dd></dl>

<dl class="attribute">
<dt id="apt_inst.DebFile.data">
<tt class="descname">data</tt><a class="headerlink" href="#apt_inst.DebFile.data" title="Permalink to this definition"></a></dt>
<dd><p>The <a class="reference internal" href="#apt_inst.TarFile" title="apt_inst.TarFile"><tt class="xref py py-class docutils literal"><span class="pre">TarFile</span></tt></a> object associated with the
data.tar.{gz,bz2,lzma,xz} member.</p>
</dd></dl>

<dl class="attribute">
<dt id="apt_inst.DebFile.debian_binary">
<tt class="descname">debian_binary</tt><a class="headerlink" href="#apt_inst.DebFile.debian_binary" title="Permalink to this definition"></a></dt>
<dd><p>The package version, as contained in debian-binary.</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="tar-archives">
<h2>Tar Archives<a class="headerlink" href="#tar-archives" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="apt_inst.TarFile">
<em class="property">class </em><tt class="descclassname">apt_inst.</tt><tt class="descname">TarFile</tt><big>(</big><em>file</em><span class="optional">[</span>, <em>min: int</em>, <em>max: int</em>, <em>comp: str</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#apt_inst.TarFile" title="Permalink to this definition"></a></dt>
<dd><p>A TarFile object represents a single .tar file stream.</p>
<p>The parameter <em>file</em> may be a string specifying the path of a file, or
a <tt class="xref py py-class docutils literal"><span class="pre">file</span></tt>-like object providing the <tt class="xref py py-meth docutils literal"><span class="pre">fileno()</span></tt> method. It may
also be an int specifying a file descriptor (returned by e.g.
<tt class="xref py py-func docutils literal"><span class="pre">os.open()</span></tt>).</p>
<p>The parameter <em>min</em> describes the offset in the file where the archive
begins and the parameter <em>max</em> is the size of the archive.</p>
<p>The compression of the archive is set by the parameter <em>comp</em>. It can
be set to any program supporting the -d switch, the default being gzip.</p>
<dl class="method">
<dt id="apt_inst.TarFile.extractall">
<tt class="descname">extractall</tt><big>(</big><span class="optional">[</span><em>rootdir: str</em><span class="optional">]</span><big>)</big> &rarr; True<a class="headerlink" href="#apt_inst.TarFile.extractall" title="Permalink to this definition"></a></dt>
<dd><p>Extract the archive in the current directory. The argument <em>rootdir</em>
can be used to change the target directory.</p>
</dd></dl>

<dl class="method">
<dt id="apt_inst.TarFile.extractdata">
<tt class="descname">extractdata</tt><big>(</big><em>member: str</em><big>)</big> &rarr; bytes<a class="headerlink" href="#apt_inst.TarFile.extractdata" title="Permalink to this definition"></a></dt>
<dd><p>Return the contents of the member, as a bytes object. Raise
LookupError if there is no member with the given name.</p>
</dd></dl>

<dl class="method">
<dt id="apt_inst.TarFile.go">
<tt class="descname">go</tt><big>(</big><em>callback: callable</em><span class="optional">[</span>, <em>member: str</em><span class="optional">]</span><big>)</big> &rarr; True<a class="headerlink" href="#apt_inst.TarFile.go" title="Permalink to this definition"></a></dt>
<dd><p>Go through the archive and call the callable <em>callback</em> for each
member with 2 arguments. The first argument is the <a class="reference internal" href="#apt_inst.TarMember" title="apt_inst.TarMember"><tt class="xref py py-class docutils literal"><span class="pre">TarMember</span></tt></a>
and the second one is the data, as bytes.</p>
<p>The optional parameter <em>member</em> can be used to specify the member for
which call the callback. If not specified, it will be called for all
members. If specified and not found, LookupError will be raised.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="apt_inst.TarMember">
<em class="property">class </em><tt class="descclassname">apt_inst.</tt><tt class="descname">TarMember</tt><a class="headerlink" href="#apt_inst.TarMember" title="Permalink to this definition"></a></dt>
<dd><p>Represent a single member of a &#8216;tar&#8217; archive.</p>
<p>This class which has been modelled after <tt class="xref py py-class docutils literal"><span class="pre">tarfile.TarInfo</span></tt>
represents information about a given member in an archive.</p>
<dl class="method">
<dt id="apt_inst.TarMember.isblk">
<tt class="descname">isblk</tt><big>(</big><big>)</big><a class="headerlink" href="#apt_inst.TarMember.isblk" title="Permalink to this definition"></a></dt>
<dd><p>Determine whether the member is a block device.</p>
</dd></dl>

<dl class="method">
<dt id="apt_inst.TarMember.ischr">
<tt class="descname">ischr</tt><big>(</big><big>)</big><a class="headerlink" href="#apt_inst.TarMember.ischr" title="Permalink to this definition"></a></dt>
<dd><p>Determine whether the member is a character device.</p>
</dd></dl>

<dl class="method">
<dt id="apt_inst.TarMember.isdev">
<tt class="descname">isdev</tt><big>(</big><big>)</big><a class="headerlink" href="#apt_inst.TarMember.isdev" title="Permalink to this definition"></a></dt>
<dd><p>Determine whether the member is a device (block,character or FIFO).</p>
</dd></dl>

<dl class="method">
<dt id="apt_inst.TarMember.isdir">
<tt class="descname">isdir</tt><big>(</big><big>)</big><a class="headerlink" href="#apt_inst.TarMember.isdir" title="Permalink to this definition"></a></dt>
<dd><p>Determine whether the member is a directory.</p>
</dd></dl>

<dl class="method">
<dt id="apt_inst.TarMember.isfifo">
<tt class="descname">isfifo</tt><big>(</big><big>)</big><a class="headerlink" href="#apt_inst.TarMember.isfifo" title="Permalink to this definition"></a></dt>
<dd><p>Determine whether the member is a FIFO.</p>
</dd></dl>

<dl class="method">
<dt id="apt_inst.TarMember.isfile">
<tt class="descname">isfile</tt><big>(</big><big>)</big><a class="headerlink" href="#apt_inst.TarMember.isfile" title="Permalink to this definition"></a></dt>
<dd><p>Determine whether the member is a regular file.</p>
</dd></dl>

<dl class="method">
<dt id="apt_inst.TarMember.islnk">
<tt class="descname">islnk</tt><big>(</big><big>)</big><a class="headerlink" href="#apt_inst.TarMember.islnk" title="Permalink to this definition"></a></dt>
<dd><p>Determine whether the member is a hardlink.</p>
</dd></dl>

<dl class="method">
<dt id="apt_inst.TarMember.isreg">
<tt class="descname">isreg</tt><big>(</big><big>)</big><a class="headerlink" href="#apt_inst.TarMember.isreg" title="Permalink to this definition"></a></dt>
<dd><p>Determine whether the member is a regular file, same as isfile().</p>
</dd></dl>

<dl class="method">
<dt id="apt_inst.TarMember.issym">
<tt class="descname">issym</tt><big>(</big><big>)</big><a class="headerlink" href="#apt_inst.TarMember.issym" title="Permalink to this definition"></a></dt>
<dd><p>Determine whether the member is a symbolic link.</p>
</dd></dl>

<dl class="attribute">
<dt id="apt_inst.TarMember.gid">
<tt class="descname">gid</tt><a class="headerlink" href="#apt_inst.TarMember.gid" title="Permalink to this definition"></a></dt>
<dd><p>The owner&#8217;s group id</p>
</dd></dl>

<dl class="attribute">
<dt id="apt_inst.TarMember.linkname">
<tt class="descname">linkname</tt><a class="headerlink" href="#apt_inst.TarMember.linkname" title="Permalink to this definition"></a></dt>
<dd><p>The target of the link.</p>
</dd></dl>

<dl class="attribute">
<dt id="apt_inst.TarMember.major">
<tt class="descname">major</tt><a class="headerlink" href="#apt_inst.TarMember.major" title="Permalink to this definition"></a></dt>
<dd><p>The major ID of the device.</p>
</dd></dl>

<dl class="attribute">
<dt id="apt_inst.TarMember.minor">
<tt class="descname">minor</tt><a class="headerlink" href="#apt_inst.TarMember.minor" title="Permalink to this definition"></a></dt>
<dd><p>The minor ID of the device.</p>
</dd></dl>

<dl class="attribute">
<dt id="apt_inst.TarMember.mode">
<tt class="descname">mode</tt><a class="headerlink" href="#apt_inst.TarMember.mode" title="Permalink to this definition"></a></dt>
<dd><p>The mode (permissions).</p>
</dd></dl>

<dl class="attribute">
<dt id="apt_inst.TarMember.mtime">
<tt class="descname">mtime</tt><a class="headerlink" href="#apt_inst.TarMember.mtime" title="Permalink to this definition"></a></dt>
<dd><p>Last time of modification.</p>
</dd></dl>

<dl class="attribute">
<dt id="apt_inst.TarMember.name">
<tt class="descname">name</tt><a class="headerlink" href="#apt_inst.TarMember.name" title="Permalink to this definition"></a></dt>
<dd><p>The name of the file.</p>
</dd></dl>

<dl class="attribute">
<dt id="apt_inst.TarMember.size">
<tt class="descname">size</tt><a class="headerlink" href="#apt_inst.TarMember.size" title="Permalink to this definition"></a></dt>
<dd><p>The size of the file.</p>
</dd></dl>

<dl class="attribute">
<dt id="apt_inst.TarMember.uid">
<tt class="descname">uid</tt><a class="headerlink" href="#apt_inst.TarMember.uid" title="Permalink to this definition"></a></dt>
<dd><p>The owner&#8217;s user id.</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="deprecated-functions">
<h2>Deprecated functions<a class="headerlink" href="#deprecated-functions" title="Permalink to this headline"></a></h2>
<p>The following functions have been shipped in python-apt for a longer time and
are deprecated as of release 0.7.92. They are listed here to help developers
to port their applications to the new API which is completely different. For
this purpose each function documentation includes an example showing how the
function can be replaced.</p>
<dl class="function">
<dt id="apt_inst.arCheckMember">
<tt class="descclassname">apt_inst.</tt><tt class="descname">arCheckMember</tt><big>(</big><em>file</em>, <em>membername</em><big>)</big><a class="headerlink" href="#apt_inst.arCheckMember" title="Permalink to this definition"></a></dt>
<dd><p>Check if the member specified by the parameter <em>membername</em> exists in
the AR file referenced by the parameter <em>file</em>, which may be a
<tt class="xref py py-class docutils literal"><span class="pre">file()</span></tt> object, a file descriptor, or anything implementing a
<tt class="xref py py-meth docutils literal"><span class="pre">fileno()</span></tt> method.</p>
<p>This function has been replaced by using the <tt class="xref std std-keyword docutils literal"><span class="pre">in</span></tt> check on an
<a class="reference internal" href="#apt_inst.ArArchive" title="apt_inst.ArArchive"><tt class="xref py py-class docutils literal"><span class="pre">ArArchive</span></tt></a> object:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">member</span> <span class="ow">in</span> <span class="n">ArArchive</span><span class="p">(</span><span class="nb">file</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>

<dl class="function">
<dt id="apt_inst.debExtract">
<tt class="descclassname">apt_inst.</tt><tt class="descname">debExtract</tt><big>(</big><em>file</em>, <em>func</em>, <em>chunk</em><big>)</big><a class="headerlink" href="#apt_inst.debExtract" title="Permalink to this definition"></a></dt>
<dd><p>Call the function referenced by <em>func</em> for each member of the tar file
<em>chunk</em> which is contained in the AR file referenced by the parameter
<em>file</em>, which may be a <tt class="xref py py-class docutils literal"><span class="pre">file()</span></tt> object, a file descriptor, or
anything implementing a <tt class="xref py py-meth docutils literal"><span class="pre">fileno()</span></tt> method.</p>
<p>The function <em>func</em> is a callback with the signature
<tt class="docutils literal"><span class="pre">(what,</span> <span class="pre">name,</span> <span class="pre">link,</span> <span class="pre">mode,</span> <span class="pre">uid,</span> <span class="pre">gid,</span> <span class="pre">size,</span> <span class="pre">mtime,</span> <span class="pre">major,</span> <span class="pre">minor)</span></tt>. The
parameter <em>what</em> describes the type of the member. It can be &#8216;FILE&#8217;,
&#8216;DIR&#8217;, or &#8216;HARDLINK&#8217;. The parameter <em>name</em> refers to the name of the
member. In case of links, <em>link</em> refers to the target of the link.</p>
<p>This function is deprecated and has been replaced by the <a class="reference internal" href="#apt_inst.TarFile.go" title="apt_inst.TarFile.go"><tt class="xref py py-meth docutils literal"><span class="pre">TarFile.go()</span></tt></a>
method. The following example shows the old code and the new code:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">debExtract</span><span class="p">(</span><span class="nb">open</span><span class="p">(</span><span class="s">&quot;package.deb&quot;</span><span class="p">),</span> <span class="n">my_callback</span><span class="p">,</span> <span class="s">&quot;data.tar.gz&quot;</span><span class="p">)</span> <span class="c">#old</span>

<span class="n">DebFile</span><span class="p">(</span><span class="s">&quot;package.deb&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">go</span><span class="p">(</span><span class="n">my_callback</span><span class="p">)</span>
</pre></div>
</div>
<p>Please note that the signature of the callback is different in
<a class="reference internal" href="#apt_inst.TarFile.go" title="apt_inst.TarFile.go"><tt class="xref py py-meth docutils literal"><span class="pre">TarFile.go()</span></tt></a>.</p>
</dd></dl>

<dl class="function">
<dt id="apt_inst.tarExtract">
<tt class="descclassname">apt_inst.</tt><tt class="descname">tarExtract</tt><big>(</big><em>file</em>, <em>func</em>, <em>comp</em><big>)</big><a class="headerlink" href="#apt_inst.tarExtract" title="Permalink to this definition"></a></dt>
<dd><p>Call the function <em>func</em> for each member of the tar file <em>file</em>.</p>
<p>The parameter <em>comp</em> is a string determining the compressor used. Possible
options are &#8220;xz&#8221;, &#8220;lzma&#8221;, &#8220;bzip2&#8221; and &#8220;gzip&#8221;. The parameter <em>file</em> may be
a <tt class="xref py py-class docutils literal"><span class="pre">file()</span></tt> object, a file descriptor, or anything implementing
a <tt class="xref py py-meth docutils literal"><span class="pre">fileno()</span></tt> method.</p>
<p>The function <em>func</em> is a callback with the signature
<tt class="docutils literal"><span class="pre">(what,</span> <span class="pre">name,</span> <span class="pre">link,</span> <span class="pre">mode,</span> <span class="pre">uid,</span> <span class="pre">gid,</span> <span class="pre">size,</span> <span class="pre">mtime,</span> <span class="pre">major,</span> <span class="pre">minor)</span></tt>. The
parameter <em>what</em> describes the type of the member. It can be &#8216;FILE&#8217;,
&#8216;DIR&#8217;, or &#8216;HARDLINK&#8217;. The parameter <em>name</em> refers to the name of the
member. In case of links, <em>link</em> refers to the target of the link.</p>
<p>This function is deprecated and has been replaced by the <a class="reference internal" href="#apt_inst.TarFile.go" title="apt_inst.TarFile.go"><tt class="xref py py-meth docutils literal"><span class="pre">TarFile.go()</span></tt></a>
method. The following example shows the old code and the new code:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">tarExtract</span><span class="p">(</span><span class="nb">open</span><span class="p">(</span><span class="s">&quot;archive.tar.gz&quot;</span><span class="p">),</span> <span class="n">my_callback</span><span class="p">,</span> <span class="s">&quot;gzip&quot;</span><span class="p">)</span> <span class="c">#old</span>
<span class="n">TarFile</span><span class="p">(</span><span class="s">&quot;archive.tar.gz&quot;</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="s">&quot;gzip&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">go</span><span class="p">(</span><span class="n">my_callback</span><span class="p">)</span>
</pre></div>
</div>
<p>Please note that the signature of the callback is different in
<a class="reference internal" href="#apt_inst.TarFile.go" title="apt_inst.TarFile.go"><tt class="xref py py-meth docutils literal"><span class="pre">TarFile.go()</span></tt></a>.</p>
</dd></dl>

<dl class="function">
<dt id="apt_inst.debExtractArchive">
<tt class="descclassname">apt_inst.</tt><tt class="descname">debExtractArchive</tt><big>(</big><em>file</em>, <em>rootdir</em><big>)</big><a class="headerlink" href="#apt_inst.debExtractArchive" title="Permalink to this definition"></a></dt>
<dd><p>Extract the archive referenced by the <tt class="xref py py-class docutils literal"><span class="pre">file</span></tt> object <em>file</em>
into the directory specified by <em>rootdir</em>.</p>
<p>The parameter <em>file</em> may be a <tt class="xref py py-class docutils literal"><span class="pre">file()</span></tt> object, a file descriptor, or
anything implementing a <tt class="xref py py-meth docutils literal"><span class="pre">fileno()</span></tt> method.</p>
<p>This function has been replaced by <a class="reference internal" href="#apt_inst.TarFile.extractall" title="apt_inst.TarFile.extractall"><tt class="xref py py-meth docutils literal"><span class="pre">TarFile.extractall()</span></tt></a> and
<a class="reference internal" href="#apt_inst.DebFile.data" title="apt_inst.DebFile.data"><tt class="xref py py-attr docutils literal"><span class="pre">DebFile.data</span></tt></a>:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">debExtractArchive</span><span class="p">(</span><span class="nb">open</span><span class="p">(</span><span class="s">&quot;package.deb&quot;</span><span class="p">),</span> <span class="n">rootdir</span><span class="p">)</span> <span class="c"># old</span>
<span class="n">DebFile</span><span class="p">(</span><span class="s">&quot;package.deb&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">extractall</span><span class="p">(</span><span class="n">rootdir</span><span class="p">)</span> <span class="c"># new</span>
</pre></div>
</div>
</dd></dl>

<dl class="function">
<dt id="apt_inst.debExtractControl">
<tt class="descclassname">apt_inst.</tt><tt class="descname">debExtractControl</tt><big>(</big><em>file</em><span class="optional">[</span>, <em>member='control'</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#apt_inst.debExtractControl" title="Permalink to this definition"></a></dt>
<dd><p>Return the indicated file as a string from the control tar. The default
is &#8216;control&#8217;. The parameter <em>file</em> may be a <tt class="xref py py-class docutils literal"><span class="pre">file()</span></tt> object, a
file descriptor, or anything implementing a <tt class="xref py py-meth docutils literal"><span class="pre">fileno()</span></tt> method.</p>
<p>This function has been replaced by <a class="reference internal" href="#apt_inst.DebFile.control" title="apt_inst.DebFile.control"><tt class="xref py py-attr docutils literal"><span class="pre">DebFile.control</span></tt></a> and
<a class="reference internal" href="#apt_inst.TarFile.extractdata" title="apt_inst.TarFile.extractdata"><tt class="xref py py-meth docutils literal"><span class="pre">TarFile.extractdata()</span></tt></a>. In the following example, both commands
return the contents of the control file:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">debExtractControl</span><span class="p">(</span><span class="nb">open</span><span class="p">(</span><span class="s">&quot;package.deb&quot;</span><span class="p">))</span>
<span class="n">DebFile</span><span class="p">(</span><span class="s">&quot;package.deb&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">control</span><span class="o">.</span><span class="n">extractdata</span><span class="p">(</span><span class="s">&quot;control&quot;</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../contents.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#"><tt class="docutils literal"><span class="pre">apt_inst</span></tt> - Working with local Debian packages</a><ul>
<li><a class="reference internal" href="#ar-archives">AR Archives</a></li>
<li><a class="reference internal" href="#debian-packages">Debian Packages</a></li>
<li><a class="reference internal" href="#tar-archives">Tar Archives</a></li>
<li><a class="reference internal" href="#deprecated-functions">Deprecated functions</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="apt_pkg.html"
                        title="previous chapter"><tt class="docutils literal"><span class="pre">apt_pkg</span></tt> &#8212; The low-level bindings for apt-pkg</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="apt.cache.html"
                        title="next chapter"><tt class="docutils literal docutils literal docutils literal"><span class="pre">apt.cache</span></tt> &#8212; The Cache class</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../_sources/library/apt_inst.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="apt.cache.html" title="apt.cache — The Cache class"
             >next</a> |</li>
        <li class="right" >
          <a href="apt_pkg.html" title="apt_pkg — The low-level bindings for apt-pkg"
             >previous</a> |</li>
        <li><img src="../_static/py.png" alt=""
                 style="vertical-align: middle; margin-top: -1px"/></li>
        <li><a href="../index.html">python-apt 0.8.3ubuntu7 documentation</a> &raquo;</li>

          <li><a href="index.html" >Python APT Library</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2009-2010, Julian Andres Klode &lt;jak@debian.org&gt;.
      Last updated on Apr 18, 2012.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
    </div>
  </body>
</html>