@@ -493,27 +493,28 @@ def getPackageList(packages, specs, configDir, preferSystem, noSystem,
493493 if re .match (replacement_matcher , key ):
494494 replacement = spec ["prefer_system_replacement_specs" ][replacement_matcher ]
495495 break
496- dieOnError ( replacement is None , "Could not find named replacement spec for "
497- "%s: %s" % ( spec [ "package" ], key ))
498- assert ( replacement )
499- # We must keep the package name the same, since it is used to
500- # specify dependencies.
501- replacement [ "package" ] = spec [ " package" ]
502- # The version is required for all specs. What we put there will
503- # influence the package's hash, so allow the user to override it.
504- replacement . setdefault ( " version" , requested_version )
505- spec = replacement
506- # Allows generalising the version based on the actual key provided
507- spec [ "version" ] = spec [ "version" ]. replace ( "%(key)s" , key )
508- recipe = replacement . get ( "recipe" , "" )
509- # If there's an explicitly-specified recipe, we're still building
510- # the package. If not, aliBuild will still "build" it, but it's
511- # basically instantaneous, so report to the user that we're taking
512- # it from the system.
513- if recipe :
514- ownPackages .add (spec ["package" ])
496+ if replacement :
497+ # We must keep the package name the same, since it is used to
498+ # specify dependencies.
499+ replacement [ " package" ] = spec [ "package" ]
500+ # The version is required for all specs. What we put there will
501+ # influence the package's hash, so allow the user to override it.
502+ replacement . setdefault ( " version" , requested_version )
503+ spec = replacement
504+ # Allows generalising the version based on the actual key provided
505+ spec [ "version" ] = spec [ "version" ]. replace ( "%(key)s" , key )
506+ recipe = replacement . get ( "recipe" , "" )
507+ # If there's an explicitly-specified recipe, we're still building
508+ # the package. If not, aliBuild will still "build" it, but it's
509+ # basically instantaneous, so report to the user that we're taking
510+ # it from the system.
511+ if recipe :
512+ ownPackages . add ( spec [ "package" ])
513+ else :
514+ systemPackages .add (spec ["package" ])
515515 else :
516- systemPackages .add (spec ["package" ])
516+ warning (f"Could not find named replacement spec for { spec ['package' ]} : { key } , "
517+ "falling back to building the package ourselves." )
517518
518519 dieOnError (("system_requirement" in spec ) and recipe .strip ("\n \t " ),
519520 "System requirements %s cannot have a recipe" % spec ["package" ])
0 commit comments