~james-w/linaro-image-tools/fetch-packages

« back to all changes in this revision

Viewing changes to hwpack/better_tarfile.py

  • Committer: James Westby
  • Date: 2010-08-31 14:48:13 UTC
  • mfrom: (49.1.30 tarfile-matchers)
  • Revision ID: james.westby@canonical.com-20100831144813-fmgvk928lv0z0l1g
Merged tarfile-matchers into create-hwpack-skeleton.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
from StringIO import StringIO
3
3
from tarfile import DIRTYPE, TarFile as StandardTarFile, TarInfo
4
4
 
 
5
"""Improvements to the standard library's tarfile module.
 
6
 
 
7
In particular this module provides a tarfile.TarFile subclass that aids
 
8
in adding paths to the tarfile that aren't present on the filesystem,
 
9
with the ability to specify file content as strings, and provide
 
10
default values for the mtime, uid, etc. of the created paths.
 
11
"""
5
12
 
6
13
@contextmanager
7
14
def writeable_tarfile(backing_file, mode="w", **kwargs):