neogeographica / singleplayer_scripts

Linux desktop and browser integration for SP Quake.
3 stars 0 forks source link

handle dots in archive/gamedir names #20

Closed neogeographica closed 2 years ago

neogeographica commented 3 years ago

For example, the current code would try to put both "foo.zip" and "foo.1.zip" into the "foo" gamedir.

This is because quakelaunch uses ${destdir%%.*} as the gamedir, rather than ${destdir%.*}. Don't remember off the top of my head if that was intentional? I need to check that Quake won't actually barf if the gamedir includes a dot.

neogeographica commented 3 years ago

Yeah Quake doesn't care if the gamedir contains a dot.

neogeographica commented 3 years ago

Ah OK I think I know why I did that.

If an archive is "double packaged" like for example "mymap.tar.gz", aunpack will go ahead and unwind all of that packaging to get to the actual content. In that case, whatever we get out of "mymap.tar.gz" should go into gamedir "mymap". Not, as would be the case with the suggested change above, "mymap.tar".

However in practice I never see releases packaged like that, while I DO see releases that have dots in their names. Probably the change above is the lesser evil.

You get a working thing either way, it's just a matter of whether the gamedir name is a little confusing. Actually, it kind of is a functional issue in the current code, for the reason shown in the OP's example.