Changeset eb522e8 in mainline for tools/mkfat.py


Ignore:
Timestamp:
2011-06-01T08:43:42Z (14 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8d6c1f1
Parents:
9e2e715 (diff), e51a514 (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:

Huuuuuge merge from development - all the work actually :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/mkfat.py

    r9e2e715 reb522e8  
    190190        parts = name.split('.')
    191191       
    192         if (len(parts) > 0):
     192        if len(parts) > 0:
    193193                fname = parts[0]
    194194        else:
    195195                fname = ''
    196                
     196       
     197        if len(fname) > 8:
     198                sys.stdout.write("mkfat.py: error: Directory entry " + name +
     199                    " base name is longer than 8 characters\n")
     200                sys.exit(1);
     201       
    197202        return (fname + '          ').upper()[0:8]
    198203
     
    201206        parts = name.split('.')
    202207       
    203         if (len(parts) > 1):
     208        if len(parts) > 1:
    204209                ext = parts[1]
    205210        else:
    206211                ext = ''
     212       
     213        if len(parts) > 2:
     214                sys.stdout.write("mkfat.py: error: Directory entry " + name +
     215                    " has more than one extension\n")
     216                sys.exit(1);
     217       
     218        if len(ext) > 3:
     219                sys.stdout.write("mkfat.py: error: Directory entry " + name +
     220                    " extension is longer than 3 characters\n")
     221                sys.exit(1);
    207222       
    208223        return (ext + '   ').upper()[0:3]
     
    211226        dir_entry = xstruct.create(DIR_ENTRY)
    212227       
    213         dir_entry.name = mangle_fname(name)
    214         dir_entry.ext = mangle_ext(name)
     228        dir_entry.name = mangle_fname(name).encode('ascii')
     229        dir_entry.ext = mangle_ext(name).encode('ascii')
    215230       
    216231        if (directory):
     
    239254       
    240255        dir_entry.signature = 0x2e
    241         dir_entry.name = '       '
    242         dir_entry.ext = '   '
     256        dir_entry.name = b'       '
     257        dir_entry.ext = b'   '
    243258        dir_entry.attr = 0x10
    244259       
     
    258273       
    259274        dir_entry.signature = [0x2e, 0x2e]
    260         dir_entry.name = '      '
    261         dir_entry.ext = '   '
     275        dir_entry.name = b'      '
     276        dir_entry.ext = b'   '
    262277        dir_entry.attr = 0x10
    263278       
Note: See TracChangeset for help on using the changeset viewer.