pkg-infra: improve reliability of foo-install
authorArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Sat, 21 Jan 2012 00:01:12 +0000 (01:01 +0100)
committerPeter Korsgaard <jacmet@sunsite.dk>
Thu, 2 Feb 2012 21:52:35 +0000 (22:52 +0100)
Running foo-uninstall has a high likelyhood of failing, because we
remove a lot of directories from the target.  To improve the reliability,
remove the stamp files before calling the uninstall commands, and add
the -k option to the sub-make.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
package/Makefile.autotools.in
package/Makefile.package.in

index 64e0730b8a00e83d69066f7e3e6436452bde437d..fd118dc47a085cf4a3354aaa5428721575b4e2cf 100644 (file)
@@ -285,10 +285,13 @@ endif
 #
 # Uninstall from target step. Only define it if not already defined
 # by the package .mk file.
+# Autotools Makefiles do uninstall with ( cd ...; rm -f ... )
+# Since we remove a lot of directories in target-finalize, this is likely
+# to fail.  Therefore add -k flag.
 #
 ifndef $(2)_UNINSTALL_TARGET_CMDS
 define $(2)_UNINSTALL_TARGET_CMDS
-       $$(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_UNINSTALL_TARGET_OPT) -C $$($$(PKG)_SRCDIR)
+       $$(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) -k $$($$(PKG)_UNINSTALL_TARGET_OPT) -C $$($$(PKG)_SRCDIR)
 endef
 endif
 
index 31f5ab64658b97e56426ea37c404f093ea739cb6..1ace683c2a275e18bd7f6b82bfd5cd4cdb5dcb63 100644 (file)
@@ -442,12 +442,13 @@ $(BUILD_DIR)/%/.stamp_cleaned:
        rm -f $(@D)/.stamp_built
 
 # Uninstall package from target and staging
+# Uninstall commands tend to fail, so remove the stamp files first
 $(BUILD_DIR)/%/.stamp_uninstalled:
        @$(call MESSAGE,"Uninstalling")
-       $($(PKG)_UNINSTALL_STAGING_CMDS)
        rm -f $($(PKG)_TARGET_INSTALL_STAGING)
-       $($(PKG)_UNINSTALL_TARGET_CMDS)
        rm -f $($(PKG)_TARGET_INSTALL_TARGET)
+       $($(PKG)_UNINSTALL_STAGING_CMDS)
+       $($(PKG)_UNINSTALL_TARGET_CMDS)
 
 # Remove package sources
 $(BUILD_DIR)/%/.stamp_dircleaned: