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=5ca492db5c16b71d0d2db25ce48208f291fc1ea2

commit 5ca492db5c16b71d0d2db25ce48208f291fc1ea2
Author: Guillem Jover <[email protected]>
AuthorDate: Tue Apr 9 03:49:49 2024 +0200

    Dpkg::Source::Package: Add a new get_basedirname() method
    
    This centralizes the generation of the base directory name for a source
    package.
---
 scripts/Dpkg/Source/Package.pm | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/scripts/Dpkg/Source/Package.pm b/scripts/Dpkg/Source/Package.pm
index 06884c330..3d336a1a7 100644
--- a/scripts/Dpkg/Source/Package.pm
+++ b/scripts/Dpkg/Source/Package.pm
@@ -29,7 +29,7 @@ is the one that supports the extraction of the source package.
 
 =cut
 
-package Dpkg::Source::Package 2.02;
+package Dpkg::Source::Package 2.03;
 
 use strict;
 use warnings;
@@ -389,6 +389,21 @@ sub get_basename {
     return $f->{'Source'} . '_' . $vs;
 }
 
+=item $p->get_basedirname()
+
+Returns the default base directory name for the package.
+
+=cut
+
+sub get_basedirname {
+    my $self = shift;
+
+    my $dirname = $self->get_basename();
+    $dirname =~ s/_/-/;
+
+    return $dirname;
+}
+
 sub find_original_tarballs {
     my ($self, %opts) = @_;
     $opts{extension} //= compression_get_file_extension_regex();
@@ -699,6 +714,10 @@ sub write_dsc {
 
 =head1 CHANGES
 
+=head2 Version 2.03 (dpkg 1.22.7)
+
+New method: $p->get_basedirname().
+
 =head2 Version 2.02 (dpkg 1.21.10)
 
 New method: $p->armor_original_tarball_signature().

-- 
Dpkg.Org's dpkg

Reply via email to