~ubuntu-branches/ubuntu/natty/duplicity/natty-updates

« back to all changes in this revision

Viewing changes to src/tarfile.py

  • Committer: Bazaar Package Importer
  • Author(s): Steinar H. Gunderson
  • Date: 2006-11-11 13:32:07 UTC
  • mfrom: (2.1.3 feisty)
  • Revision ID: james.westby@ubuntu.com-20061111133207-9gizpeda242fwmtr
Tags: 0.4.2-10.1
Switch back to python 2.4, as python-central can apparently no longer cope
with 2.3, and 2.4 seems to work ok now; patch from Joey Hess.
(Closes: #396158)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env python2.3
 
1
#!/usr/bin/env python
2
2
#-------------------------------------------------------------------
3
3
# tarfile.py
4
4
#
37
37
"""Read from and write to tar format archives.
38
38
"""
39
39
 
40
 
__version__ = "$Revision: 1.4 $"
41
 
# $Source: /cvsroot/duplicity/duplicity/duplicity/tarfile.py,v $
 
40
__version__ = "$Revision: 1.5 $"
 
41
# $Source: /sources/duplicity/duplicity/duplicity/tarfile.py,v $
42
42
 
43
43
version     = "0.4.9"
44
44
__author__  = "Lars Gustabel (lars@gustaebel.de)"
45
 
__date__    = "$Date: 2003/08/10 01:05:17 $"
46
 
__cvsid__   = "$Id: tarfile.py,v 1.4 2003/08/10 01:05:17 bescoto Exp $"
 
45
__date__    = "$Date: 2006/01/12 16:29:53 $"
 
46
__cvsid__   = "$Id: tarfile.py,v 1.5 2006/01/12 16:29:53 bescoto Exp $"
47
47
__credits__ = "Gustavo Niemeyer for his support, " \
48
48
              "Detlef Lannert for some early contributions"
49
49
 
385
385
    def getheader(self):
386
386
        """Return a tar header block as a 512 byte string.
387
387
        """
 
388
        if self.uid > 2097151 or self.uid < 0:
 
389
            sys.stderr.write("uid %i of file %s not in range. Setting uid to 60001\n" % (self.uid,self.name))
 
390
            self.uid = 60001
 
391
        if self.gid > 2097151 or self.gid < 0:
 
392
            sys.stderr.write("gid %i of file %s not in range. Setting gid to 60001\n" % (self.gid, self.name))
 
393
            self.gid = 60001
388
394
        # The following code was contributed by Detlef Lannert.
389
395
        parts = []
390
396
        for value, fieldsize in (