maintenance: Add 'verify' action to manageForeignResources.php
authorTimo Tijhof <krinklemail@gmail.com>
Sun, 19 Aug 2018 23:02:29 +0000 (00:02 +0100)
committerTimo Tijhof <krinklemail@gmail.com>
Sat, 25 Aug 2018 21:45:00 +0000 (22:45 +0100)
commitc5c21bcfa315ad42c9853d92ef08dc0ed895f19b
treed5cb7902a2ebf984041765631d3ced9e17443821
parentcfc1bc4907454e9545340bae79c39e5bf37a592e
maintenance: Add 'verify' action to manageForeignResources.php

* Instead of having --update and --make-sri which oddly overlap
  in less-than-intuitive ways (with dry-run in there as well),
  refactor with three simple modes:
  - make-sri: Only validates 'integrity' attribute with remote resource
              and prints it.
  - verify:   Extract files temporarily and compare with current /resources/lib/.
              Fail if diffferent.
  - update:   Extract files temporarily and move to /resources/lib/.

* Abtract code for 'tar' handling in preparation for addition of
  a 'file' and 'multi-file' type in later commits.

* Fix bug where tmp dir was not cleaned up by fatalError().

Change-Id: I5ca3749533496824d2c40ebb5ebe9e570da7ac8a
maintenance/resources/foreign-resources.yaml
maintenance/resources/manageForeignResources.php