chiark / gitweb /
debian/update-build-deps: Replacement (override)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 12 Jan 2023 16:03:06 +0000 (16:03 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 12 Jan 2023 18:20:41 +0000 (18:20 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/update-build-deps

index 002fca1e13d8538fcc35e7df6b1f19a47cc0beda..6faff720dfd9b51928ae4f663af0445dfa409e56 100755 (executable)
@@ -7,10 +7,12 @@ open O, ">debian/control.new" or die $!;
 our %need_features = qw(
     env-logger +default
                      );
++our %replace = (
+               );
 
 while (<I>) {
   if (m{^\# debian/update-build-deps}i...m{^\S}) {
-    next if m{^ +librust[-+a-z0-9]+ \<!upstream-cargo\>,?\s*$};
+    next if m{^ +librust[-+a-z0-9]+ (?:\(.*\) )?\<!upstream-cargo\>,?\s*$};
     if (m{^\S} && !m{^\#}i) {
       local ($_);
       open C, "Cargo.toml" or die $!;
@@ -20,8 +22,14 @@ while (<I>) {
        my $p = $1;
        next if m{path ?= ?\"};
        $p =~ y/_/-/;
-       my $f = $need_features{$p} // '';
-       print O "    librust-$p$f-dev <!upstream-cargo>,\n" or die $!;
+       my $dep = $replace{$p};
+       if (!defined $dep) {
+         my $f = $need_features{$p} // '';
+         $dep = "librust-$p$f-dev";
+       }
+       if (length $dep) {
+         print O "    $dep <!upstream-cargo>,\n" or die $!;
+       }
       }
       C->error and die $!;
     }