From 93916d94b1cf4834c911cb6d367e454fa63f955c Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Thu, 15 Jun 2023 11:52:07 +0800 Subject: [PATCH 1/4] :art: Export data.zip and then import it no longer change the file timestamp Fix https://github.com/siyuan-note/siyuan/issues/8540 --- kernel/go.mod | 2 +- kernel/go.sum | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/kernel/go.mod b/kernel/go.mod index 59c51a23b..b2721d4f4 100644 --- a/kernel/go.mod +++ b/kernel/go.mod @@ -5,7 +5,7 @@ go 1.18 require ( github.com/88250/clipboard v0.1.5 github.com/88250/css v0.1.2 - github.com/88250/gulu v1.2.3-0.20230501031728-4d62370997cd + github.com/88250/gulu v1.2.3-0.20230615033005-b519d6875346 github.com/88250/lute v1.7.6-0.20230608014232-e10343eb445d github.com/88250/pdfcpu v0.3.14-0.20230401044135-c7369a99720c github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1 diff --git a/kernel/go.sum b/kernel/go.sum index 52993d615..28db959dc 100644 --- a/kernel/go.sum +++ b/kernel/go.sum @@ -6,8 +6,8 @@ github.com/88250/css v0.1.2 h1:+AADhEwWoGZFbUjqIsBcdnq2xfj8fDFDAGRXhBUhUY8= github.com/88250/css v0.1.2/go.mod h1:XfcZHQ0YuUb9VncVBurQfVyw1ZQicsB5Gc9N7BK3/ig= github.com/88250/go-sqlite3 v1.14.13-0.20220714142610-fbbda1ee84f5 h1:8HdZozCsXSiEXYAo8Zbi/r2Ld6Dd4MmGHgir3EaSuHQ= github.com/88250/go-sqlite3 v1.14.13-0.20220714142610-fbbda1ee84f5/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/88250/gulu v1.2.3-0.20230501031728-4d62370997cd h1:PgbmnoTqfVbYyhUljovnAz6l/oWPlbM1d5yrkVDHO1w= -github.com/88250/gulu v1.2.3-0.20230501031728-4d62370997cd/go.mod h1:pTWnjt+6qUqNnP9xltswsJxgCBVu3C7eW09u48LWX0k= +github.com/88250/gulu v1.2.3-0.20230615033005-b519d6875346 h1:U0wZN6zuf+vUhzdHC6DbZE/bY5FUt3FuCwn/KgObV44= +github.com/88250/gulu v1.2.3-0.20230615033005-b519d6875346/go.mod h1:pTWnjt+6qUqNnP9xltswsJxgCBVu3C7eW09u48LWX0k= github.com/88250/lute v1.7.6-0.20230608014232-e10343eb445d h1:D3HPp3lcibUYqq6hu/dPP6rx+To23VyE96eMBhwFoNg= github.com/88250/lute v1.7.6-0.20230608014232-e10343eb445d/go.mod h1:+wUqx/1kdFDbWtxn9LYJlaCOAeol2pjSO6w+WJTVQsg= github.com/88250/pdfcpu v0.3.14-0.20230401044135-c7369a99720c h1:Dl/8S9iLyPMTElnWIBxmjaLiWrkI5P4a21ivwAn5pU0= @@ -287,8 +287,6 @@ github.com/siyuan-note/encryption v0.0.0-20220713091850-5ecd92177b75 h1:Bi7/7f29 github.com/siyuan-note/encryption v0.0.0-20220713091850-5ecd92177b75/go.mod h1:H8fyqqAbp9XreANjeSbc72zEdFfKTXYN34tc1TjZwtw= github.com/siyuan-note/eventbus v0.0.0-20230216103454-41885eac6c2b h1:828lTUW2C0uNiolODqoACu7J8sDUzswD4Xo04mUombg= github.com/siyuan-note/eventbus v0.0.0-20230216103454-41885eac6c2b/go.mod h1:Sqo4FYX5lAXu7gWkbEdJF0e6P57tNNVV4WDKYDctokI= -github.com/siyuan-note/filelock v0.0.0-20230523004741-d9121740f638 h1:0dvT+1FvuUf6/GFkFRQML0Q3DLulbswj1GJJ0j7BlD8= -github.com/siyuan-note/filelock v0.0.0-20230523004741-d9121740f638/go.mod h1:v2bpUtjvsvt1TRHgly1mIXQjAEo/t50dOM9YiC813qQ= github.com/siyuan-note/filelock v0.0.0-20230615011542-df9ae6b3f981 h1:ulmzDD3Z3tsJAIec9sLLGuK88tuuE2o9Ux8Vog8KQBc= github.com/siyuan-note/filelock v0.0.0-20230615011542-df9ae6b3f981/go.mod h1:jK5lCYfPbFOrW23/HMeU7kmpLdEd5GkennF+kUpy7Vs= github.com/siyuan-note/httpclient v0.0.0-20230610031552-11458e2e39b0 h1:RKdpy6P1LjUBgQ/7hKO+UmcSwfWzcpMAKRh/deNiVXQ= @@ -411,7 +409,6 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s= golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -430,7 +427,6 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58= golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= From 9841e0b4819e069d483f0258e7da2f9cf2958cf3 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Thu, 15 Jun 2023 11:55:36 +0800 Subject: [PATCH 2/4] :art: Export data.zip and then import it no longer change the file timestamp Fix https://github.com/siyuan-note/siyuan/issues/8540 --- kernel/model/import.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kernel/model/import.go b/kernel/model/import.go index 410ed9896..a23869e1e 100644 --- a/kernel/model/import.go +++ b/kernel/model/import.go @@ -82,6 +82,9 @@ func ImportSY(zipPath, boxID, toPath string) (err error) { util.PushEndlessProgress(Conf.Language(73)) defer util.ClearPushProgress(100) + syncLock.Lock() + defer syncLock.Unlock() + baseName := filepath.Base(zipPath) ext := filepath.Ext(baseName) baseName = strings.TrimSuffix(baseName, ext) @@ -412,6 +415,9 @@ func ImportData(zipPath string) (err error) { util.PushEndlessProgress(Conf.Language(73)) defer util.ClearPushProgress(100) + syncLock.Lock() + defer syncLock.Unlock() + baseName := filepath.Base(zipPath) ext := filepath.Ext(baseName) baseName = strings.TrimSuffix(baseName, ext) From ce252510c140b45fa600c714c8a05ee081b24d43 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Thu, 15 Jun 2023 18:00:47 +0800 Subject: [PATCH 3/4] :art: Update text --- app/appearance/langs/en_US.json | 2 +- app/appearance/langs/es_ES.json | 4 ++-- app/appearance/langs/fr_FR.json | 4 ++-- app/appearance/langs/zh_CHT.json | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/appearance/langs/en_US.json b/app/appearance/langs/en_US.json index 680ca10f8..7c7d8b27e 100644 --- a/app/appearance/langs/en_US.json +++ b/app/appearance/langs/en_US.json @@ -252,7 +252,7 @@ "keyPlaceholder": "Please paste the key string here", "key": "Key", "genKey": "Auto-generate key", - "genKeyByPW": "Generate key by passphrase", + "genKeyByPW": "Gen key by passphrase", "dataRepoKeyTip1": "The data repo is used to encrypt and save data snapshots. Snapshots can be created and rolled back in the data history", "dataRepoKeyTip2": "All devices must use the same key, if the keys are inconsistent, the data cannot be synced to the cloud", "dataRepoKey": "Data repo key", diff --git a/app/appearance/langs/es_ES.json b/app/appearance/langs/es_ES.json index 23f30c232..fcc6282ee 100644 --- a/app/appearance/langs/es_ES.json +++ b/app/appearance/langs/es_ES.json @@ -251,8 +251,8 @@ "importKey": "Importar la clave", "keyPlaceholder": "Por favor, pegue la cadena de claves aquí", "key": "Clave", - "genKey": "Generar clave automáticamente", - "genKeyByPW": "Generar clave por contraseña", + "genKey": "Gen clave automáticamente", + "genKeyByPW": "Gen clave por contraseña", "dataRepoKeyTip1": "El repositorio de datos se utiliza para cifrar y guardar instantáneas de datos. Las instantáneas pueden crearse y revertirse en el historial de datos", "dataRepoKeyTip2": "Todos los dispositivos deben usar la misma clave, si las claves son inconsistentes, los datos no se pueden sincronizar con la nube", "dataRepoKey": "Clave del repositorio de datos", diff --git a/app/appearance/langs/fr_FR.json b/app/appearance/langs/fr_FR.json index e03c1e8cf..985f00d7a 100644 --- a/app/appearance/langs/fr_FR.json +++ b/app/appearance/langs/fr_FR.json @@ -251,8 +251,8 @@ "importKey": "Importer la clé", "keyPlaceholder": "Veuillez coller la chaîne de clé ici", "clé": "Clé", - "genKey": "Clé de génération automatique", - "genKeyByPW": "Générer une clé par phrase secrète", + "genKey": "Clé de gén automatique", + "genKeyByPW": "Gén une clé par phrase secrète", "dataRepoKeyTip1": "Le référentiel de données est utilisé pour chiffrer et enregistrer des instantanés de données. Des instantanés peuvent être créés et restaurés dans l'historique des données", "dataRepoKeyTip2": "Tous les appareils doivent utiliser la même clé, si les clés sont incohérentes, les données ne peuvent pas être synchronisées avec le cloud", "dataRepoKey": "Clé de référentiel de données", diff --git a/app/appearance/langs/zh_CHT.json b/app/appearance/langs/zh_CHT.json index be6ce9a4b..62e59354c 100644 --- a/app/appearance/langs/zh_CHT.json +++ b/app/appearance/langs/zh_CHT.json @@ -251,8 +251,8 @@ "importKey": "導入密鑰", "keyPlaceholder": "請在此處貼上密鑰字串", "key": "密鑰", - "genKey": "Auto-generate key", - "genKeyByPW": "Generate key by passphrase", + "genKey": "自動生成密鑰", + "genKeyByPW": "通過密碼生成密鑰", "dataRepoKeyTip1": "數據倉庫用於加密保存數據快照,可在數據歷史中可創建快照和回滾快照", "dataRepoKeyTip2": "所有設備必須使用相同的密鑰,如果密鑰不一致則無法雲端同步數據", "dataRepoKey": "數據倉庫密鑰", From 90a291f34ca2e03be92d9010fedca9a5a1e31f55 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Thu, 15 Jun 2023 18:06:31 +0800 Subject: [PATCH 4/4] :art: Update text --- app/appearance/langs/es_ES.json | 4 ++-- app/appearance/langs/fr_FR.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/appearance/langs/es_ES.json b/app/appearance/langs/es_ES.json index fcc6282ee..e544d4294 100644 --- a/app/appearance/langs/es_ES.json +++ b/app/appearance/langs/es_ES.json @@ -251,8 +251,8 @@ "importKey": "Importar la clave", "keyPlaceholder": "Por favor, pegue la cadena de claves aquí", "key": "Clave", - "genKey": "Gen clave automáticamente", - "genKeyByPW": "Gen clave por contraseña", + "genKey": "Gen clave auto", + "genKeyByPW": "Clave gen por contraseña", "dataRepoKeyTip1": "El repositorio de datos se utiliza para cifrar y guardar instantáneas de datos. Las instantáneas pueden crearse y revertirse en el historial de datos", "dataRepoKeyTip2": "Todos los dispositivos deben usar la misma clave, si las claves son inconsistentes, los datos no se pueden sincronizar con la nube", "dataRepoKey": "Clave del repositorio de datos", diff --git a/app/appearance/langs/fr_FR.json b/app/appearance/langs/fr_FR.json index 985f00d7a..b180b2472 100644 --- a/app/appearance/langs/fr_FR.json +++ b/app/appearance/langs/fr_FR.json @@ -252,7 +252,7 @@ "keyPlaceholder": "Veuillez coller la chaîne de clé ici", "clé": "Clé", "genKey": "Clé de gén automatique", - "genKeyByPW": "Gén une clé par phrase secrète", + "genKeyByPW": "Clé gén par mot de passe", "dataRepoKeyTip1": "Le référentiel de données est utilisé pour chiffrer et enregistrer des instantanés de données. Des instantanés peuvent être créés et restaurés dans l'historique des données", "dataRepoKeyTip2": "Tous les appareils doivent utiliser la même clé, si les clés sont incohérentes, les données ne peuvent pas être synchronisées avec le cloud", "dataRepoKey": "Clé de référentiel de données",