Skip to content

Commit ecd145e

Browse files
committed
use symlink not copying for cache-use
1 parent 1d888b9 commit ecd145e

File tree

3 files changed

+5
-15
lines changed

3 files changed

+5
-15
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,14 +303,12 @@ Commands
303303
- git clone git://github.com/travis-perl/helpers ~/travis-perl-helpers
304304
- source ~/travis-perl-helpers/init
305305
- build-perl
306-
- local-lib cache # makes a local::lib from cached
306+
- local-lib cache # makes a local::lib symlinked to cache
307307
- perl -V
308308
- build-dist
309309
- cd $BUILD_DIR
310310
install:
311311
- cpan-install --deps # installs prereqs, including recommends
312-
before_cache:
313-
- local-lib-cachestore # saves for local::lib next time
314312

315313
Alternatively, this will also work and the `build-perl` will do the
316314
`local-lib` step for you:

bin/local-lib-cache

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,10 @@ set -e
2727
if [ "$1" == "use" ]; then
2828
perlbrew lib create "$full_version"
2929
perlbrew use "$full_version"
30-
mkdir -p "$perlbrew_location"
31-
cp -pr "$cache_location"/* "$perlbrew_location"
32-
elif [ "$1" == "store" ]; then
33-
id
34-
echo "BEFORE"; find "$perlbrew_location" "$cache_location" -ls
35-
mkdir -p "$cache_location"
36-
cp -pr "$perlbrew_location"/* "$cache_location"
37-
echo "AFTER"; find "$cache_location" -ls
30+
rm -rf "$perlbrew_location"
31+
ln -s "$cache_location" "$perlbrew_location"
32+
[ -n "$TRAVIS_PERL_DEBUG" ] && \
33+
(id; echo "ON USE"; find "$perlbrew_location" "$cache_location" -ls)
3834
else
3935
echo "Unknown arg '$1'"
4036
exit 1

init

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,6 @@ function local-lib {
5353
eval "$("$HELPERS_ROOT/bin/local-lib" "$@")"
5454
}
5555

56-
function local-lib-cachestore {
57-
$HELPERS_ROOT/bin/local-lib-cache store
58-
}
59-
6056
function build-perl {
6157
local TRAVIS_PERL_VERSION="$TRAVIS_PERL_VERSION"
6258
if [[ ( "$TRAVIS_PERL_VERSION" =~ ^5\.6[.-] || \

0 commit comments

Comments
 (0)