diff --git a/internal/runbits/requirements/requirements.go b/internal/runbits/requirements/requirements.go index bc736fb390..1b0e82c6ac 100644 --- a/internal/runbits/requirements/requirements.go +++ b/internal/runbits/requirements/requirements.go @@ -91,6 +91,7 @@ type ErrNoMatches struct { // The refactor should clean this up. func (r *RequirementOperation) ExecuteRequirementOperation( requirementName, requirementVersion string, + requirementBitWidth int, operation bpModel.Operation, ns *model.Namespace, nsType *model.NamespaceType, ts *time.Time) (rerr error) { defer r.rationalizeError(&rerr) @@ -130,10 +131,14 @@ func (r *RequirementOperation) ExecuteRequirementOperation( } else { logging.Debug("Could not get language from project: %v", err) } + case model.NamespaceLanguage: + ns = ptr.To(model.NewNamespaceLanguage()) + case model.NamespacePlatform: + ns = ptr.To(model.NewNamespacePlatform()) } } - var validatePkg = operation == bpModel.OperationAdded && (ns.Type() == model.NamespacePackage || ns.Type() == model.NamespaceBundle) + var validatePkg = operation == bpModel.OperationAdded && ns != nil && (ns.Type() == model.NamespacePackage || ns.Type() == model.NamespaceBundle) if (ns == nil || !ns.IsValid()) && nsType != nil && (*nsType == model.NamespacePackage || *nsType == model.NamespaceBundle) { pg = output.StartSpinner(out, locale.Tr("progress_pkg_nolang", requirementName), constants.TerminalAnimationInterval) @@ -243,8 +248,6 @@ func (r *RequirementOperation) ExecuteRequirementOperation( } timestamp := strfmt.DateTime(*ts) - // MUST ADDRESS: we're no longer passing bitwidth, but this needs it. Need to figure out why. - requirementBitWidth := -1 name, version, err := model.ResolveRequirementNameAndVersion(requirementName, requirementVersion, requirementBitWidth, *ns) if err != nil { return errs.Wrap(err, "Could not resolve requirement name and version") diff --git a/internal/runners/languages/install.go b/internal/runners/languages/install.go index 01e9002189..3312512a9f 100644 --- a/internal/runners/languages/install.go +++ b/internal/runners/languages/install.go @@ -70,7 +70,7 @@ func (u *Update) Run(params *UpdateParams) error { return errs.Wrap(err, "Could not create requirement operation.") } - err = op.ExecuteRequirementOperation(lang.Name, lang.Version, bpModel.OperationAdded, nil, &model.NamespaceLanguage, nil) + err = op.ExecuteRequirementOperation(lang.Name, lang.Version, 0, bpModel.OperationAdded, nil, &model.NamespaceLanguage, nil) if err != nil { return locale.WrapError(err, "err_language_update", "Could not update language: {{.V0}}", lang.Name) } diff --git a/internal/runners/packages/install.go b/internal/runners/packages/install.go index 209505131e..b5c7d1b1f8 100644 --- a/internal/runners/packages/install.go +++ b/internal/runners/packages/install.go @@ -42,6 +42,7 @@ func (a *Install) Run(params InstallRunParams, nsType model.NamespaceType) (rerr return requirements.NewRequirementOperation(a.prime).ExecuteRequirementOperation( params.Package.Name, params.Package.Version, + 0, bpModel.OperationAdded, ns, nsTypeV, diff --git a/internal/runners/packages/uninstall.go b/internal/runners/packages/uninstall.go index 31898d01d6..272d5ba054 100644 --- a/internal/runners/packages/uninstall.go +++ b/internal/runners/packages/uninstall.go @@ -45,6 +45,7 @@ func (u *Uninstall) Run(params UninstallRunParams, nsType model.NamespaceType) ( return requirements.NewRequirementOperation(u.prime).ExecuteRequirementOperation( params.Package.Name, "", + 0, bpModel.OperationRemoved, ns, nsTypeV, diff --git a/internal/runners/platforms/add.go b/internal/runners/platforms/add.go index 1a8724dee0..3b29aaa63c 100644 --- a/internal/runners/platforms/add.go +++ b/internal/runners/platforms/add.go @@ -52,6 +52,7 @@ func (a *Add) Run(ps AddRunParams) error { if err := requirements.NewRequirementOperation(a.prime).ExecuteRequirementOperation( params.name, params.version, + params.BitWidth, bpModel.OperationAdded, nil, &model.NamespacePlatform, diff --git a/internal/runners/platforms/remove.go b/internal/runners/platforms/remove.go index 0961b2b5bf..aa19a158e3 100644 --- a/internal/runners/platforms/remove.go +++ b/internal/runners/platforms/remove.go @@ -42,6 +42,7 @@ func (r *Remove) Run(ps RemoveRunParams) error { if err := requirements.NewRequirementOperation(r.prime).ExecuteRequirementOperation( params.name, params.version, + params.BitWidth, bpModel.OperationRemoved, nil, &model.NamespacePlatform,