From e62f14e707e15df962952f571dec1179b1c6976c Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 4 Aug 2007 19:32:38 +0000 Subject: avoid multiple backups of 0.99 session state git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2244 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/session_state.cc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'libs/ardour/session_state.cc') diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index e14c1c3779..1f8a4e1fbe 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -814,13 +814,17 @@ Session::load_state (string snapshot_name) backup_path += "-1"; backup_path += _statefile_suffix; - info << string_compose (_("Copying old session file %1 to %2\nUse %2 with Ardour versions before 2.0 from now on"), - xmlpath, backup_path) - << endmsg; + /* don't make another copy if it already exists */ - copy_file (xmlpath, backup_path); - - /* if it fails, don't worry. right? */ + if (!Glib::file_test (backup_path, Glib::FILE_TEST_EXISTS)) { + info << string_compose (_("Copying old session file %1 to %2\nUse %2 with Ardour versions before 2.0 from now on"), + xmlpath, backup_path) + << endmsg; + + copy_file (xmlpath, backup_path); + + /* if it fails, don't worry. right? */ + } } return 0; -- cgit v1.2.3