summaryrefslogtreecommitdiff
path: root/travis/build-dep-zstd
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2018-02-24 01:57:42 +0100
committerDavid Sterba <dsterba@suse.com>2018-03-06 11:28:38 +0100
commitefc08d33907472f5c4bc2f6318400963bab994bc (patch)
treeefac241b6e229e07adde1a34d3a8d55f528a97f1 /travis/build-dep-zstd
parentf0a376df4733dc6f0f0cdc529f4e7df64806f3f6 (diff)
btrfs-progs: ci: cache built dependencies
For a slight speed up of the build, cache reiserfs and zstd. A quick cache validity is done, or it can be cleared manually on travis web UI. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'travis/build-dep-zstd')
-rwxr-xr-xtravis/build-dep-zstd18
1 files changed, 16 insertions, 2 deletions
diff --git a/travis/build-dep-zstd b/travis/build-dep-zstd
index 22369dd3..eae0be63 100755
--- a/travis/build-dep-zstd
+++ b/travis/build-dep-zstd
@@ -2,13 +2,27 @@
# download, build and install the zstd library
version=1.3.3
+dir=tmp-cached-zstd
+stamp="$dir/.last-build-zstd"
+here=`pwd`
set -e
-mkdir tmp-zstd
-cd tmp-zstd
+if [ -d "$dir" -a -f "$stamp" ]; then
+ echo "Using valid cache for $dir, built" `cat "$stamp"`
+ cd "$dir"
+ cd zstd-${version}
+ sudo make install PREFIX=/usr
+ exit 0
+fi
+
+echo "No or stale cache for $dir, rebuilding"
+rm -rf "$dir"
+mkdir "$dir"
+cd "$dir"
wget https://github.com/facebook/zstd/archive/v${version}.tar.gz
tar xf v${version}.tar.gz
cd zstd-${version}
make
sudo make install PREFIX=/usr
+date > "$here/$stamp"