MacOS: Keep SVN Angband from interfering with other versions

When I compiled a new version of Angband from SVN last night, I found that it interfered significantly with my existing v3.0.9 installation:

MacOS associated savefiles with the SVN version.

The SVN version could not parse and overwrote my window size and location preferences.

I would like to be able to use v3.0.9 for my real games, while using svn for testing.

I propose two changes that will isolate the new version and keep it from interfering with the main version:

Add a compile-time switch to Makefile.osx that changes "PLIST = osx/Angband.xml" to "PLIST = osx/AngbandSafe.xml". (I'm not a Makefile guru, but it seems like this should be plausible.)

Add a file osx/AngbandSafe.xml that is a copy of osx/Angband.xml with two modifications (see attached):

Change CFBundleIdentifier to be "net.thangorodrim.$NAME$SVN" rather than "net.thangorodrim.$NAME$".

Delete the entire CFBundleDocumentTypes branch.

The first change to the xml file will put window preferences in ~/Library/Preferences?/net.thangorodrim.AngbandSVN.plist rather than the usual location. The second change will prevent the OS from associating savefiles with the new application bundle.

I have tested both these modifications (first by making the xml changes directly to trunk/Angband.app/Contents/Info.plist and later re-compiling as specified above) and everything seems to work as I would like -- double-click or 'open' a savefile opens 3.0.9, and 3.0.9 and SVN can maintain different window locations without interference.

Note carefully: under this proposal, both versions still access the same bone, data, score, and save directories (in ~/Library/Preferences/Angband?). This certainly has the potential to be dangerous, but the worst effects can be avoided by just deleting the *.raw files when switching versions.

I'd go about this a little different. The angband application is copied to disttemp/ as part of the disk image creation process. I'd be easy to install a special Info.plist file after that is done and keep the one in ../Angband.app as a development version always.

Well, I'm on a rainy vacation, so attached a diff to solve the main problem. I ended up simply using sed to remove the DIST comments and replacing the bundle identifier.

The second problem (both versions use ~/Library/Preferences/Angband/? dir) needs another fix. I probably have to redefine PRIVATE_USER_PATH to a function call returning a static buffer. I'll attach a separate patch for that.

Hrm, my intended fix for the second problem was no good, but perhaps it's not a real problem anyway.

I forgot to mention why I removed the fsetinfo call for text files. Angband does not handle manually opening text files, so it's much better that they open in the normal text editor than sent to Angband and then ignored.

Changes to the above that need to happen: change net.thangorodrim to org.rephial (probably), update to respect v4, update pref/save directory location to something else (Angband-dev?). Some of the function calls may need to change with the move to non-deprecated system calls, too.