Changeset 10ef329a in mainline
- Timestamp:
- 2008-05-28T17:30:53Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ff48a15
- Parents:
- 5a55ae6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/mktmpfs.py
r5a55ae6 r10ef329a 49 49 return 50 50 51 outf = file(sys.argv[2], "w"); 51 header_size = 18 52 payload_size = 0 53 outf = file(sys.argv[2], "w") 54 outf.write(struct.pack("<" + ("%d" % header_size) + "x")) 52 55 53 56 for root, dirs, files in os.walk(path): … … 56 59 canon = os.path.join(relpath, name) 57 60 outf.write(struct.pack("<BL" + ("%d" % len(canon)) + "s", 1, len(canon), canon)) 61 payload_size += 5 + len(canon) 58 62 59 63 fn = os.path.join(root, name) … … 61 65 rd = 0; 62 66 outf.write(struct.pack("<L", size)) 67 payload_size += 4 63 68 64 69 inf = file(fn, "r") … … 66 71 data = inf.read(4096); 67 72 outf.write(data) 73 payload_size += len(data) 68 74 rd += len(data) 69 75 inf.close() … … 72 78 canon = os.path.join(relpath, name) 73 79 outf.write(struct.pack("<BL" + ("%d" % len(canon)) + "s", 2, len(canon), canon)) 80 payload_size += 5 + len(canon) 74 81 82 outf.seek(0) 83 outf.write(struct.pack("<4sBBLQ", "HORD", 1, 1, header_size, payload_size)) 75 84 outf.close() 76 85
Note:
See TracChangeset
for help on using the changeset viewer.