build: rework opkg command invocation
[openwrt/staging/noltari.git] / package / Makefile
index 857c2ebe38b155811e284be25312a95ab8e1a709..87dfe68e06330e5a37daf32315468632b7244cac 100644 (file)
@@ -48,11 +48,16 @@ $(curdir)/install: $(TMP_DIR)/.build $(curdir)/system/opkg/host/install
        - find $(STAGING_DIR_ROOT) -type d | $(XARGS) chmod 0755
        rm -rf $(TARGET_DIR)
        [ -d $(TARGET_DIR)/tmp ] || mkdir -p $(TARGET_DIR)/tmp
-       @echo $(wildcard $(foreach dir,$(PACKAGE_SUBDIRS),$(foreach pkg,$(shell cat $(PACKAGE_INSTALL_FILES) 2>/dev/null),$(dir)/$(pkg)_*.ipk))) | $(OPKG) install
+       $(call opkg,$(TARGET_DIR)) install \
+               $(wildcard \
+                 $(foreach dir,$(PACKAGE_SUBDIRS), \
+                   $(foreach pkg, \
+                     $(shell cat $(PACKAGE_INSTALL_FILES) 2>/dev/null), \
+                     $(dir)/$(pkg)_*.ipk)))
        @for file in $(PACKAGE_INSTALL_FILES); do \
                [ -s $$file.flags ] || continue; \
                for flag in `cat $$file.flags`; do \
-                       $(OPKG) flag $$flag < $$file; \
+                       $(call opkg,$(TARGET_DIR)) flag $$flag `cat $$file`; \
                done; \
        done || true
        @-$(MAKE) package/preconfig