Allow overwriting a list with an empty list using (=) operator

I found myself writing the following split rules for an element:

public:
  bst:
    split-rules:
      runtime:
        (=): []

      devel:
        (>):
        - |
          %{bindir}/*

The aim was to put all of this element's binaries into the 'devel' domain, and make sure nothing went into the 'runtime' domain by replacing the built-in rules for that domain with an empty list.

That wasn't working though because BuildStream was using [] (empty list) as a sentinel to mean "do nothing", which is fine for the prepend and append operators (prepending an empty list to a list has no effect) but is not really correct for the overwrite operator.

This commit fixes that issue and adds a test.

Edited by Sam Thursfield

Merge request reports

Loading