]> git.draconx.ca Git - gob-dx.git/commitdiff
Expand --no-touch-headers to include the private header.
authorNick Bowler <nbowler@draconx.ca>
Tue, 11 Feb 2020 01:46:42 +0000 (20:46 -0500)
committerNick Bowler <nbowler@draconx.ca>
Fri, 14 Feb 2020 05:27:39 +0000 (00:27 -0500)
It seems incredibly bizarre that --no-touch-headers does not impact
generation of the private header file.  Even though this behaviour
is documented in the man page, I'm going to go out on a limb and
posit that nobody using this option wants or relies on the current
behaviour.  So let's just change it to make sense.

NEWS
doc/gob2.1.in
src/main.c
tests/options.at

diff --git a/NEWS b/NEWS
index bed51af31f280839caefb5f8a0b90be47509ba50..9c3d4a2745ffda6c005ef9c59255b582525ef7a2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@
        * Add support for dynamic GObject types.
        * Improved support for overriding interfaces in subclasses.
        * New and improved GOB2_CHECK macro.
+       * Expand --no-touch-headers behaviour to include private header.
 
 2.0.20:
        * Require glib 2.4, and change use of the _take_ownership functions
index 560dd8ae65ae0c762e782b4a0d6f7169a4a4367d..dfd4016dab1493f82596ddc3672c648d4559efc6 100644 (file)
@@ -57,10 +57,9 @@ changed (implies \-\-no\-touch\-headers).  Be careful with automake, see section
 PREVENTING SPURIOUS BUILDS.
 .TP
 .B \-\-no\-touch\-headers
-Don\'t touch the generated header file unless it really changed, this avoids
-spurious rebuilds, but can confuse some make systems (automake in particular),
-so it is not enabled by default.  Private header is still touched even if
-unchanged however.
+Don\'t touch any generated header file unless that file really changed.
+This avoids spurious rebuilds, but can confuse some make systems so it is not
+enabled by default.
 .TP
 .B \-\-always\-private\-header
 Always create a \fB<basename>-private.h\fR file, even if it would be empty.
index b0e750556949761c3491ef2a97df7ebd63b6b2ab..81b22f1452220c3b8d7eb46d137337c71776bf89 100644 (file)
@@ -3492,13 +3492,13 @@ open_files(void)
                if (file_sep != 0)
                        sep[0] = file_sep;
                outfilephbase = g_strconcat (fullfilebase, sep, "private.h", NULL);
-               outfileph = g_strconcat (outfilephbase, no_touch ? "#gob#" : "", NULL);
+               outfileph = g_strconcat (outfilephbase, no_touch_headers ? "#gob#" : "", NULL);
        } else {
                outfilephbase = NULL;
                outfileph = NULL;
        }
 
-       
+
        if ( ! no_write) {
                out = fopen (outfile, "w");
                if (out == NULL) {
@@ -4964,15 +4964,16 @@ main(int argc, char *argv[])
        if (outph)
                fclose (outph);
 
-       if (! no_write) {
+       if (!no_write) {
                if (no_touch) {
-                       compare_and_move (outfilebase);
+                       compare_and_move(outfilebase);
+               }
+               if (no_touch_headers) {
+                       compare_and_move(outfilehbase);
                        if (outfilephbase)
-                               compare_and_move (outfilephbase);
+                               compare_and_move(outfilephbase);
                }
-               if (no_touch_headers)
-                       compare_and_move (outfilehbase);
        }
-       
+
        return 0;
 }
index 30be9e21fcdf45dc7cae0f6ee06d12538962ff73..4fb710e0fd6950453f361eb3a45a8335e151672b 100644 (file)
@@ -298,10 +298,6 @@ AT_DATA([test.gob], [[class :Test from G:Object
 }
 ]])
 
-m4_if(OPTION, [--no-touch-headers],
-[#Currently, the private header is modified even with --no-touch-headers.
-AT_XFAIL_IF([:])])dnl
-
 AT_CHECK([gob2 test.gob])
 touch test-c test-h test-private
 TEST_MTIME_DELAY