File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ type depot struct {
5555 depotPath string
5656 artifacts map [strfmt.UUID ]struct {}
5757 fsMutex * sync.Mutex
58- supportsHardLinks bool
58+ SupportsHardLinks bool
5959}
6060
6161func newDepot (runtimePath string ) (* depot , error ) {
@@ -78,7 +78,7 @@ func newDepot(runtimePath string) (*depot, error) {
7878 depotPath : depotPath ,
7979 artifacts : map [strfmt.UUID ]struct {}{},
8080 fsMutex : & sync.Mutex {},
81- supportsHardLinks : supportsHardLinks (depotPath ),
81+ SupportsHardLinks : supportsHardLinks (depotPath ),
8282 }
8383
8484 if ! fileutils .TargetExists (depotPath ) {
@@ -148,8 +148,8 @@ func (d *depot) Put(id strfmt.UUID) error {
148148
149149// DeployViaLink will take an artifact from the depot and link it to the target path.
150150func (d * depot ) DeployViaLink (id strfmt.UUID , relativeSrc , absoluteDest string ) error {
151- if ! d .supportsHardLinks {
152- return d . DeployViaCopy ( id , relativeSrc , absoluteDest )
151+ if ! d .SupportsHardLinks {
152+ return errs . New ( "depot does not support hard links; use copy instead" )
153153 }
154154
155155 d .fsMutex .Lock ()
Original file line number Diff line number Diff line change @@ -470,10 +470,14 @@ func (s *setup) install(id strfmt.UUID) (rerr error) {
470470 if err := envDef .ApplyFileTransforms (s .path ); err != nil {
471471 return errs .Wrap (err , "Could not apply env transforms" )
472472 }
473- } else {
473+ } else if s . depot . SupportsHardLinks {
474474 if err := s .depot .DeployViaLink (id , envDef .InstallDir , s .path ); err != nil {
475475 return errs .Wrap (err , "Could not deploy artifact via link" )
476476 }
477+ } else {
478+ if err := s .depot .DeployViaCopy (id , envDef .InstallDir , s .path ); err != nil {
479+ return errs .Wrap (err , "Could not deploy artifact via copy" )
480+ }
477481 }
478482
479483 return nil
You can’t perform that action at this time.
0 commit comments