X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fopenwrt.git;a=blobdiff_plain;f=include%2Fpackage-ipkg.mk;fp=include%2Fpackage-ipkg.mk;h=7fc0f86124444fc75446a0ac6b3e7a7bfa54e298;hp=fa39c0927cce6552708e2ae574171644ddb77c7f;hb=78d1f3ac61b1740f2a45c40bcde0e83246308a18;hpb=40acc13ca72ca7d2815dc5d94549d5dc48e16e98 diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk index fa39c0927c..7fc0f86124 100644 --- a/include/package-ipkg.mk +++ b/include/package-ipkg.mk @@ -18,10 +18,20 @@ IPKG_REMOVE:= \ IPKG_STATE_DIR:=$(TARGET_DIR)/usr/lib/opkg +# 1: command and initial arguments +# 2: arguments list +# 3: tmp filename +define maybe_use_xargs + $(if $(word 512,$(2)), \ + $(file >$(3),$(2)) $(XARGS) $(1) < "$(3)"; rm "$(3)", \ + $(1) $(2)) +endef + # 1: package name # 2: candidate ipk files define remove_ipkg_files - $(if $(strip $(2)),$(IPKG_REMOVE) $(1) $(2)) + $(if $(strip $(2)), \ + $(call maybe_use_xargs,$(IPKG_REMOVE) $(1),$(2),$(TMP_DIR)/$(1).in)) endef # 1: package name