diff --git a/cmd-common.go b/cmd-common.go index 2fe8fd26..7b38c35d 100644 --- a/cmd-common.go +++ b/cmd-common.go @@ -22,6 +22,14 @@ import ( "github.com/minio/minio/pkg/iodine" ) +// intMax - return maximum value for any given integer +func intMax(x, y int) int { + if x > y { + return x + } + return y +} + // isValidRetry - check if we should retry for the given error sequence func isValidRetry(err error) bool { err = iodine.New(err, nil) diff --git a/copy-url.go b/copy-url.go index 45b173e1..242e1674 100644 --- a/copy-url.go +++ b/copy-url.go @@ -28,7 +28,7 @@ import ( ) // -// NOITE: All the parse rules should reduced to A: Copy(Source, Target). +// NOTE: All the parse rules should reduced to A: Copy(Source, Target). // // * SINGLE SOURCE - VALID // ======================= diff --git a/notifier.go b/notifier.go index 350b33a1..50d93f96 100644 --- a/notifier.go +++ b/notifier.go @@ -29,14 +29,6 @@ const ( updateString = "mc cp " + mcUpdateURL + " ${HOME}/bin/mc" ) -// intMax - return maximum value for any given integer -func intMax(x, y int) int { - if x > y { - return x - } - return y -} - // printUpdateNotify - inspired from Yeoman project npm package https://github.com/yeoman/update-notifier func printUpdateNotify(latestVersion, currentVersion string) { // TODO - make this configurable diff --git a/sync-url.go b/sync-url.go index b8507f29..d91a0cff 100644 --- a/sync-url.go +++ b/sync-url.go @@ -1,3 +1,19 @@ +/* + * Minio Client (C) 2015 Minio, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package main import ( @@ -6,6 +22,28 @@ import ( "github.com/minio/minio/pkg/iodine" ) +// +// NOTE: All the parse rules should reduced to A: Copy(Source, Target). +// +// * SINGLE SOURCE - VALID +// ======================= +// A: sync(f, f) -> copy(f, f) +// B: sync(f, d) -> copy(f, d/f) -> A +// C: sync(f, []d) -> []copy(f, d/f) -> []A +// D: sync(d1..., d2) -> []copy(d1/f, d2/d1/f) -> []A +// E: sync(d1..., []d2) -> [][]copy(d1/f, d2/d1/f) -> [][]A +// +// * SINGLE SOURCE - INVALID +// ========================= +// sync(d, *) +// sync(d..., f) +// sync(*, d...) +// +// * MULTI-TARGET RECURSIVE - INVALID +// ================================== +// sync(*, f1) +// sync(*, []f1) + type syncURLs copyURLs // prepareCopyURLs - prepares target and source URLs for syncing.