userland-unpack;prep-unpack.mk: fixes and improvements
userland-unpack now supports decompression of non-archive files.
prep-unpack.mk now allows SOURCE_DIR to be manually set.
| | |
| | | ifdef COMPONENT_ARCHIVE$(1) |
| | | ifdef COMPONENT_SRC$(1) |
| | | |
| | | CLEAN_PATHS += $$(COMPONENT_SRC$(1)) |
| | | SOURCE_DIR$(1) = $$(COMPONENT_DIR)/$$(COMPONENT_SRC$(1)) |
| | | # Set source dir if not overridden, then make it absolute. |
| | | SOURCE_DIR$(1) ?= $$(COMPONENT_SRC$(1)) |
| | | SOURCE_DIR$(1) := $$(COMPONENT_DIR)/$$(SOURCE_DIR$(1)) |
| | | |
| | | # Clean is done from COMPONENT_DIR, so we can short the filenames. |
| | | CLEAN_PATHS += $$(shell basename $$(SOURCE_DIR$(1))) |
| | | |
| | | |
| | | UNPACK_STAMP$(1) = $$(SOURCE_DIR$(1))/.unpacked |
| | | |
| | |
| | | COMPONENT_LICENSE_FILE ?= $(COMPONENT_NAME).license |
| | | |
| | | COMPONENT_DIR := $(shell pwd) |
| | | SOURCE_DIR = $(COMPONENT_DIR)/$(COMPONENT_SRC) |
| | | BUILD_DIR = $(COMPONENT_DIR)/build |
| | | PROTO_DIR = $(BUILD_DIR)/prototype/$(MACH) |
| | | |
| | |
| | | ruby_ver = os.getenv('RUBY_VERSION', '') |
| | | uncompress = "/usr/ruby/" + ruby_ver + "/bin/gem unpack" |
| | | |
| | | unpack = " | gtar -xf -" |
| | | # if the file is just compressed, redirect stdout to ./filename with |
| | | # one less extension. |
| | | unpack = " > ./" + '.'.join(os.path.basename(filename).split('.')[:-1]) |
| | | |
| | | if (re.search("(\.zip)$", filename) != None): |
| | | if (re.search("(\.tar\.[^\.]+|\.tgz|\.txz|\.tbz2?)$",filename) != None): |
| | | unpack = " | gtar -xf -" |
| | | elif (re.search("(\.zip)$", filename) != None): |
| | | unpack = "" |
| | | elif (re.search("(\.oxt)$", filename) != None): |
| | | unpack = "" |
| | |
| | | unpack = "" |
| | | |
| | | if (verbose == True): |
| | | print("command: %s %s %s" % (uncompress, filename, unpack)) |
| | | print("command: %s %s%s" % (uncompress, filename, unpack)) |
| | | |
| | | return uncompress, unpack |
| | | |
| | |
| | | permissions = None |
| | | relocate_to = None |
| | | |
| | | if len(sys.argv) == 1: |
| | | usage() |
| | | |
| | | try: |
| | | opts, args = getopt.getopt(sys.argv[1:], "fr:v", |
| | | ["fix-permissions", "relocate-to=", "verbose"]) |