Opened 11 years ago

Closed 10 years ago

#2363 closed Bug (fixed)

daemon on mac moves config files on first launch

Reported by: Waldorf Owned by:
Priority: Normal Milestone: 2.20
Component: libtransmission Version: 1.74
Severity: Normal Keywords: needinfo
Cc:

Description

[...] Instead of copying. This causes the Mac gui to lose all transfers.

I suggest to either:

  1. Don't move a thing and start a clean session
  2. copy the config files

Change History (10)

comment:1 Changed 11 years ago by charles

I don't know what this ticket is talking about.

comment:2 Changed 11 years ago by charles

Waldorf: could you elaborate on this?

The daemon shouldn't know about the gui's config files at all. I think it just uses ~/Library/Application? Support/transmission-daemon ...

comment:3 Changed 11 years ago by charles

  • Keywords needinfo added

Waldorf: ping

comment:4 Changed 11 years ago by livings124

  • Resolution set to invalid
  • Status changed from new to closed

comment:5 Changed 10 years ago by bulljit

  • Resolution invalid deleted
  • Status changed from closed to reopened
  • Version changed from 1.74 to 2.13+

I can confirm this bug and reproduce it consistently:

  1. latest transmission-daemon built with xcode
  2. also use Transmission.app (not as same time of course)
  3. when Daemon is started... all files in ~/ Library / Application Support / Transmission / Torrents get moved into ~/ Library / Application Support / transmission-daemon / Torrents (not desired)
  4. this results in what Waldorf was describing as "Mac gui to lose all transfers."

I believe I figured out the fix, but need a REAL programmer to confirm it...

https://forum.transmissionbt.com/viewtopic.php?f=4&t=7532&p=52071#p52071

Thanks!!!

comment:6 Changed 10 years ago by jordan

bulljit, could you please test this change?

Go into libtransmission/platform.c and replace migrateFiles() with this implementation:

/**
 * This function is for transmission-gtk users to migrate the config files
 * from $HOME/.transmission/ (where they were kept before Transmission 1.30)
 * to $HOME/.config/$appname as per the XDG directory spec.
 */
static void
migrateFiles( const tr_session * session )
{
    static int migrated = FALSE;
    const tr_bool should_migrate = strstr( getOldConfigDir(), ".transmission" ) != NULL;

    if( !migrated && should_migrate )
    {
        const char * oldDir;
        const char * newDir;

        migrated = TRUE;

        oldDir = getOldTorrentsDir( );
        newDir = tr_getTorrentDir( session );
        moveFiles( oldDir, newDir );

        oldDir = getOldCacheDir( );
        newDir = tr_getResumeDir( session );
        moveFiles( oldDir, newDir );
    }
}

comment:7 Changed 10 years ago by jordan

By the way, your patch in the forums may not have been perfect, but (a) it was definitely in the right area and (b) it led me to understanding the cause of the problem. For a nonprogrammer to dig through the code and get so close is pretty damn impressive. Well done!

comment:8 Changed 10 years ago by jordan

  • Version changed from 2.13+ to 1.74

comment:9 Changed 10 years ago by bulljit

Looks like you found a way to fix it too. Though your solution requires more lines of code =P. I kid.

I built a new Daemon in Xcode with your patch, and tested different changes with the Transmission.app and it seems to work PERFECTLY! They play nicely together now.

Thanks for the quick response. Will this be migrated into the SVN soon?

comment:10 Changed 10 years ago by jordan

  • Component changed from Transmission to libtransmission
  • Milestone changed from None Set to 2.20
  • Resolution set to fixed
  • Status changed from reopened to closed

Yes.

r11785 libtransmission/platform.c:

(trunk libT) #2363 "daemon on mac moves config files on first launch" -- fixed.

Don't run platform.c's migrateFiles() except on *nix platforms. Add comment explaining when the function is used and why.

Note: See TracTickets for help on using tickets.