diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2021-11-16 14:09:57 +0100 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2021-11-22 10:42:58 +0100 |
| commit | c12b2c8a4a8191a97ff13ce70340f8a84020ac10 (patch) | |
| tree | 69048e3e442b7b477b53a032a181976c68f5a7e6 | |
| parent | 1e3a45c5bc8a07d219a78365f23b9cc5ad644b24 (diff) | |
| download | mullvadvpn-c12b2c8a4a8191a97ff13ce70340f8a84020ac10.tar.xz mullvadvpn-c12b2c8a4a8191a97ff13ce70340f8a84020ac10.zip | |
Scripts: fix PDF creation date metadata for reproducible output
| -rwxr-xr-x | ios/convert-assets.rb | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/ios/convert-assets.rb b/ios/convert-assets.rb index a7913f91cb..ebcc5a9056 100755 --- a/ios/convert-assets.rb +++ b/ios/convert-assets.rb @@ -84,6 +84,12 @@ ADDITIONAL_ASSETS = [ "IconBackTransitionMask.svg" ] +# SVG convertion tool environment variables. +SVG_CONVERT_ENVIRONMENT_VARIABLES = { + # Fix PDF "CreationDate" for reproducible output + "SOURCE_DATE_EPOCH" => "1596022781" +} + # Functions def generate_graphical_assets() @@ -100,7 +106,7 @@ def generate_graphical_assets() output_file = File.join(output_dir, "#{image_name}.pdf") puts "Convert #{svg_file} -> #{output_file}" - system("rsvg-convert", "--format=pdf", svg_file, "--output", output_file) + system(SVG_CONVERT_ENVIRONMENT_VARIABLES, "rsvg-convert", "--format=pdf", svg_file, "--output", output_file) end end @@ -118,9 +124,6 @@ def genereate_app_icon() end def generate_additional_assets() - # Fix PDF "CreationDate" for reproducible output - environment_variables = { "SOURCE_DATE_EPOCH" => "1596022781" } - for asset_name in ADDITIONAL_ASSETS do svg_file = File.join(ADDITIONAL_ASSETS_DIR, asset_name) image_name = File.basename(svg_file, ".svg") @@ -133,7 +136,7 @@ def generate_additional_assets() end puts "Generate #{image_name} -> #{output_file}" - system(environment_variables, "rsvg-convert", "-f", "pdf", "-o", output_file, svg_file) + system(SVG_CONVERT_ENVIRONMENT_VARIABLES, "rsvg-convert", "--format=pdf", svg_file, "--output", output_file) end end |
