mirror of
https://github.com/mirror/make.git
synced 2025-01-27 04:40:33 +08:00
Ensure that -n takes precedence over -t.
Patch from Michael Witten <mfwitten@gmail.com>
This commit is contained in:
parent
e4d5d43424
commit
9a9f83e8b5
@ -1,3 +1,8 @@
|
||||
2011-09-02 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* remake.c (touch_file): If we have both -n and -t, -n takes
|
||||
precedence. Patch from Michael Witten <mfwitten@gmail.com>
|
||||
|
||||
2011-08-29 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* expand.c (variable_expand_string): Always allocate a new buffer
|
||||
|
4
remake.c
4
remake.c
@ -1113,6 +1113,10 @@ touch_file (struct file *file)
|
||||
if (!silent_flag)
|
||||
message (0, "touch %s", file->name);
|
||||
|
||||
/* Print-only (-n) takes precedence over touch (-t). */
|
||||
if (just_print_flag)
|
||||
return 0;
|
||||
|
||||
#ifndef NO_ARCHIVES
|
||||
if (ar_name (file->name))
|
||||
return ar_touch (file->name);
|
||||
|
@ -1,3 +1,8 @@
|
||||
2011-09-02 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/options/dash-n: Verify that in "-n -t", the -n takes
|
||||
priority. Patch from Michael Witten <mfwitten@gmail.com>.
|
||||
|
||||
2011-08-29 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/features/varnesting: Test resetting of variables while
|
||||
|
@ -65,6 +65,21 @@ $answer = "$make_name: `a' is up to date.\n";
|
||||
$answer = "$make_name: `a' is up to date.\n";
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
unlink('a', 'b', 'c');
|
||||
# TEST 4
|
||||
|
||||
unlink(qw(a b));
|
||||
|
||||
&run_make_with_options($makefile2, "-t -n", &get_logfile);
|
||||
|
||||
open(DASH_N_LOG, ">>" . &get_logfile(1));
|
||||
print DASH_N_LOG "a exists but should not!\n" if -e 'a';
|
||||
print DASH_N_LOG "b exists but should not!\n" if -e 'b';
|
||||
close(DASH_N_LOG);
|
||||
|
||||
&compare_output("touch b\ntouch a\n", &get_logfile(1));
|
||||
|
||||
# CLEANUP
|
||||
|
||||
unlink(qw(a b c));
|
||||
|
||||
1;
|
||||
|
Loading…
Reference in New Issue
Block a user