Merge pull request #152463 from panicgh/tbb

tor-browser-bundle-bin: Keep files when store path has not changed

authored by Jaka Hudoklin and committed by GitHub c1792db4 1b3e15be

+11 -4
+11 -4
pkgs/applications/networking/browsers/tor-browser-bundle-bin/default.nix
··· 297 297 cp -u --no-preserve=mode,owner "$TBB_IN_STORE/TorBrowser/Data/Browser/profile.default/bookmarks.html" \ 298 298 "\$HOME/TorBrowser/Data/Browser/profile.default/bookmarks.html" 299 299 300 - # Clear out some files that tend to capture store references but are 301 - # easily generated by firefox at startup. 302 - rm -f "\$HOME/TorBrowser/Data/Browser/profile.default"/{addonStartup.json.lz4,compatibility.ini,extensions.ini,extensions.json} 303 - rm -f "\$HOME/TorBrowser/Data/Browser/profile.default"/startupCache/* 300 + # Clear some files if the last known store path is different from the new one 301 + : "\''${KNOWN_STORE_PATH:=\$HOME/known-store-path}" 302 + if ! [ "\$KNOWN_STORE_PATH" -ef $out ]; then 303 + echo "Cleanup files with outdated store references" 304 + ln -Tsf $out "\$KNOWN_STORE_PATH" 305 + 306 + # Clear out some files that tend to capture store references but are 307 + # easily generated by firefox at startup. 308 + rm -f "\$HOME/TorBrowser/Data/Browser/profile.default"/{addonStartup.json.lz4,compatibility.ini,extensions.ini,extensions.json} 309 + rm -f "\$HOME/TorBrowser/Data/Browser/profile.default"/startupCache/* 310 + fi 304 311 305 312 # XDG 306 313 : "\''${XDG_RUNTIME_DIR:=/run/user/\$(id -u)}"