From b61d2becf76c8cf0951dc7d3f63a74dd55066a12 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 14 Dec 2022 22:02:58 +0000 Subject: [PATCH] packaging: Fix update-build-deps to handle features It's not clear to me how one is supposed to know whether to put the extra +default in the dependency. Do it ad hoc. Signed-off-by: Ian Jackson --- debian/update-build-deps | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/debian/update-build-deps b/debian/update-build-deps index fbeea84..9edd029 100755 --- a/debian/update-build-deps +++ b/debian/update-build-deps @@ -4,9 +4,13 @@ use strict; open I, "debian/control" or die $!; open O, ">debian/control.new" or die $!; +our %need_features = qw( + env-logger +default + ); + while () { if (m{^\# debian/update-build-deps}i...m{^\S}) { - next if m{^ +librust[-a-z0-9]+,?\s*$}; + next if m{^ +librust[-+a-z0-9]+ \,?\s*$}; if (m{^\S} && !m{^\#}i) { local ($_); open C, "Cargo.toml" or die $!; @@ -16,7 +20,8 @@ while () { my $p = $1; next if m{path ?= ?\"}; $p =~ y/_/-/; - print O " librust-$p-dev ,\n" or die $!; + my $f = $need_features{$p} // ''; + print O " librust-$p$f-dev ,\n" or die $!; } C->error and die $!; } -- 2.30.2