| Server IP : 104.21.4.30 / Your IP : 172.71.81.81 Web Server : Apache System : Linux keen-cori.18-142-40-148.plesk.page 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 06:59:36 UTC 2025 x86_64 User : simottodesign.com_2tntp341vs7 ( 10011) PHP Version : 8.3.31 Disable Function : opcache_get_status MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /bin/ |
Upload File : |
#!/usr/bin/perl
=head1 NAME
dh_python3-ply - generate versioned dependencies on python3-ply
=cut
use strict;
use warnings;
use Debian::Debhelper::Dh_Lib;
=head1 SYNOPSIS
B<dh_python3-ply> [B<--dependency-field> I<dependencyfield>] [S<I<debhelper options>>] I<file>...
=head1 DESCRIPTION
B<dh_python3-ply> is a debhelper program that is responsible for generating the
B<python3-ply:Depends> substitutions and adding them to substvars files.
The program will look only at Python3 modules that are explicitly provided as
its arguments, and will use this information to generate a strict versioned
dependency on B<python3-ply>.
=head1 OPTIONS
=over 4
=item B<--dependency-field> I<dependencyfield>
Use B<python3-ply:>I<dependencyfield> substitution variable instead of
B<python3-ply:Depends>.
=back
=cut
my $dependency_field = "Depends";
init(options => { "dependency-field:s" => \$dependency_field });
if (not @ARGV)
{
error("at least one argument is required")
}
foreach my $filename (@ARGV)
{
open FILE, $filename or error("cannot read $filename: $!");
read FILE, $_, 1024;
my $is_lextab = /^_lextokens\b/m;
my $is_parsetab = /^_lr_method\b/m;
$is_lextab or $is_parsetab or error("$filename doesn't look like a PLY table");
(my $tabversion) = /^_tabversion\s*=\s*'([0-9.]+)'/m or error("$filename was generated by a very old PLY");
my $dependency = sprintf "python3-ply-%s-%s", $is_lextab ? "lex" : "yacc", $tabversion;
# Prefer real package names of "old" versions of PLY for easier upgrades from squeeze:
if ($dependency eq "python3-ply-yacc-3.2")
{
# PLY 3.2, 3.3 and 3.4 embeds the same version number (3.2) in parser tables.
$dependency = "python3-ply (>= 3.2), python3-ply (<< 3.5) | $dependency";
}
elsif ($dependency eq "python3-ply-lex-3.3")
{
# PLY 3.3 and 3.4 embeds their own version number in lexer tables.
$dependency = "python3-ply (>= 3.3), python3-ply (<< 3.4) | $dependency";
}
foreach my $package (@{$dh{DOPACKAGES}})
{
addsubstvar($package, "python3-ply:$dependency_field", $dependency);
}
}
=head1 SEE ALSO
L<debhelper(7)>
This program is not a part of debhelper, but it is meant to be used together with it.
=head1 AUTHOR
Jakub Wilk <[email protected]>
=cut
# vim:ts=4 sw=4 et