Package: dpkg Version: 1.20.5 Severity: wishlist Hi,
in the debrebuild script from devscripts we use the following code snippet: if ($srcpkgname =~ / /) { # In some cases such as binNMUs, the source field contains a version in # the form: # mscgen (0.20) ($srcpkgname, $srcpkgver) = split / /, $srcpkgname, 2; # Add a simple control check to avoid the worst surprises and stop obvious # cases of garbage-in-garbage-out. die("Unexpected source package name: ${srcpkgname}\n") if $srcpkgname =~ m{[ \t_/\(\)<>!\n%&\$\#\@]}; # remove the surrounding parenthesis from the version $srcpkgver =~ s/^\((.*)\)$/$1/; } as prompted by Mattia Rizzolo in [1] I'm proposing to add a function that is able to parse a Source field with a source package name and a possible version in brackets to libdpkg-perl. Thanks! cheers, josch [1] https://salsa.debian.org/debian/devscripts/-/merge_requests/212#note_214079