|
Lines 395-401
strip_fils(Files) ->
Link Here
|
| 395 |
|
395 |
|
| 396 |
%% -> {ok, {Mod, FileName}} | {ok, {Mod, binary()}} | throw(Error) |
396 |
%% -> {ok, {Mod, FileName}} | {ok, {Mod, binary()}} | throw(Error) |
| 397 |
strip_file(File) -> |
397 |
strip_file(File) -> |
| 398 |
{ok, {Mod, Chunks}} = read_significant_chunks(File), |
398 |
{ok, {Mod, Chunks}} = read_unstripped_chunks(File), |
| 399 |
{ok, Stripped0} = build_module(Chunks), |
399 |
{ok, Stripped0} = build_module(Chunks), |
| 400 |
Stripped = compress(Stripped0), |
400 |
Stripped = compress(Stripped0), |
| 401 |
case File of |
401 |
case File of |
|
Lines 452-457
read_all_but_useless_chunks(File0) when is_atom(File0);
Link Here
|
| 452 |
is_useless_chunk("CInf") -> true; |
452 |
is_useless_chunk("CInf") -> true; |
| 453 |
is_useless_chunk(_) -> false. |
453 |
is_useless_chunk(_) -> false. |
| 454 |
|
454 |
|
|
|
455 |
read_unstripped_chunks(File) -> |
| 456 |
case read_chunk_data(File, unstripped_chunks(), [allow_missing_chunks]) of |
| 457 |
{ok, {Module, Chunks0}} -> |
| 458 |
Mandatory = mandatory_chunks(), |
| 459 |
Chunks = filter_significant_chunks(Chunks0, Mandatory, File, Module), |
| 460 |
{ok, {Module, Chunks}} |
| 461 |
end. |
| 462 |
|
| 455 |
%% -> {ok, {Module, Chunks}} | throw(Error) |
463 |
%% -> {ok, {Module, Chunks}} | throw(Error) |
| 456 |
read_significant_chunks(File) -> |
464 |
read_significant_chunks(File) -> |
| 457 |
case read_chunk_data(File, significant_chunks(), [allow_missing_chunks]) of |
465 |
case read_chunk_data(File, significant_chunks(), [allow_missing_chunks]) of |
|
Lines 836-841
error(Reason) ->
Link Here
|
| 836 |
throw({error, ?MODULE, Reason}). |
844 |
throw({error, ?MODULE, Reason}). |
| 837 |
|
845 |
|
| 838 |
|
846 |
|
|
|
847 |
unstripped_chunks() -> |
| 848 |
significant_chunks() ++ ["Attr"]. |
| 849 |
|
| 839 |
%% The following chunks are significant when calculating the MD5 for a module, |
850 |
%% The following chunks are significant when calculating the MD5 for a module, |
| 840 |
%% and also the modules that must be retained when stripping a file. |
851 |
%% and also the modules that must be retained when stripping a file. |
| 841 |
%% They are listed in the order that they should be MD5:ed. |
852 |
%% They are listed in the order that they should be MD5:ed. |
| 842 |
- |
|
|