diff --git a/build.go b/build.go index 2f3f3e5f0..d81b57dc7 100644 --- a/build.go +++ b/build.go @@ -329,13 +329,17 @@ func main() { } verbosePrintf("create GOPATH at %v\n", gopath) - if err = updateGopath(gopath, filepath.Join(root, "src"), ""); err != nil { - die("copying files from %v to %v failed: %v\n", root, gopath, err) + if err = updateGopath(gopath, filepath.Join(root, "src", "restic"), "restic"); err != nil { + die("copying files from %v/src/restic to %v/src/restic failed: %v\n", root, gopath, err) + } + + if err = updateGopath(gopath, filepath.Join(root, "src", "cmds"), "cmds"); err != nil { + die("copying files from %v/src/cmds to %v/src/restic/cmds failed: %v\n", root, gopath, err) } vendor := filepath.Join(root, "vendor", "src") if err = updateGopath(gopath, vendor, ""); err != nil { - die("copying files from %v to %v failed: %v\n", root, gopath, err) + die("copying files from %v to %v/src failed: %v\n", vendor, gopath, err) } defer func() { @@ -372,7 +376,7 @@ func main() { args := []string{ "-tags", strings.Join(buildTags, " "), "-ldflags", ldflags, - "-o", output, "restic/cmd/restic", + "-o", output, "cmds/restic", } err = build(filepath.Join(gopath, "src"), gopath, args...) diff --git a/run_integration_tests.go b/run_integration_tests.go index e9ab7cda2..519a6cd1f 100644 --- a/run_integration_tests.go +++ b/run_integration_tests.go @@ -171,7 +171,7 @@ func (env *TravisEnvironment) RunTests() { "-arch", strings.Join(env.goxArch, " "), "-tags", tags, "-output", "/tmp/{{.Dir}}_{{.OS}}_{{.Arch}}", - "restic/cmd/restic") + "cmds/restic") } } @@ -192,7 +192,7 @@ func (env *TravisEnvironment) RunTests() { } // run the tests and gather coverage information - runWithEnv(envWithGOPATH, "gotestcover", "-coverprofile", "all.cov", "restic/...") + runWithEnv(envWithGOPATH, "gotestcover", "-coverprofile", "all.cov", "cmds/...", "restic/...") runGofmt() diff --git a/src/restic/cmd/restic-server/.gitignore b/src/cmds/restic-server/.gitignore similarity index 100% rename from src/restic/cmd/restic-server/.gitignore rename to src/cmds/restic-server/.gitignore diff --git a/src/restic/cmd/restic-server/LICENSE b/src/cmds/restic-server/LICENSE similarity index 100% rename from src/restic/cmd/restic-server/LICENSE rename to src/cmds/restic-server/LICENSE diff --git a/src/restic/cmd/restic-server/README.md b/src/cmds/restic-server/README.md similarity index 100% rename from src/restic/cmd/restic-server/README.md rename to src/cmds/restic-server/README.md diff --git a/src/restic/cmd/restic-server/handlers.go b/src/cmds/restic-server/handlers.go similarity index 100% rename from src/restic/cmd/restic-server/handlers.go rename to src/cmds/restic-server/handlers.go diff --git a/src/restic/cmd/restic-server/htpasswd.go b/src/cmds/restic-server/htpasswd.go similarity index 100% rename from src/restic/cmd/restic-server/htpasswd.go rename to src/cmds/restic-server/htpasswd.go diff --git a/src/restic/cmd/restic-server/router.go b/src/cmds/restic-server/router.go similarity index 100% rename from src/restic/cmd/restic-server/router.go rename to src/cmds/restic-server/router.go diff --git a/src/restic/cmd/restic-server/router_test.go b/src/cmds/restic-server/router_test.go similarity index 100% rename from src/restic/cmd/restic-server/router_test.go rename to src/cmds/restic-server/router_test.go diff --git a/src/restic/cmd/restic-server/server.go b/src/cmds/restic-server/server.go similarity index 100% rename from src/restic/cmd/restic-server/server.go rename to src/cmds/restic-server/server.go diff --git a/src/restic/cmd/restic/.gitignore b/src/cmds/restic/.gitignore similarity index 100% rename from src/restic/cmd/restic/.gitignore rename to src/cmds/restic/.gitignore diff --git a/src/restic/cmd/restic/cleanup.go b/src/cmds/restic/cleanup.go similarity index 100% rename from src/restic/cmd/restic/cleanup.go rename to src/cmds/restic/cleanup.go diff --git a/src/restic/cmd/restic/cmd_backup.go b/src/cmds/restic/cmd_backup.go similarity index 100% rename from src/restic/cmd/restic/cmd_backup.go rename to src/cmds/restic/cmd_backup.go diff --git a/src/restic/cmd/restic/cmd_cache.go b/src/cmds/restic/cmd_cache.go similarity index 100% rename from src/restic/cmd/restic/cmd_cache.go rename to src/cmds/restic/cmd_cache.go diff --git a/src/restic/cmd/restic/cmd_cat.go b/src/cmds/restic/cmd_cat.go similarity index 100% rename from src/restic/cmd/restic/cmd_cat.go rename to src/cmds/restic/cmd_cat.go diff --git a/src/restic/cmd/restic/cmd_check.go b/src/cmds/restic/cmd_check.go similarity index 100% rename from src/restic/cmd/restic/cmd_check.go rename to src/cmds/restic/cmd_check.go diff --git a/src/restic/cmd/restic/cmd_dump.go b/src/cmds/restic/cmd_dump.go similarity index 100% rename from src/restic/cmd/restic/cmd_dump.go rename to src/cmds/restic/cmd_dump.go diff --git a/src/restic/cmd/restic/cmd_find.go b/src/cmds/restic/cmd_find.go similarity index 100% rename from src/restic/cmd/restic/cmd_find.go rename to src/cmds/restic/cmd_find.go diff --git a/src/restic/cmd/restic/cmd_init.go b/src/cmds/restic/cmd_init.go similarity index 100% rename from src/restic/cmd/restic/cmd_init.go rename to src/cmds/restic/cmd_init.go diff --git a/src/restic/cmd/restic/cmd_key.go b/src/cmds/restic/cmd_key.go similarity index 100% rename from src/restic/cmd/restic/cmd_key.go rename to src/cmds/restic/cmd_key.go diff --git a/src/restic/cmd/restic/cmd_list.go b/src/cmds/restic/cmd_list.go similarity index 100% rename from src/restic/cmd/restic/cmd_list.go rename to src/cmds/restic/cmd_list.go diff --git a/src/restic/cmd/restic/cmd_ls.go b/src/cmds/restic/cmd_ls.go similarity index 100% rename from src/restic/cmd/restic/cmd_ls.go rename to src/cmds/restic/cmd_ls.go diff --git a/src/restic/cmd/restic/cmd_mount.go b/src/cmds/restic/cmd_mount.go similarity index 100% rename from src/restic/cmd/restic/cmd_mount.go rename to src/cmds/restic/cmd_mount.go diff --git a/src/restic/cmd/restic/cmd_optimize.go b/src/cmds/restic/cmd_optimize.go similarity index 100% rename from src/restic/cmd/restic/cmd_optimize.go rename to src/cmds/restic/cmd_optimize.go diff --git a/src/restic/cmd/restic/cmd_rebuild_index.go b/src/cmds/restic/cmd_rebuild_index.go similarity index 100% rename from src/restic/cmd/restic/cmd_rebuild_index.go rename to src/cmds/restic/cmd_rebuild_index.go diff --git a/src/restic/cmd/restic/cmd_restore.go b/src/cmds/restic/cmd_restore.go similarity index 100% rename from src/restic/cmd/restic/cmd_restore.go rename to src/cmds/restic/cmd_restore.go diff --git a/src/restic/cmd/restic/cmd_snapshots.go b/src/cmds/restic/cmd_snapshots.go similarity index 100% rename from src/restic/cmd/restic/cmd_snapshots.go rename to src/cmds/restic/cmd_snapshots.go diff --git a/src/restic/cmd/restic/cmd_unlock.go b/src/cmds/restic/cmd_unlock.go similarity index 100% rename from src/restic/cmd/restic/cmd_unlock.go rename to src/cmds/restic/cmd_unlock.go diff --git a/src/restic/cmd/restic/cmd_version.go b/src/cmds/restic/cmd_version.go similarity index 100% rename from src/restic/cmd/restic/cmd_version.go rename to src/cmds/restic/cmd_version.go diff --git a/src/restic/cmd/restic/doc.go b/src/cmds/restic/doc.go similarity index 100% rename from src/restic/cmd/restic/doc.go rename to src/cmds/restic/doc.go diff --git a/src/restic/cmd/restic/global.go b/src/cmds/restic/global.go similarity index 100% rename from src/restic/cmd/restic/global.go rename to src/cmds/restic/global.go diff --git a/src/restic/cmd/restic/integration_fuse_test.go b/src/cmds/restic/integration_fuse_test.go similarity index 100% rename from src/restic/cmd/restic/integration_fuse_test.go rename to src/cmds/restic/integration_fuse_test.go diff --git a/src/restic/cmd/restic/integration_helpers_test.go b/src/cmds/restic/integration_helpers_test.go similarity index 100% rename from src/restic/cmd/restic/integration_helpers_test.go rename to src/cmds/restic/integration_helpers_test.go diff --git a/src/restic/cmd/restic/integration_helpers_unix_test.go b/src/cmds/restic/integration_helpers_unix_test.go similarity index 100% rename from src/restic/cmd/restic/integration_helpers_unix_test.go rename to src/cmds/restic/integration_helpers_unix_test.go diff --git a/src/restic/cmd/restic/integration_helpers_windows_test.go b/src/cmds/restic/integration_helpers_windows_test.go similarity index 100% rename from src/restic/cmd/restic/integration_helpers_windows_test.go rename to src/cmds/restic/integration_helpers_windows_test.go diff --git a/src/restic/cmd/restic/integration_test.go b/src/cmds/restic/integration_test.go similarity index 99% rename from src/restic/cmd/restic/integration_test.go rename to src/cmds/restic/integration_test.go index aa0408c20..c8be04c5a 100644 --- a/src/restic/cmd/restic/integration_test.go +++ b/src/cmds/restic/integration_test.go @@ -724,7 +724,7 @@ func TestFind(t *testing.T) { func TestRebuildIndex(t *testing.T) { withTestEnvironment(t, func(env *testEnvironment, global GlobalOptions) { - datafile := filepath.Join("..", "..", "checker", "testdata", "duplicate-packs-in-index-test-repo.tar.gz") + datafile := filepath.Join("..", "..", "restic", "checker", "testdata", "duplicate-packs-in-index-test-repo.tar.gz") SetupTarTestFixture(t, env.base, datafile) out := cmdCheckOutput(t, global) @@ -755,7 +755,7 @@ var optimizeTests = []struct { snapshots backend.IDSet }{ { - filepath.Join("..", "..", "checker", "testdata", "checker-test-repo.tar.gz"), + filepath.Join("..", "..", "restic", "checker", "testdata", "checker-test-repo.tar.gz"), backend.NewIDSet(ParseID("a13c11e582b77a693dd75ab4e3a3ba96538a056594a4b9076e4cacebe6e06d43")), }, { diff --git a/src/restic/cmd/restic/lock.go b/src/cmds/restic/lock.go similarity index 100% rename from src/restic/cmd/restic/lock.go rename to src/cmds/restic/lock.go diff --git a/src/restic/cmd/restic/main.go b/src/cmds/restic/main.go similarity index 100% rename from src/restic/cmd/restic/main.go rename to src/cmds/restic/main.go diff --git a/src/restic/cmd/restic/testdata/backup-data.tar.gz b/src/cmds/restic/testdata/backup-data.tar.gz similarity index 100% rename from src/restic/cmd/restic/testdata/backup-data.tar.gz rename to src/cmds/restic/testdata/backup-data.tar.gz diff --git a/src/restic/cmd/restic/testdata/old-index-repo.tar.gz b/src/cmds/restic/testdata/old-index-repo.tar.gz similarity index 100% rename from src/restic/cmd/restic/testdata/old-index-repo.tar.gz rename to src/cmds/restic/testdata/old-index-repo.tar.gz diff --git a/src/restic/cmd/restic/testdata/repo-restore-permissions-test.tar.gz b/src/cmds/restic/testdata/repo-restore-permissions-test.tar.gz similarity index 100% rename from src/restic/cmd/restic/testdata/repo-restore-permissions-test.tar.gz rename to src/cmds/restic/testdata/repo-restore-permissions-test.tar.gz diff --git a/src/restic/cmd/restic/testdata/small-repo.tar.gz b/src/cmds/restic/testdata/small-repo.tar.gz similarity index 100% rename from src/restic/cmd/restic/testdata/small-repo.tar.gz rename to src/cmds/restic/testdata/small-repo.tar.gz