Makefile: be careful what we remove from saved defconfig
authorYann E. MORIN <yann.morin.1998@free.fr>
Wed, 21 Oct 2020 20:08:28 +0000 (22:08 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sat, 24 Oct 2020 20:46:31 +0000 (22:46 +0200)
commit1a7873ec986c817fdd22cc2d9096d9482fee4381
tree61c3fedb03149d6856b764ccf2369e595da7561d
parentd21336a20376a3cb6a6a4e6e7eef678437a7a4e0
Makefile: be careful what we remove from saved defconfig

When we savedefconfig, we remove BR2_DEFCONFIG (f71a621d91e, savedefconfig:
Remove BR2_DEFCONFIG from saved defconfig file) and BR2_DL_DIR (36edacce9c2,
Makefile: exclude BR2_DL_DIR from savedefconfig), because their meaning
is only valid locally.

However, we were not careful to really match the exact variables, so we
could match arbitrary options.

For example, these config options would all be dropped:

    BR2_DEFCONFIG="toto"
    BR2_DL_DIR="titi"
    BR2_PACKAGE_SABR2_DEFCONFIG="tutu"
    BR2_PACKAGE_SABR2_DL_DIR=y

While the first two are indeed the ones we want to drop, the last two
are options (whatever their meaning or how poorly named they are) of the
hypothetical 'sabr2' package, and we want to keep those in a defconfig.

When cleaning the just-saved defconfig, be sure to anchor the patterns to
the beginning of the line.

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Sven Oliver Moll <buildroot@svol.li>
Cc: Herve Codina <Herve.CODINA@celad.com>
Acked-by: Herve Codina <Herve.CODINA@celad.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Makefile