Changeset 4c53333 in mainline for tools/mkext2.py


Ignore:
Timestamp:
2013-07-11T08:21:10Z (12 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
64e63ce1
Parents:
80445cf (diff), c8bb1633 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge mainline changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/mkext2.py

    r80445cf r4c53333  
    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.