[Python-modules-commits] r31083 - in packages/ply/trunk/debian (3 files)
arnau at users.alioth.debian.org
arnau at users.alioth.debian.org
Thu Oct 16 06:09:46 UTC 2014
Date: Thursday, October 16, 2014 @ 06:09:45
Author: arnau
Revision: 31083
Add dh_python3-ply to generate proper package Depends for Python3. Closes: #714099.
Added:
packages/ply/trunk/debian/dh_python3-ply
Modified:
packages/ply/trunk/debian/changelog
packages/ply/trunk/debian/python3-ply.install
Modified: packages/ply/trunk/debian/changelog
===================================================================
--- packages/ply/trunk/debian/changelog 2014-10-16 06:03:43 UTC (rev 31082)
+++ packages/ply/trunk/debian/changelog 2014-10-16 06:09:45 UTC (rev 31083)
@@ -10,6 +10,8 @@
+ d/p/*.patch: Cherry picked fixes from upstream VCS to resolve
compatibility issues with Python >= 3.3.
* d/control: bump Standards-Version to 3.9.6. No changes needed.
+ * Add dh_python3-ply to generate proper package Depends for Python3.
+ Closes: #714099.
-- Arnaud Fontaine <arnau at debian.org> Thu, 16 Oct 2014 14:33:15 +0900
Added: packages/ply/trunk/debian/dh_python3-ply
===================================================================
--- packages/ply/trunk/debian/dh_python3-ply (rev 0)
+++ packages/ply/trunk/debian/dh_python3-ply 2014-10-16 06:09:45 UTC (rev 31083)
@@ -0,0 +1,87 @@
+#!/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 <jwilk at debian.org>
+
+=cut
+
+# vim:ts=4 sw=4 et
Modified: packages/ply/trunk/debian/python3-ply.install
===================================================================
--- packages/ply/trunk/debian/python3-ply.install 2014-10-16 06:03:43 UTC (rev 31082)
+++ packages/ply/trunk/debian/python3-ply.install 2014-10-16 06:09:45 UTC (rev 31083)
@@ -1 +1,2 @@
debian/tmp/usr/lib/python3* usr/lib/
+debian/dh_python3-ply usr/bin/
More information about the Python-modules-commits
mailing list