修复 nvmls 问题

This commit is contained in:
Aoran Zeng 2025-08-22 16:05:53 +08:00
parent 475e8f3060
commit e7aae2808d
No known key found for this signature in database
GPG Key ID: 8F8BA8488E10ED98
3 changed files with 67 additions and 54 deletions

View File

@ -12,6 +12,57 @@
#pragma once #pragma once
void
chef_debug_target (Target_t *target)
{
#ifdef XY_DEBUG
if (!target)
{
chsrc_debug2 ("target", "Target is NULL");
return;
}
say ("DEBUG Target Information:");
printf (" Aliases: %s\n", target->aliases);
printf (" Get Function: %p\n", target->getfn);
printf (" Set Function: %p\n", target->setfn);
printf (" Reset Function: %p\n", target->resetfn);
printf (" Prelude Function: %p\n", target->preludefn);
printf (" Inited?: %d\n", target->inited);
printf (" Sources: %p\n", target->sources);
printf (" Sources Count: %lld\n", target->sources_n);
printf (" Chef: %p\n", target->chef);
printf (" Cooks: %p\n", target->cooks);
printf (" Cooks Count: %lld\n", target->cooks_n);
printf (" Sauciers: %p\n", target->sauciers);
printf (" Sauciers Count: %lld\n", target->sauciers_n);
#endif
}
void
chef_debug_contributor (Contributor_t *contributor)
{
#ifdef XY_DEBUG
if (!contributor)
{
chsrc_debug2 ("contrib", "Contributor is NULL");
return;
}
say ("DEBUG Contributor Information:");
printf (" ID: %s\n", contributor->id);
printf (" Name: %s\n", contributor->name);
printf (" Email: %s\n", contributor->email);
printf (" DisplayName: %s\n", contributor->display_name);
#endif
}
/** /**
* @brief * @brief
* *
@ -107,7 +158,17 @@ chef_set_sources_speed_measure_url_with_postfix (Target_t *target, char *postfix
void void
chef_use_other_target_sources (Target_t *this, Target_t *other) chef_use_other_target_sources (Target_t *this, Target_t *other)
{ {
if (!other->inited) other->preludefn(); if (!other->inited)
{
if (other->preludefn)
other->preludefn();
else
{
chef_debug_target (other);
chsrc_panic ("`other` 未定义 _prelude() !");
}
}
this->sources = other->sources; this->sources = other->sources;
this->sources_n = other->sources_n; this->sources_n = other->sources_n;
} }
@ -309,54 +370,3 @@ chef_set_sources_last_updated (Target_t *target, char *date)
target->sources_last_updated = xy_strdup (date); target->sources_last_updated = xy_strdup (date);
} }
void
chef_debug_target (Target_t *target)
{
#ifdef XY_DEBUG
if (!target)
{
chsrc_debug2 ("target", "Target is NULL");
return;
}
say ("DEBUG Target Information:");
printf (" Aliases: %s\n", target->aliases);
printf (" Get Function: %p\n", target->getfn);
printf (" Set Function: %p\n", target->setfn);
printf (" Reset Function: %p\n", target->resetfn);
printf (" Prelude Function: %p\n", target->preludefn);
printf (" Inited?: %d\n", target->inited);
printf (" Sources: %p\n", target->sources);
printf (" Sources Count: %lld\n", target->sources_n);
printf (" Chef: %p\n", target->chef);
printf (" Cooks: %p\n", target->cooks);
printf (" Cooks Count: %lld\n", target->cooks_n);
printf (" Sauciers: %p\n", target->sauciers);
printf (" Sauciers Count: %lld\n", target->sauciers_n);
#endif
}
void
chef_debug_contributor (Contributor_t *contributor)
{
#ifdef XY_DEBUG
if (!contributor)
{
chsrc_debug2 ("contrib", "Contributor is NULL");
return;
}
say ("DEBUG Contributor Information:");
printf (" ID: %s\n", contributor->id);
printf (" Name: %s\n", contributor->name);
printf (" Email: %s\n", contributor->email);
printf (" DisplayName: %s\n", contributor->display_name);
#endif
}

View File

@ -45,7 +45,7 @@ pl_js_group_prelude (void)
def_target(pl_js_nodejs_binary, "__internal_use_nodejs_binary__"); def_target(pl_js_nodejs_binary, "__internal_target_nodejs_binary__");
void void
pl_js_nodejs_binary_prelude (void) pl_js_nodejs_binary_prelude (void)
@ -53,7 +53,7 @@ pl_js_nodejs_binary_prelude (void)
chef_prep_this (pl_js_nodejs_binary, NOOP); chef_prep_this (pl_js_nodejs_binary, NOOP);
chef_set_created_on (this, "2023-09-09"); chef_set_created_on (this, "2023-09-09");
chef_set_last_updated (this, "2025-07-11"); chef_set_last_updated (this, "2025-08-22");
chef_set_sources_last_updated (this, "2025-07-11"); chef_set_sources_last_updated (this, "2025-07-11");
chef_set_chef (this, NULL); chef_set_chef (this, NULL);

View File

@ -183,6 +183,9 @@ chsrc_init_menu ()
add (tex); add (tex);
add (anaconda); add (anaconda);
#undef add #undef add
// Internal Target 不会由用户使用,需要特殊对待
pl_js_nodejs_binary_target.preludefn = pl_js_nodejs_binary_prelude;
} }