* [Buildroot] [PATCH] Fix uninstallation of non-staged packages @ 2011-02-20 18:27 Bjørn Forsman 2011-02-20 18:59 ` Thomas Petazzoni 0 siblings, 1 reply; 3+ messages in thread From: Bjørn Forsman @ 2011-02-20 18:27 UTC (permalink / raw) To: buildroot Packages without $(PKG)_INSTALL_STAGING=YES currently fail to uninstall themselves with 'make pkg-uninstall'. For a real life example of the error, try uninstalling 'at' or 'dropbear'. This patch fixes the issue by only uninstalling packages from staging if $(PKG)_INSTALL_STAGING==YES. Signed-off-by: Bj?rn Forsman <bjorn.forsman@gmail.com> --- package/Makefile.package.in | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/package/Makefile.package.in b/package/Makefile.package.in index 92ce4e2..1482284 100644 --- a/package/Makefile.package.in +++ b/package/Makefile.package.in @@ -321,8 +321,10 @@ $(BUILD_DIR)/%/.stamp_cleaned: # Uninstall package from target and staging $(BUILD_DIR)/%/.stamp_uninstalled: @$(call MESSAGE,"Uninstalling") +ifeq ($$($(2)_INSTALL_STAGING),YES) $($(PKG)_UNINSTALL_STAGING_CMDS) rm -f $($(PKG)_TARGET_INSTALL_STAGING) +endif $($(PKG)_UNINSTALL_TARGET_CMDS) rm -f $($(PKG)_TARGET_INSTALL_TARGET) $($(PKG)_HOOK_POST_INSTALL) -- 1.7.1 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH] Fix uninstallation of non-staged packages 2011-02-20 18:27 [Buildroot] [PATCH] Fix uninstallation of non-staged packages Bjørn Forsman @ 2011-02-20 18:59 ` Thomas Petazzoni 2011-02-20 19:59 ` Bjørn Forsman 0 siblings, 1 reply; 3+ messages in thread From: Thomas Petazzoni @ 2011-02-20 18:59 UTC (permalink / raw) To: buildroot Hello Bjorn, On Sun, 20 Feb 2011 19:27:45 +0100 Bj?rn Forsman <bjorn.forsman@gmail.com> wrote: > Packages without $(PKG)_INSTALL_STAGING=YES currently fail to > uninstall themselves with 'make pkg-uninstall'. For a real life > example of the error, try uninstalling 'at' or 'dropbear'. > > This patch fixes the issue by only uninstalling packages from staging > if $(PKG)_INSTALL_STAGING==YES. > > Signed-off-by: Bj?rn Forsman <bjorn.forsman@gmail.com> > --- > package/Makefile.package.in | 2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > > diff --git a/package/Makefile.package.in b/package/Makefile.package.in > index 92ce4e2..1482284 100644 > --- a/package/Makefile.package.in > +++ b/package/Makefile.package.in > @@ -321,8 +321,10 @@ $(BUILD_DIR)/%/.stamp_cleaned: > # Uninstall package from target and staging > $(BUILD_DIR)/%/.stamp_uninstalled: > @$(call MESSAGE,"Uninstalling") > +ifeq ($$($(2)_INSTALL_STAGING),YES) > $($(PKG)_UNINSTALL_STAGING_CMDS) > rm -f $($(PKG)_TARGET_INSTALL_STAGING) > +endif I understand the problem, but I don't think that the solution works. The $(BUILD_DIR)/%/.stamp_* targets are defined *outside* of the GENTARGETS_INNER macro, so $(2) in your code has no value. The uninstallation step should probably be split in 3 different stamp files: one for host, one for staging, one for target. Then in GENTARGETS_INNER, then <pkg>-uninstall target would depend on .stamp_target_uninstalled && .stamp_staging_uninstalled, or .stamp_target_uninstalled only, or .stamp_host_uninstalled only. However, all the uninstall code is due to be removed/reworked when we merge the package work on Lionel. But quite some work remains to clean it up, so I can't say when it's going to be ready. Regards, Thomas -- Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com ^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH] Fix uninstallation of non-staged packages 2011-02-20 18:59 ` Thomas Petazzoni @ 2011-02-20 19:59 ` Bjørn Forsman 0 siblings, 0 replies; 3+ messages in thread From: Bjørn Forsman @ 2011-02-20 19:59 UTC (permalink / raw) To: buildroot Hi Thomas, On 20 February 2011 19:59, Thomas Petazzoni <thomas.petazzoni@free-electrons.com> wrote: > Hello Bjorn, > > On Sun, 20 Feb 2011 19:27:45 +0100 > Bj?rn Forsman <bjorn.forsman@gmail.com> wrote: > >> Packages without $(PKG)_INSTALL_STAGING=YES currently fail to >> uninstall themselves with 'make pkg-uninstall'. For a real life >> example of the error, try uninstalling 'at' or 'dropbear'. >> >> This patch fixes the issue by only uninstalling packages from staging >> if $(PKG)_INSTALL_STAGING==YES. >> >> Signed-off-by: Bj?rn Forsman <bjorn.forsman@gmail.com> >> --- >> ?package/Makefile.package.in | ? ?2 ++ >> ?1 files changed, 2 insertions(+), 0 deletions(-) >> >> diff --git a/package/Makefile.package.in b/package/Makefile.package.in >> index 92ce4e2..1482284 100644 >> --- a/package/Makefile.package.in >> +++ b/package/Makefile.package.in >> @@ -321,8 +321,10 @@ $(BUILD_DIR)/%/.stamp_cleaned: >> ?# Uninstall package from target and staging >> ?$(BUILD_DIR)/%/.stamp_uninstalled: >> ? ? ? @$(call MESSAGE,"Uninstalling") >> +ifeq ($$($(2)_INSTALL_STAGING),YES) >> ? ? ? $($(PKG)_UNINSTALL_STAGING_CMDS) >> ? ? ? rm -f $($(PKG)_TARGET_INSTALL_STAGING) >> +endif > > I understand the problem, but I don't think that the solution works. > The $(BUILD_DIR)/%/.stamp_* targets are defined *outside* of the > GENTARGETS_INNER macro, so $(2) in your code has no value. Oops! You are right, $(2) was empty. But $(PKG) seems to contain the package name. However, I'm having difficulties getting it to work as I'd like. Or, put another way, it's not working at all! $(BUILD_DIR)/%/.stamp_uninstalled: @$(call MESSAGE,"Uninstalling") @echo "$(PKG)_INSTALL_STAGING: $($(PKG)_INSTALL_STAGING)" ifeq ($($(PKG)_INSTALL_STAGING),YES) @echo "INSTALL_STAGING == YES" $($(PKG)_UNINSTALL_STAGING_CMDS) rm -f $($(PKG)_TARGET_INSTALL_STAGING) else @echo "INSTALL_STAGING != YES" endif The first echo statement shows that $($(PKG)_INSTALL_STAGING) evaluates correctly to either YES or NO, but the ifeq stuff always evaluates to false... help? > The uninstallation step should probably be split in 3 different stamp > files: one for host, one for staging, one for target. Then in > GENTARGETS_INNER, then <pkg>-uninstall target would depend > on .stamp_target_uninstalled && .stamp_staging_uninstalled, > or .stamp_target_uninstalled only, or .stamp_host_uninstalled only. Agree. But it's more work :-) > However, all the uninstall code is due to be removed/reworked when we > merge the package work on Lionel. But quite some work remains to clean > it up, so I can't say when it's going to be ready. OK. Best regards, Bj?rn Forsman ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-02-20 19:59 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-02-20 18:27 [Buildroot] [PATCH] Fix uninstallation of non-staged packages Bjørn Forsman 2011-02-20 18:59 ` Thomas Petazzoni 2011-02-20 19:59 ` Bjørn Forsman
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox