Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Alexander_Naumov:SLE-12:Update
make
undefine-variables.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File undefine-variables.patch of Package make
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.0/tests/scripts/variables/undefine =================================================================== --- make-4.0.orig/tests/scripts/variables/undefine +++ make-4.0/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.0/variable.c =================================================================== --- make-4.0.orig/variable.c +++ make-4.0/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. */ @@ -329,6 +330,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; } } } @@ -346,9 +351,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 @@ -411,9 +413,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; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor