graysky2 / profile-sync-daemon

Symlinks and syncs browser profile dirs to RAM thus reducing HDD/SDD calls and speeding-up browsers.
https://wiki.archlinux.org/index.php/Profile-sync-daemon
Other
910 stars 88 forks source link

psd thinks firefox profile and firefox developer edition profile are the same #243

Open ghost opened 5 years ago

ghost commented 5 years ago
Psd will manage the following per /home/xxx/.config/psd/psd.conf:

 browser/psname:  firefox/firefox
 owner/group id:  xxx/1000
 sync target:     /home/xxx/.mozilla/firefox/kvjnd201.dev-edition-default
 tmpfs dir:       /run/user/1000/xxx-firefox-kvjnd201.dev-edition-default
 profile size:    64M
 recovery dirs:   2 <- delete with the c option
  dir path/size:  /home/xxx/.mozilla/firefox/kvjnd201.dev-edition-default-backup-crashrecovery-20190706_065434 (64M)
  dir path/size:  /home/xxx/.mozilla/firefox/eipdkzzb.default-backup-crashrecovery-20190706_065434 (273M)

 browser/psname:  firefox/firefox
 owner/group id:  xxx/1000
 sync target:     /home/xxx/.mozilla/firefox/eipdkzzb.default
 tmpfs dir:       /run/user/1000/xxx-firefox-eipdkzzb.default
 profile size:    273M
 recovery dirs:   2 <- delete with the c option
  dir path/size:  /home/xxx/.mozilla/firefox/kvjnd201.dev-edition-default-backup-crashrecovery-20190706_065434 (64M)
  dir path/size:  /home/xxx/.mozilla/firefox/eipdkzzb.default-backup-crashrecovery-20190706_065434 (273M)

If I try to clean the recovery dirs, then it cleans both of them on the first try which leaves none for the other one:

$ psd c
Profile-sync-daemon v6.34 on Arch Linux

Deleting 2 crashrecovery dir(s) for profile /home/xxx/.mozilla/firefox/kvjnd201.dev-edition-default
 /home/xxx/.mozilla/firefox/kvjnd201.dev-edition-default-backup-crashrecovery-20190706_065434
 /home/xxx/.mozilla/firefox/eipdkzzb.default-backup-crashrecovery-20190706_065434

Found no crashrecovery dirs for: /home/xxx/.mozilla/firefox/eipdkzzb.default

Given that there's an opera, opera-beta, opera-developer, and opera-legacy; and google-chrome, google-chrome-beta, nd google-chrome-unstable, I'm just slightly surprised that there's only one for Firefox (not counting the Ubuntu firefox-trunk).

ghost commented 5 years ago

Upon reviewing https://github.com/graysky2/profile-sync-daemon/blob/master/common/browsers/firefox it makes sense why that's happening. I think it might be a good idea to have a real .ini parser. But even if that was done then I don't know how psd could distinguish between profiles. The profile name is a good heuristic but it is not perfect because a name is just a name; same goes for the profile directory path name. And this doesn't account for multiple non-default profiles.

graysky2 commented 5 years ago

Firefox and clones are not as straight forward as others. A proper ini parser would be good but beyond my abilities.

ghost commented 5 years ago

Maybe we can handle the default case and just grep or grep -v for dev-edition?

graysky2 commented 5 years ago

PRs are welcome.