make: centralize wget/curl & unzip/7z feature test#1431
make: centralize wget/curl & unzip/7z feature test#1431Kijewski merged 1 commit intoRIOT-OS:masterfrom Kijewski:wget-for-everyone-woooohooooo
Conversation
|
What kind of hamsters? |
|
Whaaat!?! That's too cute to bear. |
|
The behavior is kinda specified in the man page: http://www.unix.com/man-page/opensolaris/0/UNZIP/ (section "ENVIRONMENT OPTIONS")
I guess change this behavior now would cause the maintainers too much trouble. At least FreeBSD does not mention the environment variable in it's man page, but Linux, Solaris and DragonflyBSD do. |
|
OT: They could change the "API" to make it saner, that's what major releases are for ;-) |
|
So … ACK? |
|
Ping. |
There was a problem hiding this comment.
why isn't axel treated in the same manner as wget and curl (or the other way around)?
There was a problem hiding this comment.
axel can't output to stdout.
There was a problem hiding this comment.
I was thinking more about the if/else construct, but you could still give /dev/stdout as a file.. as long as axel does not spam around that is.
There was a problem hiding this comment.
Nope, you can't. While downloading axel always creates a file with the same name + some extension, so you can continue an interrupted download.
There was a problem hiding this comment.
Or do you mean
DOWNLOAD_TO_FILE := $(if $(AXEL),$(AXEL) -n 4 -q -a -o,$(if $(WGET),$(WGET) -nv -c -O,$(CURL) -s -o))I think this is unreadable. But maybe
$(strip $(if $(AXEL), $(AXEL) -n 4 -q -a -o,
$(if $(WGET), $(WGET) -nv -c -O,
$(CURL) -s -o)))?
There was a problem hiding this comment.
The last one reflects the logic better I'd say.
There was a problem hiding this comment.
While downloading axel always creates a file with the same name + some extension, so you can continue an interrupted download.
OK then.
|
@LudwigOrtmann please see my last commit |
|
Nope, nesting |
pkg/openwsn/Makefile
Outdated
|
I suggest you change the documentation around this along with the PR (i.e. |
|
Hm, I think I'll rewrite the pkg'ing description in the wiki soonish. I stumbled upon some gotchas that are not addressed in the examples. |
|
Is there some known test application for OpenWSN? |
|
Nope, it's an outstanding issue: #1231. |
|
I don't think we should wait for #1231 to be resolved. :) |
|
Ping. This PR was meant to make the work easier for the SWP people. I don't know if this is needed anymore after the month delay. |
|
@thomaseichinger ping |
|
I know, I'm on it, but I'll have to "undo" all my additional setups to test this. |
pkg/openwsn/Makefile
Outdated
There was a problem hiding this comment.
This line doesn't work, please change to
$(AD)$(UNZIP_HERE) $< -d $(PKG_NAME)-$(PKG_VERSION)It creates $@
There was a problem hiding this comment.
$(AD)cd $(CURDIR) && $(UNZIP_HERE) $<? I intended this command not to have any further parameters. E.g. -d is not understood by 7z.
There was a problem hiding this comment.
The archive extracts to a not "pretty"/long name and if I use -d option in the package Makefile it's just an extension to your command and I don't need to change the accompanying scripts :-)
|
Tested for OS X and FreeBSD with wget/curl & unzip. I don't have any 7z installed. |
With many open PRs that could benefit from loading SDKs when needed, instead adding vast amounts of code to RIOTs master, this PR provides the "functions" `$(DOWNLOAD_TO_STDOUT)`, `$(DOWNLOAD_TO_FILE)`, and `$(UNZIP_HERE)`. The first "function" takes one argument, the URL from where to download the content. It is then piped to stdout. To be used e.g. with `tar xz`. The second "function" taken two arguments, the destination file name, and the source URL. If the previous invocation was interrupted, then the download gets continued, if possible. The last "function" takes one argument, the source ZIP file. The file gets extracted into the cwd, so best use this "function" with `cd $(SOME_WHERE) &&`. The clumsy name `$(UNZIP_HERE)` is taken because the program "unzip" takes the environment variable `UNZIP` as the source file, even if another file name was given on the command line. The rationale for that is that the hackers of "unzip" hate their users. Also they sacrifice hamsters to Satan.
|
@thomaseichinger ping. |
|
ACK |
make: centralize wget/curl & unzip/7z feature test

With many open PRs that could benefit from loading SDKs when needed,
instead adding vast amounts of code to RIOTs master, this PR provides
the "functions"
$(DOWNLOAD_TO_STDOUT),$(DOWNLOAD_TO_FILE), and$(UNZIP_HERE).The first "function" takes one argument, the URL from where to download
the content. It is then piped to stdout. To be used e.g. with
tar xz.The second "function" taken two arguments, the destination file name,
and the source URL. If the previous invocation was interrupted, then the
download gets continued, if possible.
The last "function" takes one argument, the source ZIP file. The file
gets extracted into the cwd, so best use this "function" with
cd $(SOME_WHERE) &&.The clumsy name
$(UNZIP_HERE)is taken because the program "unzip"takes the environment variable
UNZIPas the source file, even ifanother file name was given on the command line. The rationale for that
is that the hackers of "unzip" hate their users. Also they sacrifice
hamsters to Satan.