This repository was archived by the owner on Jan 15, 2021. It is now read-only.
File tree 3 files changed +29
-5
lines changed
3 files changed +29
-5
lines changed Original file line number Diff line number Diff line change @@ -482,6 +482,24 @@ def provider(
482
482
if r :
483
483
r .setTestDependency (dspec .is_test_dependency )
484
484
return r
485
+ # before resorting to install this module, check if we have an
486
+ # existing linked module (which wasn't picked up because it didn't
487
+ # match the version specification) - if we do, then we shouldn't
488
+ # try to install, but should return that anyway:
489
+ default_path = os .path .join (self .modulesPath (), dspec .name )
490
+ if fsutils .isLink (default_path ):
491
+ r = Component (
492
+ default_path ,
493
+ test_dependency = dspec .is_test_dependency ,
494
+ installed_linked = fsutils .isLink (default_path )
495
+ )
496
+ if r :
497
+ assert (r .installedLinked ())
498
+ return r
499
+ else :
500
+ logger .error ('linked module %s is invalid: %s' , dspec .name , r .getError ())
501
+ return r
502
+
485
503
r = access .satisfyVersionByInstalling (dspec .name , dspec .version_req , self .modulesPath ())
486
504
if not r :
487
505
logger .error ('could not install %s' % name )
Original file line number Diff line number Diff line change @@ -139,8 +139,9 @@ def __init__(
139
139
raise Exception ('missing "version"' )
140
140
except Exception as e :
141
141
self .description = OrderedDict ()
142
+ self .error = "Description invalid %s: %s" % (description_file , e );
142
143
logger .debug (self .error )
143
- raise InvalidDescription ("Description invalid %s: %s" % ( description_file , e ) )
144
+ raise InvalidDescription (self . error )
144
145
else :
145
146
self .error = "No %s file." % description_filename
146
147
self .description = OrderedDict ()
Original file line number Diff line number Diff line change @@ -120,7 +120,8 @@ def format(
120
120
indent = u'' ,
121
121
tee = u'' ,
122
122
installed_at = u'' ,
123
- test_dep = False
123
+ test_dep = False ,
124
+ spec = None
124
125
):
125
126
r = u''
126
127
@@ -169,7 +170,9 @@ def shouldDisplay(x):
169
170
170
171
171
172
line = indent [:- 2 ] + tee + component .getName () + u' ' + DIM + str (component .getVersion ()) + RESET
172
-
173
+
174
+ if spec and not spec .match (component .getVersion ()):
175
+ line += u' ' + RESET + BRIGHT + RED + str (spec ) + RESET
173
176
if test_dep :
174
177
line += u' ' + DIM + u'(test dependency)' + RESET
175
178
if len (installed_at ):
@@ -220,7 +223,8 @@ def shouldDisplay(x):
220
223
processed ,
221
224
next_indent ,
222
225
next_tee ,
223
- test_dep = isTestOnly (name )
226
+ test_dep = isTestOnly (name ),
227
+ spec = spec
224
228
)
225
229
else :
226
230
r += self .format (
@@ -229,7 +233,8 @@ def shouldDisplay(x):
229
233
next_indent ,
230
234
next_tee ,
231
235
installed_at = relpathIfSubdir (dep .path ),
232
- test_dep = isTestOnly (name )
236
+ test_dep = isTestOnly (name ),
237
+ spec = spec
233
238
)
234
239
else :
235
240
r += indent + tee + DIM + name + spec_descr + RESET + '\n '
You can’t perform that action at this time.
0 commit comments