diff mbox

core: distclean is a noconfig target

Message ID 1473598598-5546-1-git-send-email-yann.morin.1998@free.fr
State Superseded
Headers show

Commit Message

Yann E. MORIN Sept. 11, 2016, 12:56 p.m. UTC
When the .config contains invalid configuration *(e.g. two providers for
a same virtual pacakge), it is not possible to run "make distclean"
becasue the .config file is sourced and packages interpreted in this
case.

Add distclean to the noconfig list, so that we can run it in all cases.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Thomas Petazzoni Sept. 11, 2016, 1:34 p.m. UTC | #1
Hello,

On Sun, 11 Sep 2016 14:56:38 +0200, Yann E. MORIN wrote:
> When the .config contains invalid configuration *(e.g. two providers for
> a same virtual pacakge), it is not possible to run "make distclean"

pacakge -> package

> @@ -86,7 +86,7 @@ export BR2_VERSION_FULL := $(BR2_VERSION)$(shell $(TOPDIR)/support/scripts/setlo
>  noconfig_targets := menuconfig nconfig gconfig xconfig config oldconfig randconfig \
>  	defconfig %_defconfig allyesconfig allnoconfig silentoldconfig release \
>  	randpackageconfig allyespackageconfig allnopackageconfig \
> -	print-version olddefconfig
> +	print-version olddefconfig distclean

The distclean target uses the DL_DIR variable, which is derived from
BR2_DL_DIR, which can come from either the environment... or the
configuration file. So, the BR2_DL_DIR from the configuration will be
ignored. I'm not sure what the consequence is, but it's worth thinking
about this.

Also, what is the rationale for having just "distclean" and not "clean"
in noconfig_targets ? The fact that "distclean" remove the
configuration, and as such "helps" in solving configuration issues ?

Thanks,

Thomas
Yann E. MORIN Sept. 11, 2016, 1:46 p.m. UTC | #2
Thomas, All,

On 2016-09-11 15:34 +0200, Thomas Petazzoni spake thusly:
> On Sun, 11 Sep 2016 14:56:38 +0200, Yann E. MORIN wrote:
> > @@ -86,7 +86,7 @@ export BR2_VERSION_FULL := $(BR2_VERSION)$(shell $(TOPDIR)/support/scripts/setlo
> >  noconfig_targets := menuconfig nconfig gconfig xconfig config oldconfig randconfig \
> >  	defconfig %_defconfig allyesconfig allnoconfig silentoldconfig release \
> >  	randpackageconfig allyespackageconfig allnopackageconfig \
> > -	print-version olddefconfig
> > +	print-version olddefconfig distclean
> 
> The distclean target uses the DL_DIR variable, which is derived from
> BR2_DL_DIR, which can come from either the environment... or the
> configuration file. So, the BR2_DL_DIR from the configuration will be
> ignored. I'm not sure what the consequence is, but it's worth thinking
> about this.

Well, if either is set on not the default, then it is currently not
removed.

With this change, however, it is no longer removed, indeed.

But, why are we even having this removal conditional? We can just
unconditionally remove $(TOPDIR)/dl and be done with that, no?

> Also, what is the rationale for having just "distclean" and not "clean"
> in noconfig_targets ? The fact that "distclean" remove the
> configuration, and as such "helps" in solving configuration issues ?

Exactly.

Otherwise one has to manually remove the .config file, which is not
very nice...

Regards,
Yann E. MORIN.
Arnout Vandecappelle Sept. 11, 2016, 8:44 p.m. UTC | #3
On 11-09-16 15:46, Yann E. MORIN wrote:
> Thomas, All,
> 
> On 2016-09-11 15:34 +0200, Thomas Petazzoni spake thusly:
>> On Sun, 11 Sep 2016 14:56:38 +0200, Yann E. MORIN wrote:
>>> @@ -86,7 +86,7 @@ export BR2_VERSION_FULL := $(BR2_VERSION)$(shell $(TOPDIR)/support/scripts/setlo
>>>  noconfig_targets := menuconfig nconfig gconfig xconfig config oldconfig randconfig \
>>>  	defconfig %_defconfig allyesconfig allnoconfig silentoldconfig release \
>>>  	randpackageconfig allyespackageconfig allnopackageconfig \
>>> -	print-version olddefconfig
>>> +	print-version olddefconfig distclean
>>
>> The distclean target uses the DL_DIR variable, which is derived from
>> BR2_DL_DIR, which can come from either the environment... or the
>> configuration file. So, the BR2_DL_DIR from the configuration will be
>> ignored. I'm not sure what the consequence is, but it's worth thinking
>> about this.

 With the small caveat that a BR2_DL_DIR specified in the environment *will*
override the one of the .config, and that one will still be used even if .config
is not read. I think, because there is still some twisted logic in pkg-download
that I didn't analyze.

> 
> Well, if either is set on not the default, then it is currently not
> removed.
> 
> With this change, however, it is no longer removed, indeed.
> 
> But, why are we even having this removal conditional? We can just
> unconditionally remove $(TOPDIR)/dl and be done with that, no?

 Seems OK to me.

 Regards,
 Arnout

> 
>> Also, what is the rationale for having just "distclean" and not "clean"
>> in noconfig_targets ? The fact that "distclean" remove the
>> configuration, and as such "helps" in solving configuration issues ?
> 
> Exactly.
> 
> Otherwise one has to manually remove the .config file, which is not
> very nice...
> 
> Regards,
> Yann E. MORIN.
>
diff mbox

Patch

diff --git a/Makefile b/Makefile
index dfef021..f29f957 100644
--- a/Makefile
+++ b/Makefile
@@ -86,7 +86,7 @@  export BR2_VERSION_FULL := $(BR2_VERSION)$(shell $(TOPDIR)/support/scripts/setlo
 noconfig_targets := menuconfig nconfig gconfig xconfig config oldconfig randconfig \
 	defconfig %_defconfig allyesconfig allnoconfig silentoldconfig release \
 	randpackageconfig allyespackageconfig allnopackageconfig \
-	print-version olddefconfig
+	print-version olddefconfig distclean
 
 # Some global targets do not trigger a build, but are used to collect
 # metadata, or do various checks. When such targets are triggered,