chiark / gitweb /
debian/update-build-deps: Add --check mode
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 15 Jun 2023 11:34:34 +0000 (12:34 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 15 Jun 2023 11:34:34 +0000 (12:34 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/update-build-deps

index 856af2c3ee095e4f900d60949412dcd63243d77d..2c190494968a2b8d403039509a5e6102500061b4 100755 (executable)
@@ -1,6 +1,11 @@
 #!/usr/bin/perl -w
 use strict;
 
+our $mode =
+  "@ARGV" eq '--check' ? 'check' :
+  "@ARGV" eq '' ? 'install' :
+  die "$0: bad usage\n";
+
 open I, "debian/control" or die $!;
 open O, ">debian/control.new" or die $!;
 
@@ -41,4 +46,9 @@ while (<I>) {
 
 I->error and die $!;
 close O or die $!;
-rename "debian/control.new", "debian/control" or die $!;
+
+if ($mode eq 'install') {
+  rename "debian/control.new", "debian/control" or die $!;
+} else {
+  exec qw(diff -u), "debian/control", "debian/control.new";
+}