diff mbox series

[1/1] package/bash: remove development files and modules on the target.

Message ID 20210331081559.29619-1-nicolas.cavallari@green-communications.fr
State Superseded
Headers show
Series [1/1] package/bash: remove development files and modules on the target. | expand

Commit Message

Nicolas Cavallari March 31, 2021, 8:15 a.m. UTC
bash installs /lib/pkgconfig/bash.pc on the target, which buildroot does
not remove because it is not in the usual /usr/lib/pkgconfig.

It also install makefiles and example builtins in /lib/bash that are not
required.

The Makefiles and .pc encode the build path and create reproducibility
issues.  Remove them.

Signed-off-by: Nicolas Cavallari <nicolas.cavallari@green-communications.fr>
---
 package/bash/bash.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Thomas Petazzoni April 5, 2021, 9:45 a.m. UTC | #1
Hello Nicolas,

On Wed, 31 Mar 2021 10:15:59 +0200
Nicolas Cavallari <nicolas.cavallari@green-communications.fr> wrote:

> diff --git a/package/bash/bash.mk b/package/bash/bash.mk
> index efe7cbbe59..6af31f182d 100644
> --- a/package/bash/bash.mk
> +++ b/package/bash/bash.mk
> @@ -41,7 +41,8 @@ endif
>  define BASH_INSTALL_TARGET_CMDS
>  	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
>  		DESTDIR=$(TARGET_DIR) exec_prefix=/ install
> -	rm -f $(TARGET_DIR)/bin/bashbug
> +	rm -f $(TARGET_DIR)/bin/bashbug $(TARGET_DIR)/lib/pkgconfig/bash.pc

I am wondering if target-finalize shouldn't take care of removing
/lib/pkgconfig just like it removes /usr/lib/pkgconfig. This would have
the benefit of also dropping the /lib/pkgconfig folder, which your
change doesn't do.

What do you think?

> +	rm -rf $(TARGET_DIR)/lib/bash
>  endef
>  
>  # Add /bin/bash to /etc/shells otherwise some login tools like dropbear

Thanks,

Thomas
Nicolas Cavallari April 6, 2021, 10:32 a.m. UTC | #2
Hello,

On 05/04/2021 11:45, Thomas Petazzoni wrote:
> On Wed, 31 Mar 2021 10:15:59 +0200
> Nicolas Cavallari <nicolas.cavallari@green-communications.fr> wrote:
>> --- a/package/bash/bash.mk
>> +++ b/package/bash/bash.mk
>> @@ -41,7 +41,8 @@ endif
>>   define BASH_INSTALL_TARGET_CMDS
>>   	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
>>   		DESTDIR=$(TARGET_DIR) exec_prefix=/ install
>> -	rm -f $(TARGET_DIR)/bin/bashbug
>> +	rm -f $(TARGET_DIR)/bin/bashbug $(TARGET_DIR)/lib/pkgconfig/bash.pc
> 
> I am wondering if target-finalize shouldn't take care of removing
> /lib/pkgconfig just like it removes /usr/lib/pkgconfig. This would have
> the benefit of also dropping the /lib/pkgconfig folder, which your
> change doesn't do.
> 
> What do you think?

This would work too, but do we want to add things to target-finalize 
just for (apparently) only one little package ?
diff mbox series

Patch

diff --git a/package/bash/bash.mk b/package/bash/bash.mk
index efe7cbbe59..6af31f182d 100644
--- a/package/bash/bash.mk
+++ b/package/bash/bash.mk
@@ -41,7 +41,8 @@  endif
 define BASH_INSTALL_TARGET_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
 		DESTDIR=$(TARGET_DIR) exec_prefix=/ install
-	rm -f $(TARGET_DIR)/bin/bashbug
+	rm -f $(TARGET_DIR)/bin/bashbug $(TARGET_DIR)/lib/pkgconfig/bash.pc
+	rm -rf $(TARGET_DIR)/lib/bash
 endef
 
 # Add /bin/bash to /etc/shells otherwise some login tools like dropbear