]> git.proxmox.com Git - dh-cargo.git/commitdiff
Detect crate name from versioned package names
authorJosh Triplett <josh@joshtriplett.org>
Mon, 5 Dec 2016 23:09:02 +0000 (15:09 -0800)
committerJosh Triplett <josh@joshtriplett.org>
Thu, 8 Dec 2016 05:14:55 +0000 (21:14 -0800)
This avoids needing to provide the X-Cargo-Crate field.

cargo.pm

index 8dc6138e47bac101be0e18279cb7b0b748993852..73dca52be959938cf3376cfd5ad3cce9d033e36d 100644 (file)
--- a/cargo.pm
+++ b/cargo.pm
@@ -46,6 +46,7 @@ sub pre_building_step {
     if (!$crate) {
         $crate = $source->{Source};
         $crate =~ s/^rust-//;
+        $crate =~ s/-[0-9]+(\.[0-9]+)*$//;
     }
     $this->{crate} = $crate;
     my $changelog = Dpkg::Changelog::Debian->new(range => { count => 1 });