Skip to content

Commit

Permalink
ignore errors during migration
Browse files Browse the repository at this point in the history
  • Loading branch information
taukakao committed Nov 22, 2024
1 parent 9cd20e8 commit 61a724d
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions core/integrity.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ var pathsToRepair = [...]string{
}

func RepairRootIntegrity(rootPath string) (err error) {
err = fixupOlderSystems(rootPath)
if err != nil {
return err
}
fixupOlderSystems(rootPath)

err = repairLinks(rootPath)
if err != nil {
Expand Down Expand Up @@ -145,7 +142,7 @@ func repairPath(path string) (err error) {

// this is here to keep compatibility with older systems
// e.g. /media was a folder instead of a symlink to /var/media
func fixupOlderSystems(rootPath string) (err error) {
func fixupOlderSystems(rootPath string) {
paths := []string{
"media",
"mnt",
Expand All @@ -160,10 +157,9 @@ func fixupOlderSystems(rootPath string) (err error) {
err = exec.Command("mv", legacyPath, newPath).Run()
if err != nil {
PrintVerboseErr("fixupOlderSystems", 1, "could not move ", legacyPath, " to ", newPath, " : ", err)
return err
// if moving failed it probably means that it migrated successfully in the past
// so it's safe to ignore errors
}
}
}

return nil
}

0 comments on commit 61a724d

Please sign in to comment.