chiark / gitweb /
catacomb-import-update: --convert: Check the .mk is unchanged
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 31 Dec 2019 15:46:00 +0000 (15:46 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 2 Jan 2020 00:30:54 +0000 (00:30 +0000)
The .mk lists donor and output files, the relationship between which
is primarily recorded in catacomb-import-update, but also encoded in
the .mk which is loaded by the makefiles to know what to build and
when.  This change to --convert detects if the .mk corresponding to
this version of the script is different to that which generated the
actually-effective one in the import commit.

If this check trips, --import must be rerun.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
cat/Dir.sd.mk
catacomb-import-update

index 5d7c66f71e51a354be35518cbb88be15f9015533..a7be94ca495ea845618fa6527a8e7cb0ee4f79d9 100644 (file)
@@ -30,3 +30,5 @@ include &~catacomb-import/secnet-import.auto.mk
        &~./catacomb-import-update --convert
 
 &cat-converted: $(addprefix &~catacomb-import/, $(CATACOMB_IMPORT_DONORS))
+
+&CLEAN += & secnet-import.auto.mk.compare
index 367609c631c7b00f84a4631f2af05bbdca1516a0..2cb3bdcfc3af86fb8a7bdc3c954f261487869cab 100755 (executable)
@@ -956,6 +956,10 @@ for (my $i = 0; $i < @WANT_TEST; $i += 2) {
 commit_changes() if !$DOCONVERT;
 
 if ($DOCONVERT) {
+  my $mff2 = "$RECIP_DIR/$MAKEFILE_FRAGMENT.compare";
+  write_makefile_fragment($mff2);
+  runx "diff", "-u", "$DONOR_DIR/$MAKEFILE_FRAGMENT", $mff2;
+
   foreach my $to (@RENAME_LIST) {
     rename "$to.new", "$to";
   }