From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 3212146C21 for ; Sun, 5 Nov 2023 21:01:19 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 981B968CEFC; Sun, 5 Nov 2023 23:01:16 +0200 (EET) Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A0AB268CED8 for ; Sun, 5 Nov 2023 23:01:10 +0200 (EET) Received: by mail-lj1-f174.google.com with SMTP id 38308e7fff4ca-2c6b30acacdso51406411fa.2 for ; Sun, 05 Nov 2023 13:01:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699218069; x=1699822869; darn=ffmpeg.org; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=cA1QQE0Q89F1eyMM15KhdNvEjjBIqeCUtaG4vHt/388=; b=eRT2ATsiEUK+0E1i+WgVPSlawHkVZbQDiVGGFtWeVt8BXOidW6JMRR5Vmy9mmKe/3c rKiv4ZQVjJwB3XF6/IyYV26O5s4Of9m4kgj0ufVOs9mwXCigYpqPXKZEi/Fhm2xqQEiv pRq8N6PC5LHPaJ0bA5341sQIPnLUylJxoMJmwch0JLvUq3gbtIPv2WKkFlorpcbCABV9 PjJ+y0ifgIoVkQlemZ/vFt7nWIPZghO2jG0DEeSR6yxHlzsEtvajdokQQEO/z7uzYCCg JtMuFf/7Ue3296mNwRnfZ14HVcUQaJbU3UszOBYoTnCXt6/pfIpBI+vB9TQaC+6ffKq4 W5Wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699218069; x=1699822869; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cA1QQE0Q89F1eyMM15KhdNvEjjBIqeCUtaG4vHt/388=; b=uqOguBpP+nnYTh5RBJHo01YtiUibwmQfMrrTFHlJWpsALg5E4kDOUyiG0V5XZnaley hLA9jQybfl5IL0M7Na4tamWzamw5J9rV/Bte0Lh9tLQq6w8NAiFxS+ydZ1aID6EZMkx0 XlcTYAVPFQYDk9iEwDFNExhtdg0qz5tnu8tTmSGo1ZHjvwJlh2LyVPUelh/Qyhe6/LdY ntw7gsL4CRa6AfAicnIPyfZE57/6S8NXBLViYGpwXDYkqcecMEKrXbyJcbgaBsKWvpoJ XwG9ItpueDkDUiWR9rWL9XsjAVia3xA95tT2KSUJjzRJg9oe34GUhA6CMWhFJT0GyFHx i9Dw== X-Gm-Message-State: AOJu0YzDN1dj/NtPOnYp6sP3DnEb9LrHnjudkObuNWx0M8yj5Jaswwv4 FBlW0EVPxq/C0S4sWRmUJWYCWcLpQnVO1A== X-Google-Smtp-Source: AGHT+IFh5BdTiIAwa4XlHziTguWjtfZjnJY7UmauA5yn1s+4MJZtQdAC0zZyvwO2g+Z1Mv0Lkc8jyw== X-Received: by 2002:a2e:b529:0:b0:2bd:1cd0:6041 with SMTP id z9-20020a2eb529000000b002bd1cd06041mr19360331ljm.0.1699218068645; Sun, 05 Nov 2023 13:01:08 -0800 (PST) Received: from mariano (dynamic-adsl-84-220-189-10.clienti.tiscali.it. [84.220.189.10]) by smtp.gmail.com with ESMTPSA id o29-20020a05600c511d00b004083996dad8sm10006734wms.18.2023.11.05.13.01.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 13:01:08 -0800 (PST) Received: by mariano (Postfix, from userid 1000) id C8B7ABFCDA; Sun, 5 Nov 2023 22:01:06 +0100 (CET) Date: Sun, 5 Nov 2023 22:01:06 +0100 From: Stefano Sabatini To: FFmpeg development discussions and patches Message-ID: Mail-Followup-To: FFmpeg development discussions and patches , Frank Plowman References: <20231105135335.85752-1-post@frankplowman.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20231105135335.85752-1-post@frankplowman.com> User-Agent: Mutt/2.1.4 (2021-12-11) Subject: Re: [FFmpeg-devel] [PATCH] doc/t2h: Support texinfo 7.0 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Frank Plowman Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On date Sunday 2023-11-05 13:53:38 +0000, post@frankplowman.com wrote: > From: Frank Plowman > = > Texinfo 7.0, released in November 2022, changed the names of various > functions. Compiling docs with Texinfo 7.0 results in warnings and > improperly formatted documentation. More old names appear to have > been removed in Texinfo 7.1, released October 2023, which causes docs > compilation to fail. > = > This PR addresses the issue by adding logic to switch between the old > and new function names depending on the Texinfo version. > = > CC > https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1938238= .html > https://bugs.gentoo.org/916104 > = > Signed-off-by: Frank Plowman > --- > doc/t2h.pm | 97 +++++++++++++++++++++++++++++++++++++++++++----------- > 1 file changed, 78 insertions(+), 19 deletions(-) > = > diff --git a/doc/t2h.pm b/doc/t2h.pm > index d07d974286..1f23083703 100644 > --- a/doc/t2h.pm > +++ b/doc/t2h.pm > @@ -20,8 +20,41 @@ > # License along with FFmpeg; if not, write to the Free Software > # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-13= 01 USA > = > +#=A0Texinfo 7.0 changed the syntax of various functions. > +# Provide a shim for older versions. > +sub ff_set_from_init_file($$) { > + my $key =3D shift; > + my $value =3D shift; > + if (exists &{'texinfo_set_from_init_file'}) { > + texinfo_set_from_init_file($key, $value); > + } else { > + set_from_init_file($key, $value); > + } > +} > + > +sub ff_get_conf($) { > + my $key =3D shift; > + if (exists &{'texinfo_get_conf'}) { > + texinfo_get_conf($key); > + } else { > + get_conf($key); > + } > +} > + > +sub get_formatting_function($$) { > + my $obj =3D shift; > + my $func =3D shift; > + > + my $sub =3D $obj->can('formatting_function'); > + if ($sub) { > + return $obj->formatting_function($func); > + } else { > + return $obj->{$func}; > + } > +} > + > # no navigation elements > -set_from_init_file('HEADERS', 0); > +ff_set_from_init_file('HEADERS', 0); > = > sub ffmpeg_heading_command($$$$$) > { > @@ -55,7 +88,7 @@ sub ffmpeg_heading_command($$$$$) > $element =3D $command->{'parent'}; > } > if ($element) { > - $result .=3D &{$self->{'format_element_header'}}($self, $cmdname, > + $result .=3D &{get_formatting_function($self, 'format_element_he= ader')}($self, $cmdname, > $command, $elemen= t); > } > = > @@ -112,8 +145,8 @@ sub ffmpeg_heading_command($$$$$) > $cmdname > =3D $Texinfo::Common::level_to_structuring_command{$= cmdname}->[$heading_level]; > } > - $result .=3D &{$self->{'format_heading_text'}}( > - $self, $cmdname, $heading, > + $result .=3D &{get_formatting_function($self,'format_heading= _text')}( > + $self, $cmdname, [$heading], > $heading_level + > $self->get_conf('CHAPTER_HEADER_LEVEL') - 1, $co= mmand); > } > @@ -127,22 +160,22 @@ foreach my $command (keys(%Texinfo::Common::section= ing_commands), 'node') { > } > = > # determine if texinfo is at least version 6.8 > -my $program_version_num =3D version->declare(get_conf('PACKAGE_VERSION')= )->numify; > +my $program_version_num =3D version->declare(ff_get_conf('PACKAGE_VERSIO= N'))->numify; > my $program_version_6_8 =3D $program_version_num >=3D 6.008000; > = > # print the TOC where @contents is used > if ($program_version_6_8) { > - set_from_init_file('CONTENTS_OUTPUT_LOCATION', 'inline'); > + ff_set_from_init_file('CONTENTS_OUTPUT_LOCATION', 'inline'); > } else { > - set_from_init_file('INLINE_CONTENTS', 1); > + ff_set_from_init_file('INLINE_CONTENTS', 1); > } > = > # make chapters

> -set_from_init_file('CHAPTER_HEADER_LEVEL', 2); > +ff_set_from_init_file('CHAPTER_HEADER_LEVEL', 2); > = > # Do not add
> -set_from_init_file('DEFAULT_RULE', ''); > -set_from_init_file('BIG_RULE', ''); > +ff_set_from_init_file('DEFAULT_RULE', ''); > +ff_set_from_init_file('BIG_RULE', ''); > = > # Customized file beginning > sub ffmpeg_begin_file($$$) > @@ -159,7 +192,18 @@ sub ffmpeg_begin_file($$$) > my ($title, $description, $encoding, $date, $css_lines, > $doctype, $bodytext, $copying_comment, $after_body_open, > $extra_head, $program_and_version, $program_homepage, > - $program, $generator) =3D $self->_file_header_informations($comm= and); > + $program, $generator); > + if ($program_version_num >=3D 7.000000) { > + ($title, $description, $encoding, $date, $css_lines, > + $doctype, $bodytext, $copying_comment, $after_body_open, > + $extra_head, $program_and_version, $program_homepage, > + $program, $generator) =3D $self->_file_header_information($comm= and); > + } else { > + ($title, $description, $encoding, $date, $css_lines, > + $doctype, $bodytext, $copying_comment, $after_body_open, > + $extra_head, $program_and_version, $program_homepage, > + $program, $generator) =3D $self->_file_header_informations($com= mand); > + } nit: maybe can be refactored a bit to avoid the duplication (but my perl is rusty and I cannot test with texinfo 7.0): my $get_header_information_fn =3D $program_version_num >=3D 7.000000 ? $sel= f->_file_header_information : $self->_file_header_informations; my (...) =3D $get_header_information_fn($command); [...] Looks good otherwise, thanks. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".