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 Nov 29, 2020
1 parent f4ff888 commit e2ba239
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/appimaged/appimaged.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (

"github.com/probonopd/go-appimage/internal/helpers"
"github.com/prometheus/procfs"
crossdevice "gist.github.com/eMPee584/640770aacd7d744124bccbf311a6a790.git"
)

// TODO: Understand whether we can make clever use of
Expand Down Expand Up @@ -314,7 +315,7 @@ 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())
err = crossdevice.MoveFile(desktopcachedir+"/"+file.Name(), xdg.DataHome+"/applications/"+file.Name())
helpers.LogError("main", err)
}

Expand Down

0 comments on commit e2ba239

Please sign in to comment.