Skip to content

Commit

Permalink
Prevent loop of unsuccessfull attempts (invalid cross-device link) to…
Browse files Browse the repository at this point in the history
… move desktop file when user's cache directory lies on a tmpfs mount (unburden-home-dir set up to minimize flash writes)

appimaged: 2020/11/29 19:33:24 Registering AppImages in [/home/user/Downloads /home/user/Desktop /home/user/Applications /opt /usr/local/bin]
appimaged: 2020/11/29 ERROR main: rename /home/user/.cache/applications//appimagekit_6f9acfe2118f26ccc7b52fb34e248f97.desktop /home/user/.local/share/applications/appimagekit_6f9acfe2118f26ccc7b52fb34e248f97.desktop: invalid cross-device link
appimaged: 2020/11/29 19:33:27 main: Moved 1 desktop files to /home/user/.local/share/applications/; use -v to see details
appimaged: 2020/11/29 19:33:27 Desktop notification:  Added application
appimaged: 2020/11/29 19:33:27 Ran update-desktop-database /home/user/.local/share/applications/
  • Loading branch information
eMPee584 committed Dec 22, 2020
1 parent f4ff888 commit 46e1297
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/appimaged/appimaged.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,10 @@ func moveDesktopFiles() {
if *verbosePtr == true {
log.Println("main: Moving", file.Name(), "to", xdg.DataHome+"/applications/")
}
err = os.Rename(desktopcachedir+"/"+file.Name(), xdg.DataHome+"/applications/"+file.Name())

// Call external mv because os.Rename() may fail with EXDEV error "invalid cross-device link"
cmd := exec.Command("mv", desktopcachedir+"/"+file.Name(), xdg.DataHome+"/applications/")
err := cmd.Run()
helpers.LogError("main", err)
}

Expand Down

0 comments on commit 46e1297

Please sign in to comment.