Skip to content

Commit

Permalink
Don't let deletions leak from OverrideEnvironment
Browse files Browse the repository at this point in the history
Previously, deleting from an OverrideEnvironment removed not just the
override item but also the same item in the subject (base) environment.
This prevents supplying the value from the subject, as that would be
contrary to the expectation after "I deleted this variable".  However,
this lets the override modify its subject, a form of leakage we don't
want. Now a deleted item has its key recorded to prevent refilling
later. Direct assignment will still set the item back in the override.

rpm packaging tool: call Override factory method rather than directly
instantiating OverrideEnvironment ("best practices")

Signed-off-by: Mats Wichmann <[email protected]>
  • Loading branch information
mwichmann committed Sep 4, 2024
1 parent b2a103b commit 706f0af
Show file tree
Hide file tree
Showing 7 changed files with 352 additions and 114 deletions.
13 changes: 10 additions & 3 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,16 @@ NOTE: Python 3.6 support is deprecated and will be dropped in a future release.

RELEASE VERSION/DATE TO BE FILLED IN LATER

From John Doe:

- Whatever John Doe did.
From Mats Wichmann:
- Override envirionments, created when giving construction environment
keyword arguments to Builder calls (or manually, through the undocumented
Override method), were modified not to "leak" on item deletion. The item
will now not be deleted from the base environment. Methods of regular
environments modified to (mostly) not directly access the _dict attribute
which stores the construction variables - in case they're called via
proxying from an OverrideEnv, which does not have such an attribute
(though for completeness, it now pretends to). Let the dictionary-like
methods handle access/update instead.


RELEASE 4.8.1 - Tue, 03 Sep 2024 17:22:20 -0700
Expand Down
5 changes: 5 additions & 0 deletions RELEASE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ CHANGED/ENHANCED EXISTING FUNCTIONALITY
- List modifications to existing features, where the previous behavior
wouldn't actually be considered a bug

- Override envirionments, created when giving construction environment
keyword arguments to Builder calls (or manually, through the
undocumented Override method), were modified not to "leak" on item deletion.
The item will now not be deleted from the base environment.

FIXES
-----

Expand Down
Loading

0 comments on commit 706f0af

Please sign in to comment.