saltstack-formulas / mysql-formula

Install the MySQL client and/or server
http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
85 stars 367 forks source link

Only download archive if necessary [macos] #214

Closed noelmcloughlin closed 5 years ago

noelmcloughlin commented 5 years ago

It is wasteful downloading fresh archive if cached one already exists (with valid checksum).

This PR implements the improvement.

noelmcloughlin commented 5 years ago

Great question @vschumaker Yes we have to check the hashsum - I changed onchanges to require to ensure its checked.

mysql-macos-check-{{ product }}-archive-hash:
   module.run:
     - name: file.check_hash
     - path: {{ dl.tmpdir }}/{{ archivefile }}
     - file_hash: {{ data.sum }}
     - require:               <===== here
       - cmd: mysql-macos-download-{{ product }}-archive