mirror of
https://github.com/gilbertchen/duplicacy
synced 2025-12-06 00:03:38 +00:00
merge version 2.0.2
This commit is contained in:
14
ACKNOWLEDGEMENTS.md
Normal file
14
ACKNOWLEDGEMENTS.md
Normal file
@@ -0,0 +1,14 @@
|
||||
Duplicacy is based on the following open source project:
|
||||
|
||||
| Projects | License |
|
||||
|--------|:-------:|
|
||||
|https://github.com/urfave/cli | MIT |
|
||||
|https://github.com/aryann/difflib | MIT |
|
||||
|https://github.com/bkaradzic/go-lz4 | BSD-2-Clause |
|
||||
|https://github.com/Azure/azure-sdk-for-go | Apache-2.0 |
|
||||
|https://github.com/tj/go-dropbox | MIT |
|
||||
|https://github.com/goamz/goamz | LGPL-3.0 with static compilation excpetions |
|
||||
|https://github.com/howeyc/gopass | ISC |
|
||||
|https://github.com/tmc/keyring | ISC |
|
||||
|https://github.com/pcwizz/xattr | BSD-2-Clause |
|
||||
|https://github.com/minio/blake2b-simd | Apache-2.0 |
|
||||
@@ -28,7 +28,6 @@ const (
|
||||
|
||||
var ScriptEnabled bool
|
||||
|
||||
|
||||
func getRepositoryPreference(context *cli.Context, storageName string) (repository string,
|
||||
preference *duplicacy.Preference) {
|
||||
|
||||
@@ -37,6 +36,7 @@ func getRepositoryPreference(context *cli.Context, storageName string) (reposito
|
||||
duplicacy.LOG_ERROR("REPOSITORY_PATH", "Failed to retrieve the current working directory: %v", err)
|
||||
return "", nil
|
||||
}
|
||||
|
||||
for {
|
||||
stat, err := os.Stat(path.Join(repository, duplicacy.DUPLICACY_DIRECTORY)) //TOKEEP
|
||||
if err != nil && !os.IsNotExist(err) {
|
||||
@@ -1682,7 +1682,7 @@ func main() {
|
||||
app.Name = "duplicacy"
|
||||
app.HelpName = "duplicacy"
|
||||
app.Usage = "A new generation cloud backup tool based on lock-free deduplication"
|
||||
app.Version = "2.0.0"
|
||||
app.Version = "2.0.2"
|
||||
err := app.Run(os.Args)
|
||||
if err != nil {
|
||||
os.Exit(2)
|
||||
|
||||
@@ -267,6 +267,20 @@ func TestBackupManager(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// Remove file2 and dir1/file3 and restore them from revision 3
|
||||
os.Remove(testDir + "/repository1/file2")
|
||||
os.Remove(testDir + "/repository1/dir1/file3")
|
||||
backupManager.Restore(testDir + "/repository1", 3, /*inPlace=*/true, /*quickMode=*/false, threads, /*overwrite=*/true,
|
||||
/*deleteMode=*/false, /*showStatistics=*/false, /*patterns=*/[]string{"+file2", "+dir1/file3", "-*"})
|
||||
|
||||
for _, f := range []string{ "file1", "file2", "dir1/file3" } {
|
||||
hash1 := getFileHash(testDir + "/repository1/" + f)
|
||||
hash2 := getFileHash(testDir + "/repository2/" + f)
|
||||
if hash1 != hash2 {
|
||||
t.Errorf("File %s has different hashes: %s vs %s", f, hash1, hash2)
|
||||
}
|
||||
}
|
||||
|
||||
/*buf := make([]byte, 1<<16)
|
||||
runtime.Stack(buf, true)
|
||||
fmt.Printf("%s", buf)*/
|
||||
@@ -110,7 +110,7 @@ func (downloader *ChunkDownloader) AddFiles(snapshot *Snapshot, files [] *Entry)
|
||||
}
|
||||
downloader.taskList = append(downloader.taskList, task)
|
||||
} else {
|
||||
downloader.taskList[lastChunkIndex].needed = true
|
||||
downloader.taskList[len(downloader.taskList) - 1].needed = true
|
||||
}
|
||||
lastChunkIndex = i
|
||||
}
|
||||
@@ -353,7 +353,7 @@ func (downloader *ChunkDownloader) Download(threadIndex int, task ChunkDownloadT
|
||||
}
|
||||
}
|
||||
|
||||
if downloader.showStatistics || IsTracing() {
|
||||
if (downloader.showStatistics || IsTracing()) && downloader.totalFileSize > 0 {
|
||||
|
||||
atomic.AddInt64(&downloader.downloadedFileSize, int64(chunk.GetLength()))
|
||||
downloadFileSize := atomic.LoadInt64(&downloader.downloadedFileSize)
|
||||
@@ -135,7 +135,7 @@ func CreateStorage(repository string, preference Preference, resetPassword bool,
|
||||
if strings.HasPrefix(storageURL, "/") {
|
||||
isFileStorage = true
|
||||
} else if runtime.GOOS == "windows" {
|
||||
if len(storageURL) > 3 && storageURL[1] == ':' && (storageURL[2] == '/' || storageURL[2] == '\\') {
|
||||
if len(storageURL) >= 3 && storageURL[1] == ':' && (storageURL[2] == '/' || storageURL[2] == '\\') {
|
||||
volume := strings.ToLower(storageURL[:1])
|
||||
if volume[0] >= 'a' && volume[0] <= 'z' {
|
||||
isFileStorage = true
|
||||
Reference in New Issue
Block a user