diff --git a/src/framework/chef.h b/src/framework/chef.h index 11f677e..34f9062 100644 --- a/src/framework/chef.h +++ b/src/framework/chef.h @@ -51,6 +51,29 @@ chef_ensure_trailing_slash (char *str) #define chef_has_reset() this->resetfn = t##_resetsrc; +void +chef_allow_user_define (Target_t *target) +{ + if (!target) + return; + + target->can_user_define = true; + target->can_user_define_explain = NULL; +} + +void +chef_forbid_user_define (Target_t *target) +{ + if (!target) + return; + + target->can_user_define = false; + + char *reason = CHINESE ? "URL将会根据内部实现重写,因此不能自定义" : "The URL will be rewritten based on internal implementation, so it cannot be customized"; + target->can_user_define_explain = reason; +} + + void chef_set_contributors (Target_t *target, uint32_t count, ...) { diff --git a/src/recipe/recipe-template.c b/src/recipe/recipe-template.c index 4fde7fa..3ab55d5 100644 --- a/src/recipe/recipe-template.c +++ b/src/recipe/recipe-template.c @@ -52,7 +52,7 @@ void { use_this(_); - chef_set_created_on (this, "2025-08-09"); + chef_set_created_on (this, "2024-08-09"); chef_set_last_updated (this, "2025-08-12"); chef_set_sources_last_updated (this, "2025-08-10"); @@ -62,13 +62,17 @@ void chef_set_contributors (this, 1, "Nil Null", "nil@null.org"); - chef_has_getfn(); - chef_has_setfn(); - chef_has_resetsrc(); - this.cap_locally = PartiallyCan; - this.cap_locally_explain = "具体说明是否支持项目级换源..."; + chef_has_get(); + chef_has_set(); + chef_has_reset(); + this.cap_local = PartiallyCan; + this.cap_local_explain = "具体说明是否支持项目级换源..."; + this.can_english = false; this.can_user_define = false; + // chef_allow_user_define(this); + chef_forbid_user_define(this); + this.note = "备注说明..."; def_upstream("https://github.com/microsoft/winget-cli/");