Skip to content

Commit 8d58243

Browse files
committed
use symlink not copying for cache-use
1 parent 3a95af0 commit 8d58243

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
@@ -300,14 +300,12 @@ Commands
300300
- git clone git://github.com/travis-perl/helpers ~/travis-perl-helpers
301301
- source ~/travis-perl-helpers/init
302302
- build-perl
303-
- local-lib cache # makes a local::lib from cached
303+
- local-lib cache # makes a local::lib symlinked to cache
304304
- perl -V
305305
- build-dist
306306
- cd $BUILD_DIR
307307
install:
308308
- cpan-install --deps # installs prereqs, including recommends
309-
before_cache:
310-
- local-lib-cachestore # saves for local::lib next time
311309

312310
Alternatively, this will also work and the `build-perl` will do the
313311
`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)