tar extraction depends on filename?

The reason for the error you are seeing can be found in the GNU tar documentation:

If the archive file name includes a colon (‘:’), then it is assumed to be a file on another machine[...]

That is, it is interpretting SQliteManager-1.2.4.tar.gz?r=http as a host name and trying to resolve it to an IP address, hence the "resolve failed" error.

That same documentation goes on to say:

If you need to use a file whose name includes a colon, then the remote tape drive behavior can be inhibited by using the ‘--force-local’ option.


When you download with wget, specify the output file name with the -O option.

wget "http://domain.com/file.tgz?crazy=args&stuff=todelete" -O file.tgz

This will cause the file to save with the given filename and save you the trouble or renaming it. And no, you are not the only one that wishes sourcefourge wouldn't be so dumb as to pass out files with the url parameters attached.


Download using

wget --trust-server-names URL

That way wget will save with the correct file names. By default it uses the last component in the URL

For eg

wget --trust-server-names http://sourceforge.net/projects/sqlitemanager/files/sqlitemanager/1.2.4/SQliteManager-1.2.4.tar.gz/download

Tags:

Shell

Tar

Gzip