diff mbox series

[v4,1/2] package/nfs-utils: fix unnecessary files removal

Message ID 1556442175-1494-1-git-send-email-angelo@amarulasolutions.com
State Accepted
Commit 284cf7d39f580bc2e50cffec34a5ff1c69e9365d
Headers show
Series [v4,1/2] package/nfs-utils: fix unnecessary files removal | expand

Commit Message

Angelo Compagnucci April 28, 2019, 9:02 a.m. UTC
Removing of unnecessary files is actually broken by the fact that the rm
command is executed inside build directory and not the target directory.

This patch fixes the problem changing to target directory before
removing files.

Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
---
v3->v4: separate fix patch as requested by Arnout

 package/nfs-utils/nfs-utils.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Arnout Vandecappelle May 5, 2019, 8:40 p.m. UTC | #1
On 28/04/2019 11:02, Angelo Compagnucci wrote:
> Removing of unnecessary files is actually broken by the fact that the rm
> command is executed inside build directory and not the target directory.
> 
> This patch fixes the problem changing to target directory before
> removing files.
> 
> Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
> ---
> v3->v4: separate fix patch as requested by Arnout
> 
>  package/nfs-utils/nfs-utils.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/package/nfs-utils/nfs-utils.mk b/package/nfs-utils/nfs-utils.mk
> index 9fa7ae2..4bb62de 100644
> --- a/package/nfs-utils/nfs-utils.mk
> +++ b/package/nfs-utils/nfs-utils.mk
> @@ -57,7 +57,7 @@ NFS_UTILS_CONF_OPTS += --disable-tirpc
>  endif
>  
>  define NFS_UTILS_INSTALL_FIXUP
> -	rm -f $(NFS_UTILS_TARGETS_)
> +	cd $(TARGET_DIR) && rm -f $(NFS_UTILS_TARGETS_)

 Personally, I'd have used $(addprefix) instead of cd, but that's just my own
thing, so: applied to master, thanks.

 Regards,
 Arnout


>  	touch $(TARGET_DIR)/etc/exports
>  	$(INSTALL) -D -m 644 \
>  		$(@D)/utils/mount/nfsmount.conf $(TARGET_DIR)/etc/nfsmount.conf
>
Peter Korsgaard May 10, 2019, 9:57 a.m. UTC | #2
>>>>> "Angelo" == Angelo Compagnucci <angelo@amarulasolutions.com> writes:

 > Removing of unnecessary files is actually broken by the fact that the rm
 > command is executed inside build directory and not the target directory.

 > This patch fixes the problem changing to target directory before
 > removing files.

 > Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
 > ---
 > v3-> v4: separate fix patch as requested by Arnout

Committed to 2019.02.x, thanks.
diff mbox series

Patch

diff --git a/package/nfs-utils/nfs-utils.mk b/package/nfs-utils/nfs-utils.mk
index 9fa7ae2..4bb62de 100644
--- a/package/nfs-utils/nfs-utils.mk
+++ b/package/nfs-utils/nfs-utils.mk
@@ -57,7 +57,7 @@  NFS_UTILS_CONF_OPTS += --disable-tirpc
 endif
 
 define NFS_UTILS_INSTALL_FIXUP
-	rm -f $(NFS_UTILS_TARGETS_)
+	cd $(TARGET_DIR) && rm -f $(NFS_UTILS_TARGETS_)
 	touch $(TARGET_DIR)/etc/exports
 	$(INSTALL) -D -m 644 \
 		$(@D)/utils/mount/nfsmount.conf $(TARGET_DIR)/etc/nfsmount.conf