InstallDev: Move the "find" out of the lock critical section.
[openwrt/openwrt.git] / include / package.mk
index 712b793d0d63258853f88794d3294ddd0c2556e5..06f3a839c6187b920cdb9226e42af8cf5685ea11 100644 (file)
@@ -132,8 +132,9 @@ define Build/DefaultTargets
                $(call $(hook),$(TMP_DIR)/stage-$(PKG_NAME),$(TMP_DIR)/stage-$(PKG_NAME)/host)$(sep)\
        )
        if [ -d $(TMP_DIR)/stage-$(PKG_NAME) ]; then \
+               (cd $(TMP_DIR)/stage-$(PKG_NAME); find ./ > $(TMP_DIR)/stage-$(PKG_NAME).files); \
                $(call locked, \
-                       (cd $(TMP_DIR)/stage-$(PKG_NAME); find ./ > $(STAGING_DIR)/packages/$(STAGING_FILES_LIST)); \
+                       mv $(TMP_DIR)/stage-$(PKG_NAME).files $(STAGING_DIR)/packages/$(STAGING_FILES_LIST) && \
                        $(CP) $(TMP_DIR)/stage-$(PKG_NAME)/* $(STAGING_DIR)/; \
                ,staging-dir); \
        fi