diff mbox

[1/1] pkg-generic.mk: -clean-for-*-reinstall targets

Message ID 1416622457-10448-2-git-send-email-rdkehn@yahoo.com
State Superseded
Headers show

Commit Message

Doug Kehn Nov. 22, 2014, 2:14 a.m. UTC
Add targets to remove package .stamp_target_install file to allow
<package>-install-target to reinstall <package> in the target directory.

Signed-off-by: Doug Kehn <rdkehn@yahoo.com>
---
 package/pkg-generic.mk | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Thomas Petazzoni Nov. 22, 2014, 5:37 p.m. UTC | #1
Dear Doug Kehn,

On Fri, 21 Nov 2014 20:14:17 -0600, Doug Kehn wrote:
> Add targets to remove package .stamp_target_install file to allow
> <package>-install-target to reinstall <package> in the target directory.
> 
> Signed-off-by: Doug Kehn <rdkehn@yahoo.com>
> ---
>  package/pkg-generic.mk | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> index 9643a30..c723f80 100644
> --- a/package/pkg-generic.mk
> +++ b/package/pkg-generic.mk
> @@ -594,6 +594,14 @@ $(1)-clean-for-reconfigure: $(1)-clean-for-rebuild
>  
>  $(1)-reconfigure:	$(1)-clean-for-reconfigure $(1)
>  
> +$(1)-clean-for-staging-reinstall:
> +			rm -f $$($(2)_TARGET_INSTALL_STAGING)
> +
> +$(1)-clean-for-target-reinstall:
> +			rm -f $$($(2)_TARGET_INSTALL_TARGET)
> +
> +$(1)-clean-for-reinstall: $(1)-clean-for-staging-reinstall $(1)-clean-for-target-reinstall
> +
>  # define the PKG variable for all targets, containing the
>  # uppercase package variable prefix
>  $$($(2)_TARGET_INSTALL_TARGET):		PKG=$(2)

Thanks for this contribution. I think if we want to do this, we should
mimic the existing <pkg>-reconfigure and <pkg>-rebuild target, by
introducing a <pkg>-reinstall target.

Also, the patch should take into account both the case of target
packages (which your patch is doing) *and* the case of host packages
(which your patch forgets).

Finally, like <pkg>-reconfigure and <pkg>-rebuild, I think
<pkg>-clean-for-reinstall should also remove the $$($(2)_TARGET_RSYNC)
stamp file when $$($(2)_OVERRIDE_SRCDIR) is not empty.

Can you work on an updated version that takes into account those
comments?

Thanks a lot!

Thomas
diff mbox

Patch

diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 9643a30..c723f80 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -594,6 +594,14 @@  $(1)-clean-for-reconfigure: $(1)-clean-for-rebuild
 
 $(1)-reconfigure:	$(1)-clean-for-reconfigure $(1)
 
+$(1)-clean-for-staging-reinstall:
+			rm -f $$($(2)_TARGET_INSTALL_STAGING)
+
+$(1)-clean-for-target-reinstall:
+			rm -f $$($(2)_TARGET_INSTALL_TARGET)
+
+$(1)-clean-for-reinstall: $(1)-clean-for-staging-reinstall $(1)-clean-for-target-reinstall
+
 # define the PKG variable for all targets, containing the
 # uppercase package variable prefix
 $$($(2)_TARGET_INSTALL_TARGET):		PKG=$(2)