Ticket #506 (confirmed change)

Opened 2 years ago

Last modified 8 months ago

MacOS: Keep SVN Angband from interfering with other versions

Reported by: roustk@… Owned by:
Milestone: 3.1.3 Keywords: mac
Cc:

Description

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.

Kevin

Attachments

AngbandSafe.xml (0.9 KB) - added by roustk@… 2 years ago.
Example AngbandSafe?.xml file
osx-separate-dev.diff (2.3 KB) - added by morth 9 months ago.
patch for not associating dev angband with prod save files.

Change History

Changed 2 years ago by roustk@…

Example AngbandSafe?.xml file

Changed 14 months ago by takkaria

  • milestone changed from Future to 3.1.1 beta

Changed 9 months ago by morth

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.

Changed 9 months ago by morth

patch for not associating dev angband with prod save files.

Changed 9 months ago by morth

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.

Changed 9 months ago by morth

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.

Changed 8 months ago by takkaria

  • keywords mac added
  • milestone changed from 3.1.1 beta to 3.1.2 beta

bumping; should be good to do in 3.1.2 right after 3.1.1 is released

Changed 8 months ago by takkaria

  • status changed from new to confirmed

Add/Change #506 (MacOS: Keep SVN Angband from interfering with other versions)

Author



Action
as confirmed
 
Note: See TracTickets for help on using tickets.