🎨 Upgrade kernel dpes

This commit is contained in:
Daniel 2023-10-30 17:28:19 +08:00
parent 9797e5e032
commit ca37685d08
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
6 changed files with 9 additions and 13 deletions

View file

@ -333,7 +333,7 @@ func (box *Box) Move(oldPath, newPath string) error {
fromPath := filepath.Join(boxLocalPath, oldPath)
toPath := filepath.Join(boxLocalPath, newPath)
if err := filelock.Move(fromPath, toPath); nil != err {
if err := filelock.Rename(fromPath, toPath); nil != err {
msg := fmt.Sprintf(Conf.Language(5), box.Name, fromPath, err)
logging.LogErrorf("move [path=%s] in box [%s] failed: %s", fromPath, box.Name, err)
return errors.New(msg)

View file

@ -1208,7 +1208,7 @@ func moveDoc(fromBox *Box, fromPath string, toBox *Box, toPath string, luteEngin
if gulu.File.IsExist(absToPath) {
filelock.Remove(absToPath)
}
if err = filelock.Move(absFromPath, absToPath); nil != err {
if err = filelock.Rename(absFromPath, absToPath); nil != err {
msg := fmt.Sprintf(Conf.Language(5), fromBox.Name, fromPath, err)
logging.LogErrorf("move [path=%s] in box [%s] failed: %s", fromPath, fromBox.ID, err)
err = errors.New(msg)
@ -1233,7 +1233,7 @@ func moveDoc(fromBox *Box, fromPath string, toBox *Box, toPath string, luteEngin
} else {
absFromPath := filepath.Join(util.DataDir, fromBox.ID, fromPath)
absToPath := filepath.Join(util.DataDir, toBox.ID, newPath)
if err = filelock.Move(absFromPath, absToPath); nil != err {
if err = filelock.Rename(absFromPath, absToPath); nil != err {
msg := fmt.Sprintf(Conf.Language(5), fromBox.Name, fromPath, err)
logging.LogErrorf("move [path=%s] in box [%s] failed: %s", fromPath, fromBox.ID, err)
err = errors.New(msg)

View file

@ -337,7 +337,7 @@ func ImportSY(zipPath, boxID, toPath string) (err error) {
return
}
newSyPath := filepath.Join(filepath.Dir(syPath), tree.ID+".sy")
if err = filelock.Move(syPath, newSyPath); nil != err {
if err = filelock.Rename(syPath, newSyPath); nil != err {
logging.LogErrorf("rename .sy from [%s] to [%s] failed: %s", syPath, newSyPath, err)
return
}
@ -437,7 +437,7 @@ func ImportSY(zipPath, boxID, toPath string) (err error) {
})
for i, oldPath := range oldPaths {
newPath := renamePaths[oldPath]
if err = filelock.Move(oldPath, newPath); nil != err {
if err = filelock.Rename(oldPath, newPath); nil != err {
logging.LogErrorf("rename path from [%s] to [%s] failed: %s", oldPath, renamePaths[oldPath], err)
return errors.New("rename path failed")
}

View file

@ -799,7 +799,7 @@ func (tx *Transaction) doInsert(operation *Operation) (ret *TxErr) {
// 只有全局 assets 才移动到相对 assets
targetP := filepath.Join(assets, filepath.Base(assetPath))
if e = filelock.Move(assetPath, targetP); nil != err {
if e = filelock.Rename(assetPath, targetP); nil != err {
logging.LogErrorf("copy path of asset from [%s] to [%s] failed: %s", assetPath, targetP, err)
return ast.WalkContinue
}