I'm trying to learn how to write ports. I'm trying my hand at some simple things first. One issue I've run into is that on some sites, like Github, I may run into instances where the link to download the file has one name, but when I click on the link in a web browser, it downloads with a different name. The link may have nothing but a version number, but the downloaded file may have the software's name appended. Yet freeBSD's fetch command download's the file with the name in the link without changing it to the proper, expected name. How do I get the desired behavior?
For example, the link may be https://github.com/bibendovsky/bstone/archive/v1.1.9.tar.gz and the file, when downloaded with a web browser, will be named bstone-1.1.9.tar.gz, but fetch will save the file as v1.1.9.tar.gz. Obviously this is unacceptable because it would lead to filename collisions when downloading distfiles. I use Github in my example, but this kind of behavior can be observed on other download sites as well.
For example, the link may be https://github.com/bibendovsky/bstone/archive/v1.1.9.tar.gz and the file, when downloaded with a web browser, will be named bstone-1.1.9.tar.gz, but fetch will save the file as v1.1.9.tar.gz. Obviously this is unacceptable because it would lead to filename collisions when downloading distfiles. I use Github in my example, but this kind of behavior can be observed on other download sites as well.