Opened 13 years ago

Closed 7 years ago

#506 closed change (fixed (in master))

MacOS: Keep SVN Angband from interfering with other versions

Reported by: roustk@… Owned by: myshkin
Milestone: 3.5.0 Keywords: mac

Description (last modified by fizzix)

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/ 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.


Attachments (2)

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

Download all attachments as: .zip

Change History (15)

Changed 13 years ago by roustk@…

Example AngbandSafe?.xml file

comment:1 Changed 12 years ago by takkaria

  • Milestone changed from Future to 3.1.1 beta

comment:2 Changed 11 years 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 ../ as a development version always.

Changed 11 years ago by morth

patch for not associating dev angband with prod save files.

comment:3 Changed 11 years 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.

comment:4 Changed 11 years 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.

comment:5 Changed 11 years 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

comment:6 Changed 11 years ago by takkaria

  • Status changed from new to confirmed

comment:7 Changed 10 years ago by magnate

  • Milestone changed from 3.2.0 to 3.3.0

Postponing until 3.3

comment:8 Changed 9 years ago by takkaria

  • Milestone changed from 3.3.0 to 3.4.0


comment:9 Changed 9 years ago by myshkin

  • Owner set to myshkin
  • Status changed from confirmed to assigned

comment:10 Changed 9 years ago by myshkin

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.

comment:11 Changed 8 years ago by fizzix

  • Description modified (diff)
  • Milestone changed from 3.4.0 to 3.5.0


comment:12 Changed 7 years ago by takkaria

  • Milestone changed from 3.5.0 to Future

comment:13 Changed 7 years ago by takkaria

  • Milestone changed from Future to 3.5.0
  • Resolution set to fixed (in master)
  • Status changed from assigned to closed

Fixed as of [a20a52f].

Note: See TracTickets for help on using tickets.