This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch main in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=42a5742fc7e8bdc713788afd97ef84de0f1f8e6e commit 42a5742fc7e8bdc713788afd97ef84de0f1f8e6e Author: Guillem Jover <[email protected]> AuthorDate: Thu Dec 5 00:09:11 2024 +0100 Dpkg::Vendor: Remove backwards compatibility module and origin name mangling The naming for origin files and vendor Perl modules was rationalized during the 1.21.x release cycle, and was slated for removal in the 1.22.x release cycle (the current one). The code has been emitting warnings when using the affected names, and the documentation has mentioned this as well. It seems safe to remove the backwards compatibility code. --- man/deb-origin.pod | 11 ---------- scripts/Dpkg/Vendor.pm | 57 ++++++-------------------------------------------- 2 files changed, 6 insertions(+), 62 deletions(-) diff --git a/man/deb-origin.pod b/man/deb-origin.pod index 9342e06e9..a0a6f10f7 100644 --- a/man/deb-origin.pod +++ b/man/deb-origin.pod @@ -57,17 +57,6 @@ name will be tried in sequence by lower-casing it, keeping it as is, lower-casing then capitalizing it (that is upper-casing the first character), and only capitalizing it. -In addition, for historical and backwards compatibility, the name will -be tried keeping it as is without non-alphanumeric characters remapping, -then the resulting name will be tried in sequence by lower-casing it, -keeping it as is, lower-casing then capitalizing it, and only capitalizing it. -And finally the name will be tried by remapping spaces to dashes (‘B<->’), -then the resulting name will be tried in sequence by lower-casing it, -keeping it as is, lower-casing then capitalizing it, and only capitalizing it. - -But these backwards compatible module lookups will be removed during the -dpkg 1.22.x release cycle. - =head1 FIELDS =over diff --git a/scripts/Dpkg/Vendor.pm b/scripts/Dpkg/Vendor.pm index f101246b5..67ddb5880 100644 --- a/scripts/Dpkg/Vendor.pm +++ b/scripts/Dpkg/Vendor.pm @@ -42,7 +42,7 @@ file can have the same casing as the Vendor field, or it can be capitalized. =cut -package Dpkg::Vendor 1.02; +package Dpkg::Vendor 1.03; use strict; use warnings; @@ -120,17 +120,6 @@ number of non-alphanumeric characters (that is B<[^A-Za-z0-9]>) into "B<->", then the resulting name will be tried in sequence by lower-casing it, keeping it as is, lower-casing then capitalizing it, and capitalizing it. -In addition, for historical and backwards compatibility, the name will -be tried keeping it as is without non-alphanumeric characters remapping, -then the resulting name will be tried in sequence by lower-casing it, -keeping it as is, lower-casing then capitalizing it, and capitalizing it. -And finally the name will be tried by replacing only spaces to "B<->", -then the resulting name will be tried in sequence by lower-casing it, -keeping it as is, lower-casing then capitalizing it, and capitalizing it. - -But these backwards compatible name lookups will be removed during -the dpkg 1.22.x release cycle. - =cut sub get_vendor_file { @@ -140,27 +129,8 @@ sub get_vendor_file { my $vendor_sep = $vendor =~ s{$vendor_sep_regex}{-}gr; push @names, lc $vendor_sep, $vendor_sep, ucfirst lc $vendor_sep, ucfirst $vendor_sep; - # XXX: Backwards compatibility, remove on 1.22.x. - my %name_seen = map { $_ => 1 } @names; - my @obsolete_names = uniq grep { - my $seen = exists $name_seen{$_}; - $name_seen{$_} = 1; - not $seen; - } ( - (lc $vendor, $vendor, ucfirst lc $vendor, ucfirst $vendor), - ($vendor =~ s{\s+}{-}g) ? - (lc $vendor, $vendor, ucfirst lc $vendor, ucfirst $vendor) : () - ); - my %obsolete_name = map { $_ => 1 } @obsolete_names; - push @names, @obsolete_names; - foreach my $name (uniq @names) { next unless -e "$origins/$name"; - if (exists $obsolete_name{$name}) { - warning(g_('%s origin filename is deprecated; ' . - 'it should have only alphanumeric or dash characters'), - $name); - } return "$origins/$name"; } return; @@ -198,11 +168,6 @@ separators, by either capitalizing or lower-casing and capitalizing each part and then joining them without the separators. So the expected casing is based on the one from the B<Vendor> field in the F<origins> file. -In addition, for historical and backwards compatibility, the module name -will also be looked up without non-alphanumeric character stripping, by -capitalizing, lower-casing then capitalizing, as-is or lower-casing. -But these name lookups will be removed during the 1.22.x release cycle. - =cut sub get_vendor_object { @@ -217,16 +182,6 @@ sub get_vendor_object { push @names, join q{}, map { ucfirst } @vendor_parts; push @names, join q{}, map { ucfirst lc } @vendor_parts; - # XXX: Backwards compatibility, remove on 1.22.x. - my %name_seen = map { $_ => 1 } @names; - my @obsolete_names = uniq grep { - my $seen = exists $name_seen{$_}; - $name_seen{$_} = 1; - not $seen; - } (ucfirst $vendor, ucfirst lc $vendor, $vendor, lc $vendor); - my %obsolete_name = map { $_ => 1 } @obsolete_names; - push @names, @obsolete_names; - foreach my $name (uniq @names) { my $module = "Dpkg::Vendor::$name"; eval qq{ @@ -236,11 +191,6 @@ sub get_vendor_object { my $obj = $module->new(); $OBJECT_CACHE{$vendor_key} = $obj; - if (exists $obsolete_name{$name}) { - warning(g_('%s module name is deprecated; ' . - 'it should be capitalized with only alphanumeric characters'), - "Dpkg::Vendor::$name"); - } return $obj; } @@ -269,6 +219,11 @@ sub run_vendor_hook { =head1 CHANGES +=head2 Version 1.03 (dpkg 1.22.12) + +Obsolete behavior: get_vendor_file() and get_vendor_object() no longer +support the deprecated behavior from 1.02. + =head2 Version 1.02 (dpkg 1.21.10) Deprecated behavior: get_vendor_file() loading vendor files with no special -- Dpkg.Org's dpkg

