.wgetrc makes troubles for wget in atomsDownload()
Reported by Sylvestre LEDRU
-- Bug description --
Bug report by Ronan Keryell <Ronan.Keryell@hpc-project.com>
From Scilab Console menu Applications/Module manager - ATOMS
I got:
atomsDownload: The following file hasn't been downloaded:
- URL : 'http://atoms.scilab.org/TOOLBOXES/64/linux.gz'
- Local location : '/tmp/SD_31128_/.atoms/TOOLBOXES.gz'
Even if I download the right file at the right place it does not work... :-(
Same message when calling directly atomsSystemUpdate()
After some strace -s 1000 -f -p on scilab-cli when executing
atomsSystemUpdate() I've discovered that wget is used with:
execve("/bin/sh", ["sh", "-c", "(wget --timeout=5 http://atoms.scilab.org/TOOLBOXES/64/linux.gz -O /tmp/SD_31183_/.atoms/TOOLBOXES.gz)>/tmp/SD_31183_/unix.out 2>/tmp/SD_31183_/unix.err;"], [/* 59 vars */]) = 0
Unfortunately, if the user has a .wgetrc it may fail!
keryell@an-dro:/tmp/SD_31183_$ (wget --timeout=5 http://atoms.scilab.org/TOOLBOXES/64/linux.gz -O /tmp/SD_31183_/.atoms/TOOLBOXES.gz)
Cannot specify both -k and -O if multiple URLs are given, or in combination
with -p or -r. See the manual for details.
Usage: wget [OPTION]... [URL]...
So a more robust use of wget should be instead:
wget --no-timestamping --no-page-requisites --no-recursive --timeout=5 http://atoms.scilab.org/TOOLBOXES/64/linux.gz -O /tmp/SD_31183_/.atoms/TOOLBOXES.gz
and warn somewhere that a .wgetrc could cause issues.
The straightforward work-around is to move the ~/.wgetrc away during ATOMS
update.
Afterwards, it works.
-- Scilab error message --
-- How to reproduce the bug --