Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a silent mode for download() function. E.g. `download("http://g… #12149

Closed
wants to merge 3 commits into from

Conversation

ewiger
Copy link

@ewiger ewiger commented Jul 14, 2015

…oogle.com", silent=true)` will make not output to STDERR or STDOUT.

Added a test into test/file.jl

…oogle.com", silent=true)` will make not output to STDERR or STDOUT.
@tkelman
Copy link
Contributor

tkelman commented Jul 14, 2015

You can always redirect those streams to suppress them.

Also, ref JuliaPackaging/BinDeps.jl#135

@ewiger
Copy link
Author

ewiger commented Jul 14, 2015

@tkelman can you please give an example of such a call? How does such a suppression would look like when I call download(...)?

@ewiger
Copy link
Author

ewiger commented Jul 14, 2015

Oh.. you mean literally the implementation of download_cmd in BinDeps? Please give an equivalent usage example otherwise I am not following.

My best guess is that you suggest solving JuliaPackaging/BinDeps.jl#135 by merging its download into a Base.download?

@tkelman
Copy link
Contributor

tkelman commented Jul 14, 2015

Sorry, the reference was to a past discussion on improvements to this function. redirect_stdout and redirect_stderr should be able to do this, there are a few examples of this in the tests but I don't have one right in front of me at the moment.

@ewiger
Copy link
Author

ewiger commented Jul 14, 2015

Maybe you mean something like

using BinDeps

cmd = BinDeps.download_cmd("http://google.com", tempname())
run(pipe(cmd, stdout=DevNull, stderr=DevNull))

?

Well yes, if the conclusion of JuliaPackaging/BinDeps.jl#135 is to keep the shellout approach, one can split
Base.download into the silencing part and the part that generates the command like download_cmd

@tkelman
Copy link
Contributor

tkelman commented Jul 14, 2015

I'm not sure there was much of a conclusion to JuliaPackaging/BinDeps.jl#135 yet, other than we should consolidate and improve whatever downloading functionality can be reasonably done well within base. We haven't had people volunteer to work on this area yet as I guess it hasn't been much of a priority, but contributions welcome. We might want to do some design discussion first though, adding flags piecemeal is probably not the ideal way forward.

@ewiger
Copy link
Author

ewiger commented Jul 14, 2015

Ok, I used BinDeps for now. But I will think of a better design in Base.download, maybe by creating a type and some symbols for all the options.

Yauhen Yakimovich added 2 commits July 15, 2015 00:44
…oogle.com", silent=true)` will make not output to STDERR or STDOUT.
Conflicts:
	base/interactiveutil.jl
@tkelman
Copy link
Contributor

tkelman commented Jul 14, 2015

Should we close this for now then? Also note that next time it's best to create a separate branch for pull requests rather than submitting them from your fork's master branch, otherwise you end up with a lot of messy merge commits cluttering up the history.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants