Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use local-PERL-DIGEST for carton install

The DIGEST is based on the sha1sum of carton.lock. This
ensures that if carton.lock changes, a fresh library
directory will be created.

Note: the old library is not removed. This speeds reversion
as the old library is still available, but will cause
clutter over time.
  • Loading branch information...
commit 4cedc44951959298504e9537ab0c0d0c77cf729d 1 parent 985ec30
@dagolden authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 cookbooks/carton/providers/app.rb
10 cookbooks/carton/providers/app.rb
@@ -23,12 +23,18 @@
include Chef::Mixin::ShellOut
action :create do
+ # XXX should probably fail if no carton.lock is found in cwd
app_perlbrew = new_resource.perlbrew
- app_cwd = new_resource.cwd
app_user = new_resource.user
app_group =
- app_local = "local-#{app_perlbrew}"
+ app_cwd = new_resource.cwd
app_command = "carton exec -I lib -- #{new_resource.command}"
+ # hash carton.lock to ensure library dir is unique to a lock file
+ lock_hash = `sha1sum #{app_cwd}/carton.lock`[0..7]
+ app_local = "local-#{app_perlbrew}-#{lock_hash}"
app_env = new_resource.environment.merge({
'PERLBREW_ROOT' => node['perlbrew']['perlbrew_root'],
'PERLBREW_HOME' => node['perlbrew']['perlbrew_root'],
Please sign in to comment.
Something went wrong with that request. Please try again.