File: run-spread

package info (click to toggle)
snapd 2.72-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 80,412 kB
  • sloc: sh: 16,506; ansic: 16,211; python: 11,213; makefile: 1,919; exp: 190; awk: 58; xml: 22
file content (36 lines) | stat: -rwxr-xr-x 827 bytes parent folder | download | duplicates (2)
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
#!/bin/bash
set -xeu

need_rebuild=1

shopt -s nullglob

if [ "${NO_REBUILD:-0}" = "1" ]; then
    echo "-- $(date) -- requested no snap rebuild"
    need_rebuild=0

    # check if we have any snaps built at all
    built_snaps=(built-snap/snapd_*.snap.keep)
    if (( "${#built_snaps[@]}" > 0 )); then
        echo "-- $(date) -- found prebuilt snapd snaps:"
        for s in "${built_snaps[@]}"; do
            echo "--   $s"
        done
    else
        echo "-- $(date) -- no prebuilt snaps found"
        need_rebuild=1
    fi
fi

if [ "$need_rebuild" = 1 ]; then
    echo "-- $(date) -- rebuilding snapd snap"
    ./tests/build-test-snapd-snap
    echo "-- $(date) -- snapd snap rebuild complete"
fi

if [ -t 1 ]; then
    export SPREAD_DEBUG_EACH=0
fi

# Run spread
SPREAD_USE_PREBUILT_SNAPD_SNAP=true exec spread "$@"