Changes in tools/mkext2.py [cc1a727:dba3e2c] in mainline


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/mkext2.py

    rcc1a727 rdba3e2c  
    3939import uuid
    4040from imgutil import *
     41
     42if sys.version >= '3':
     43        xrange = range
    4144
    4245GDE_SIZE = 32
     
    507510                self.pos = align_up(self.pos, bytes)
    508511       
     512        def set_pos(self, pos):
     513                "Set the current position"
     514               
     515                self.pos = pos
     516       
    509517        def pack(self):
    510518                "Pack the inode structure and return the result"
     
    525533                data.flags = 0
    526534                blockconv = lambda x: 0 if x == None else x
    527                 data.direct_blocks = map(blockconv, self.direct)
    528                 data.indirect_blocks = map(blockconv, self.indirect)
     535                data.direct_blocks = list(map(blockconv, self.direct))
     536                data.indirect_blocks = list(map(blockconv, self.indirect))
    529537                data.version = 0
    530538                data.file_acl = 0
     
    562570                head.inode_type = self.type
    563571                inode.write(head.pack())
    564                 inode.write(self.name+'\0')
     572                inode.write(self.name+'\0'.encode())
    565573                inode.align_pos(4)
    566574
     
    581589                        if self.inode:
    582590                                self.prev_entry.write(self.inode)
     591                                self.inode.set_pos(self.pos)
    583592       
    584593        def add(self, entry):
Note: See TracChangeset for help on using the changeset viewer.