Package portage :: Module xpak' :: Class tbz2
[hide private]

Class tbz2

source code

object --+
         |
        tbz2

Instance Methods [hide private]
 
__init__(self, myfile)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
decompose(self, datadir, cleanup=1)
Alias for unpackinfo() --- Complement to recompose() but optionally deletes the destination directory.
source code
 
compose(self, datadir, cleanup=0)
Alias for recompose().
source code
 
recompose(self, datadir, cleanup=0, break_hardlinks=True)
Creates an xpak segment from the datadir provided, truncates the tbz2 to the end of regular data if an xpak segment already exists, and adds the new segment to the file with terminating info.
source code
 
recompose_mem(self, xpdata, break_hardlinks=True)
Update the xpak segment.
source code
 
cleanup(self, datadir) source code
 
scan(self)
Scans the tbz2 to locate the xpak segment and setup internal values.
source code
 
filelist(self)
Return an array of each file listed in the index.
source code
 
getfile(self, myfile, mydefault=None)
Finds 'myfile' in the data segment and returns it.
source code
 
getelements(self, myfile)
A split/array representation of tbz2.getfile()
source code
 
unpackinfo(self, mydest)
Unpacks all the files from the dataSegment into 'mydest'.
source code
 
get_data(self)
Returns all the files from the dataSegment as a map object.
source code
 
getboth(self)
Returns an array [indexSegment, dataSegment]
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, myfile)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

decompose(self, datadir, cleanup=1)

source code 

Alias for unpackinfo() --- Complement to recompose() but optionally deletes the destination directory. Extracts the xpak from the tbz2 into the directory provided. Raises IOError if scan() fails. Returns result of upackinfo().

recompose_mem(self, xpdata, break_hardlinks=True)

source code 

Update the xpak segment.

Parameters:
  • xpdata - A new xpak segment to be written, like that returned from the xpak_mem() function.
  • break_hardlinks - If hardlinks exist, create a copy in order to break them. This makes it safe to use hardlinks to create cheap snapshots of the repository, which is useful for solving race conditions on binhosts as described here: http://code.google.com/p/chromium-os/issues/detail?id=3225. Default is True.

scan(self)

source code 

Scans the tbz2 to locate the xpak segment and setup internal values. This function is called by relevant functions already.