From: Nick Bowler Date: Tue, 11 Feb 2020 01:46:42 +0000 (-0500) Subject: Expand --no-touch-headers to include the private header. X-Git-Url: https://git.draconx.ca/gitweb/gob-dx.git/commitdiff_plain/926b8d8fb3ecffe60f3eaefcd5ec40a5273251ce Expand --no-touch-headers to include the private header. 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. --- diff --git a/NEWS b/NEWS index bed51af..9c3d4a2 100644 --- 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 diff --git a/doc/gob2.1.in b/doc/gob2.1.in index 560dd8a..dfd4016 100644 --- a/doc/gob2.1.in +++ b/doc/gob2.1.in @@ -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-private.h\fR file, even if it would be empty. diff --git a/src/main.c b/src/main.c index b0e7505..81b22f1 100644 --- a/src/main.c +++ b/src/main.c @@ -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; } diff --git a/tests/options.at b/tests/options.at index 30be9e2..4fb710e 100644 --- a/tests/options.at +++ b/tests/options.at @@ -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