diff options
author | Felix Fietkau <nbd@openwrt.org> | 2007-12-25 01:39:15 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2007-12-25 01:39:15 +0000 |
commit | 26ba0523e5ecb32e0f9f35044719644e3b9de5e1 (patch) | |
tree | 425e7de657bb11b351dd16a33ec290c83c27503c /include | |
parent | f32042cf6741f0dd57a5eb81dccc8cefc11492f5 (diff) | |
download | upstream-26ba0523e5ecb32e0f9f35044719644e3b9de5e1.tar.gz upstream-26ba0523e5ecb32e0f9f35044719644e3b9de5e1.tar.bz2 upstream-26ba0523e5ecb32e0f9f35044719644e3b9de5e1.zip |
add automatic file tracking and uninstallation for files installed in $(STAGING_DIR) and $(STAGING_DIR_HOST)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@9905 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'include')
-rw-r--r-- | include/package.mk | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/include/package.mk b/include/package.mk index 9ab3a2cd5c..c3e2b6f481 100644 --- a/include/package.mk +++ b/include/package.mk @@ -70,7 +70,18 @@ define Build/DefaultTargets touch $$@ $(STAMP_INSTALLED): $(STAMP_BUILT) - $(call Build/InstallDev,$(STAGING_DIR),$(STAGING_DIR_HOST)) + $(NO_TRACE_MAKE) clean-staging + rm -rf $(TMP_DIR)/stage-$(PKG_NAME) + mkdir -p $(TMP_DIR)/stage-$(PKG_NAME) $(STAGING_DIR)/packages $(STAGING_DIR_HOST)/packages + $(call Build/InstallDev,$(TMP_DIR)/stage-$(PKG_NAME)/target,$(TMP_DIR)/stage-$(PKG_NAME)/host) + if [ -d $(TMP_DIR)/stage-$(PKG_NAME)/target ]; then \ + (cd $(TMP_DIR)/stage-$(PKG_NAME)/target; find > $(STAGING_DIR)/packages/$(PKG_NAME).list); \ + $(CP) $(TMP_DIR)/stage-$(PKG_NAME)/target/* $(STAGING_DIR)/; \ + fi + if [ -d $(TMP_DIR)/stage-$(PKG_NAME)/host ]; then \ + (cd $(TMP_DIR)/stage-$(PKG_NAME)/host; find > $(STAGING_DIR_HOST)/packages/$(PKG_NAME).list); \ + $(CP) $(TMP_DIR)/stage-$(PKG_NAME)/host/* $(STAGING_DIR_HOST)/; \ + fi touch $$@ ifdef Build/InstallDev @@ -152,15 +163,24 @@ endef $(PACKAGE_DIR): mkdir -p $@ - + dumpinfo: download: prepare: configure: compile: install: -clean: FORCE +clean-staging: FORCE + rm -f $(STAMP_INSTALLED) + for dir in "$(STAGING_DIR)" "$(STAGING_DIR_HOST)"; do (\ + cd $$dir; \ + if [ -f packages/$(PKG_NAME).list ]; then \ + cat packages/$(PKG_NAME).list | xargs -r rm -f 2>/dev/null; \ + fi; \ + ) done; + +clean: clean-staging FORCE $(call Build/UninstallDev,$(STAGING_DIR),$(STAGING_DIR_HOST)) $(Build/Clean) - @rm -f $(STAGING_DIR)/stamp/.$(PKG_NAME)-installed - @rm -rf $(PKG_BUILD_DIR) + rm -f $(STAGING_DIR)/packages/$(PKG_NAME).list $(STAGING_DIR_HOST)/packages/$(PKG_NAME).list + rm -rf $(PKG_BUILD_DIR) |