[kirkwood] enable mach support for OpenRD Base and OpenRD Client (#8417), spare the...
[openwrt.git] / include / package-ipkg.mk
index f08cf89..ce979a1 100644 (file)
@@ -49,6 +49,7 @@ ifeq ($(DUMP),)
     IPKG_$(1):=$(PACKAGE_DIR)/$(1)_$(VERSION)_$(PKGARCH).ipk
     IDIR_$(1):=$(PKG_BUILD_DIR)/ipkg-$(PKGARCH)/$(1)
     INFO_$(1):=$(IPKG_STATE_DIR)/info/$(1).list
     IPKG_$(1):=$(PACKAGE_DIR)/$(1)_$(VERSION)_$(PKGARCH).ipk
     IDIR_$(1):=$(PKG_BUILD_DIR)/ipkg-$(PKGARCH)/$(1)
     INFO_$(1):=$(IPKG_STATE_DIR)/info/$(1).list
+    KEEP_$(1):=$(strip $(call Package/$(1)/conffiles))
 
     ifeq ($(if $(VARIANT),$(BUILD_VARIANT)),$(VARIANT))
     ifdef Package/$(1)/install
 
     ifeq ($(if $(VARIANT),$(BUILD_VARIANT)),$(VARIANT))
     ifdef Package/$(1)/install
@@ -79,7 +80,7 @@ ifeq ($(DUMP),)
        mkdir -p $(STAGING_DIR_ROOT)/stamp $(STAGING_DIR_ROOT)/tmp-$(1)
        $(call Package/$(1)/install,$(STAGING_DIR_ROOT)/tmp-$(1))
        $(call Package/$(1)/install_lib,$(STAGING_DIR_ROOT)/tmp-$(1))
        mkdir -p $(STAGING_DIR_ROOT)/stamp $(STAGING_DIR_ROOT)/tmp-$(1)
        $(call Package/$(1)/install,$(STAGING_DIR_ROOT)/tmp-$(1))
        $(call Package/$(1)/install_lib,$(STAGING_DIR_ROOT)/tmp-$(1))
-       $(CP) $(STAGING_DIR_ROOT)/tmp-$(1)/. $(STAGING_DIR_ROOT)/
+       $(call locked,$(CP) $(STAGING_DIR_ROOT)/tmp-$(1)/. $(STAGING_DIR_ROOT)/,root-copy)
        rm -rf $(STAGING_DIR_ROOT)/tmp-$(1)
        touch $$@
 
        rm -rf $(STAGING_DIR_ROOT)/tmp-$(1)
        touch $$@
 
@@ -101,7 +102,8 @@ ifeq ($(DUMP),)
                echo "Provides: $(PROVIDES)"; \
                echo "Source: $(SOURCE)"; \
                echo "Section: $(SECTION)"; \
                echo "Provides: $(PROVIDES)"; \
                echo "Source: $(SOURCE)"; \
                echo "Section: $(SECTION)"; \
-               echo "Status: install $(if $(filter hold,$(PKG_FLAGS)),hold,ok) not-installed"; \
+               echo "Status: unknown $(if $(filter hold,$(PKG_FLAGS)),hold,ok) not-installed"; \
+               echo "Essential: $(if $(filter essential,$(PKG_FLAGS)),yes,no)"; \
                echo "Priority: $(PRIORITY)"; \
                echo "Maintainer: $(MAINTAINER)"; \
                echo "Architecture: $(PKGARCH)"; \
                echo "Priority: $(PRIORITY)"; \
                echo "Maintainer: $(MAINTAINER)"; \
                echo "Architecture: $(PKGARCH)"; \
@@ -112,13 +114,27 @@ ifeq ($(DUMP),)
        (cd $$(IDIR_$(1))/CONTROL; \
                $($(1)_COMMANDS) \
        )
        (cd $$(IDIR_$(1))/CONTROL; \
                $($(1)_COMMANDS) \
        )
+
+    ifneq ($$(KEEP_$(1)),)
+               @( \
+                       keepfiles=""; \
+                       for x in $$(KEEP_$(1)); do \
+                               [ -f "$$(IDIR_$(1))/$$$$x" ] || keepfiles="$$$${keepfiles:+$$$$keepfiles }$$$$x"; \
+                       done; \
+                       [ -z "$keepfiles" ] || { \
+                               mkdir -p $$(IDIR_$(1))/lib/upgrade/keep.d; \
+                               for x in $$$$keepfiles; do echo $$$$x >> $$(IDIR_$(1))/lib/upgrade/keep.d/$(1); done; \
+                       }; \
+               )
+    endif
+
        $(IPKG_BUILD) $$(IDIR_$(1)) $(PACKAGE_DIR)
        @[ -f $$(IPKG_$(1)) ]
 
     $$(INFO_$(1)): $$(IPKG_$(1))
        @[ -d $(TARGET_DIR)/tmp ] || mkdir -p $(TARGET_DIR)/tmp
        $(OPKG) install $$(IPKG_$(1))
        $(IPKG_BUILD) $$(IDIR_$(1)) $(PACKAGE_DIR)
        @[ -f $$(IPKG_$(1)) ]
 
     $$(INFO_$(1)): $$(IPKG_$(1))
        @[ -d $(TARGET_DIR)/tmp ] || mkdir -p $(TARGET_DIR)/tmp
        $(OPKG) install $$(IPKG_$(1))
-       $(if $(PKGFLAGS),for flag in $(PKGFLAGS); do $(OPKG) flag $$$$flag $(1); done)
+       $(if $(filter-out essential,$(PKG_FLAGS)),for flag in $(filter-out essential,$(PKG_FLAGS)); do $(OPKG) flag $$$$flag $(1); done)
 
     $(1)-clean:
        rm -f $(PACKAGE_DIR)/$(1)_*
 
     $(1)-clean:
        rm -f $(PACKAGE_DIR)/$(1)_*
This page took 0.019603 seconds and 4 git commands to generate.