pdb: fix GIR annotation format for Deprecated tag.

I just realized that the way we have been using "Deprecated:" tag was
wrong. It has a version first, then further descriptive text.

Fixes display "Deprecated since: Unknown" in gi-docgen documentation.
This commit is contained in:
Jehan 2026-02-01 22:33:49 +01:00
parent c8c8a68247
commit 3a9ab1c419
2 changed files with 6 additions and 4 deletions

View file

@ -550,6 +550,7 @@ CODE
my $procdesc = '';
if ($proc->{deprecated}) {
$deprecated_since = $proc->{deprecated_since};
if ($proc->{deprecated} eq 'NONE') {
if ($proc->{blurb}) {
$procdesc = &desc_wrap($proc->{blurb}) . "\n *\n";
@ -557,7 +558,7 @@ CODE
if ($proc->{help}) {
$procdesc .= &desc_wrap($proc->{help}) . "\n *\n";
}
$procdesc .= &desc_wrap("Deprecated: There is no replacement " .
$procdesc .= &desc_wrap("Deprecated: $deprecated_since: There is no replacement " .
"for this procedure.");
}
else {
@ -583,7 +584,7 @@ CODE
if ($proc->{help}) {
$procdesc .= &desc_wrap($proc->{help}) . "\n *\n";
}
$procdesc .= &desc_wrap("Deprecated: " .
$procdesc .= &desc_wrap("Deprecated: $deprecated_since: " .
"Use $replacement instead.");
}
}

View file

@ -67,8 +67,9 @@ $evalcode = <<'CODE';
};
# Variables to evaluate and insert into the PDB structure
my @procvars = qw($name $group $blurb $help $author $copyright $date $since
$deprecated @inargs @outargs %invoke $canonical_name
my @procvars = qw($name $group $blurb $help $author $copyright $date
$since $deprecated $deprecated_since
@inargs @outargs %invoke $canonical_name
$lib_private $skip_gi);
# These are attached to the group structure