David T. Lewis uploaded a new version of ImageFormat to project VM Maker:
http://source.squeak.org/VMMaker/ImageFormat-dtl.22.mcz==================== Summary ====================
Name: ImageFormat-dtl.22
Author: dtl
Time: 12 April 2017, 7:52:22.953 pm
UUID: 4abaa676-0204-4ac8-94a9-4ebe43a73949
Ancestors: ImageFormat-dtl.21
K K Subbu updates for magic file generation (vm-dev list)
=============== Diff against ImageFormat-dtl.21 ===============
Item was changed:
----- Method: ImageFormat class>>unixMagicFileEntries (in category 'unix magic file entries') -----
unixMagicFileEntries
"Answer a string that can be appended to /etc/magic on a Unix system to support the file(1) utility"
"ImageFormat unixMagicFileEntries"
" | fs |
fs := FileStream newFileNamed: 'magic'.
[ fs nextPutAll: ImageFormat unixMagicFileEntries ]
ensure: [ fs close ] "
^String streamContents: [:s |
s nextPutAll: '# Smalltalk image file formats'; lf.
KnownVersionNumbers do: [ :num | | fmt |
#( 'le' 'be' ) do: [ :endian |
fmt := self fromInteger: num.
(fmt is64Bit and: [ endian = 'be' ])
ifTrue: [ s nextPut: $4 ]
ifFalse: [ s nextPut: $0 ].
s tab;
nextPutAll: endian;
nextPutAll: 'long';
tab;
nextPutAll: num asString;
tab;
nextPutAll: 'Smalltalk '.
fmt printTerseDescriptionOn: s.
+ s lf.
+ s nextPutAll: '!!:mime application/'.
+ fmt requiresSpurSupport
+ ifTrue: [ s nextPutAll: 'spur']
+ ifFalse: [fmt requiresClosureSupport ifTrue: [ s nextPutAll: 'cog']
+ ifFalse: [s nextPutAll: 'squeak']].
+ fmt is64Bit ifTrue: [ s nextPutAll: '64'].
+ s nextPutAll: '-image'.
s lf
]
].
s lf.
]!
Item was changed:
----- Method: ImageFormat>>printTerseDescriptionOn: (in category 'printing') -----
printTerseDescriptionOn: stream
"Shortened description as may be required for unix magic file entries"
stream
nextPutAll: 'image ';
nextPutAll: (self requiresSpurSupport
ifTrue: [ 'Spur ' ]
ifFalse: [ 'V3 ' ]);
nextPutAll: (wordSize * 8) asString;
+ nextPutAll: 'b '.
+ self requiresClosureSupport ifTrue: [stream nextPutAll: '+C'].
+ self requiresNativeFloatWordOrder ifTrue: [stream nextPutAll: '+NF'].
+ self requiresNewSpur64TagAssignment ifTrue: [stream nextPutAll: '+Tag' ].
+ stream nextPutAll: ' (%d)'.
- nextPutAll: '-bit '.
- self requiresClosureSupport ifFalse: [stream nextPutAll: 'no '].
- stream nextPutAll: 'closure '.
- self requiresNativeFloatWordOrder
- ifTrue: [stream nextPutAll: 'native float']
- ifFalse: [stream nextPutAll: 'no native float'].
- stream nextPutAll: ' (';
- nextPutAll: self asInteger asString;
- nextPut: $).
^ stream
!