File: 0013-ensure-that-missing-assets-result-in-failure.patch

package info (click to toggle)
openqa 5.1754383059.0426baa1d-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 17,888 kB
  • sloc: perl: 57,226; sql: 26,462; javascript: 8,408; xml: 2,229; sh: 1,690; makefile: 438; python: 249
file content (37 lines) | stat: -rw-r--r-- 1,008 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
From: Philip Hands <phil@hands.com>
Date: Fri, 31 Dec 2021 11:57:37 +0100
Subject: ensure that missing assets result in failure

---
 tools/generate-packed-assets | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tools/generate-packed-assets b/tools/generate-packed-assets
index 6bfb436..e857662 100755
--- a/tools/generate-packed-assets
+++ b/tools/generate-packed-assets
@@ -31,6 +31,8 @@
 BUILD_CACHE="plugin AssetPack => LoadFile(app->home->child('assets', 'assetpack.yml')) and app->asset->process()"
 BUILD_CACHE_OPTS='-Ilib/ -MMojolicious::Lite -MYAML::PP=LoadFile'
 
+MISSING=0
+
 generate() {
     local rc=0
     # shellcheck disable=SC2039
@@ -40,8 +42,15 @@ generate() {
         rc=$?
         sleep 1
     done
+    MISSING=1
     return "$rc"
 }
 
 generate "test" || exit $?
 generate "development" || exit $?
+
+if [ "$GENERATE_PACKED_ASSETS_FAILS_ON_MISSING_ASSETS" ]; then
+    # for Debian packaging, fail at this point if any assets are missing
+    exit $MISSING
+fi
+exit 0