Hello community, here is the log from the commit of package make for openSUSE:Factory checked in at 2015-10-02 09:22:48 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/make (Old) and /work/SRC/openSUSE:Factory/.make.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "make" Changes: -------- --- /work/SRC/openSUSE:Factory/make/make.changes 2014-11-24 11:08:03.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.make.new/make.changes 2015-10-02 09:22:49.000000000 +0200 @@ -1,0 +2,6 @@ +Wed Sep 16 09:10:34 UTC 2015 - schwab@suse.de + +- undefine-variables.patch: Force recomputing .VARIABLES when a variable + was made undefined (bsc#934131) + +------------------------------------------------------------------- New: ---- undefine-variables.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ make.spec ++++++ --- /var/tmp/diff_new_pack.6pUx1D/_old 2015-10-02 09:22:50.000000000 +0200 +++ /var/tmp/diff_new_pack.6pUx1D/_new 2015-10-02 09:22:50.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package make # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -29,6 +29,7 @@ Source2: %{name}.keyring Patch1: make-testcases_timeout.diff Patch2: make-4.1-fix_null_returns_from_ttyname.patch +Patch3: undefine-variables.patch Patch64: make-library-search-path.diff Requires(post): %{install_info_prereq} Recommends: %{name}-lang @@ -44,6 +45,7 @@ %setup -q %patch1 -p1 %patch2 -p1 +%patch3 -p1 if [ %{_lib} == lib64 ]; then %patch64 -p1 fi ++++++ undefine-variables.patch ++++++ Subject: [PATCH] [SV 45728] Force recomputing .VARIABLES when a variable was made undefined * variable.c (last_var_count): Move to file level. (undefine_variable_in_set): Clear last_var_count when the variable was removed from global_variable_set. * tests/scripts/variables/undefine: Add test case. --- tests/scripts/variables/undefine | 14 ++++++++++++++ variable.c | 14 ++++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) Index: make-4.1/tests/scripts/variables/undefine =================================================================== --- make-4.1.orig/tests/scripts/variables/undefine +++ make-4.1/tests/scripts/variables/undefine @@ -70,4 +70,18 @@ all: ;@echo ouch ', '', "#MAKEFILE#:3: *** empty variable name. Stop.\n", 512); + +# TEST 4: interaction between undefine and $(.VARIABLES) + +run_make_test(' +var_a := a +var_b := b +$(foreach v, $(filter var_%, $(.VARIABLES)), $(eval undefine $v)) +var_c := c +var_d := d +$(info $(filter var_%, $(.VARIABLES))) +all: ;@: +', +'', "var_d var_c"); + 1; Index: make-4.1/variable.c =================================================================== --- make-4.1.orig/variable.c +++ make-4.1/variable.c @@ -172,6 +172,7 @@ static struct variable_set global_variab static struct variable_set_list global_setlist = { 0, &global_variable_set, 0 }; struct variable_set_list *current_variable_set_list = &global_setlist; +static unsigned long last_var_count = 0; /* Implement variables. */ @@ -328,6 +329,10 @@ undefine_variable_in_set (const char *na { hash_delete_at (&set->table, var_slot); free_variable_name_and_value (v); + /* Force rebuilding of .VARIABLES when the global variable set + has changed. */ + if (set == &global_variable_set) + last_var_count = 0; } } } @@ -345,9 +350,6 @@ undefine_variable_in_set (const char *na static struct variable * lookup_special_var (struct variable *var) { - static unsigned long last_var_count = 0; - - /* This one actually turns out to be very hard, due to the way the parser records targets. The way it works is that target information is collected internally until make knows the target is completely specified. It unitl @@ -410,9 +412,9 @@ lookup_special_var (struct variable *var } *(p-1) = '\0'; - /* Remember how many variables are in our current count. Since we never - remove variables from the list, this is a reliable way to know whether - the list is up to date or needs to be recomputed. */ + /* Remember how many variables are in our current count. This is a + reliable way to know whether the list is up to date or needs to + be recomputed. */ last_var_count = global_variable_set.table.ht_fill; }