trap chmod errors in tar unpack on bsd - modes like 02755 fail
[openwrt/svn-archive/archive.git] / include / unpack.mk
1 ifeq ($(strip $(PKG_UNPACK)),)
2 ifneq ($(HOST_OS),Linux)
3 TAR := trapret 2 $(PKG_UNPACK) $(TAR)
4 endif
5 ifneq ($(strip $(PKG_CAT)),)
6 # use existing PKG_CAT
7 PKG_UNPACK:=$(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | $(TAR) -C $(PKG_BUILD_DIR)/.. $(TAR_OPTIONS)
8 ifeq ($(PKG_CAT),unzip)
9 PKG_UNPACK:=unzip -d $(PKG_BUILD_DIR) $(DL_DIR)/$(PKG_SOURCE)
10 endif
11 # replace zcat with $(ZCAT), because some system have it as gzcat
12 ifeq ($(PKG_CAT),zcat)
13 PKG_UNPACK:=$(ZCAT) $(DL_DIR)/$(PKG_SOURCE) | $(TAR) -C $(PKG_BUILD_DIR)/.. $(TAR_OPTIONS)
14 endif
15 else
16 # try to autodetect file type
17 endif
18 endif