Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- ./fs/config.go.orig-20161020L15391476985179 2016-10-20 15:09:10.083157088 -0200
- +++ ./fs/config.go 2016-10-20 15:45:39.618220137 -0200
- @@ -88,6 +88,7 @@
- ignoreSize = pflag.BoolP("ignore-size", "", false, "Ignore size when skipping use mod-time or checksum.")
- noTraverse = pflag.BoolP("no-traverse", "", false, "Don't traverse destination file system on copy.")
- noUpdateModTime = pflag.BoolP("no-update-modtime", "", false, "Don't update destination mod-time if files identical.")
- + oneFileSystem = pflag.BoolP("one-file-system", "x", false, "Don't cross filesystem boundaries.")
- bwLimit SizeSuffix
- // Key to use for password en/decryption.
- @@ -299,6 +300,7 @@
- IgnoreSize bool
- NoTraverse bool
- NoUpdateModTime bool
- + OneFileSystem bool // Don't cross filesystem boundaries
- }
- // Find the config directory
- @@ -349,6 +351,7 @@
- Config.IgnoreSize = *ignoreSize
- Config.NoTraverse = *noTraverse
- Config.NoUpdateModTime = *noUpdateModTime
- + Config.OneFileSystem = *oneFileSystem
- ConfigPath = *configFile
- --- ./local/local.go.orig-20161020L17571476993439 2016-10-20 17:57:19.191661516 -0200
- +++ ./local/local.go 2016-10-20 18:10:44.782492929 -0200
- @@ -19,6 +19,8 @@
- "github.com/ncw/rclone/fs"
- "github.com/pkg/errors"
- +
- + "syscall"
- )
- // Register with Fs
- @@ -146,11 +148,23 @@
- // list traverses the directory passed in, listing to out.
- // it returns a boolean whether it is finished or not.
- func (f *Fs) list(out fs.ListOpts, remote string, dirpath string, level int) (subdirs []listArgs) {
- + var fdFi os.FileInfo
- + var fdDev uint64
- +
- fd, err := os.Open(dirpath)
- if err != nil {
- out.SetError(errors.Wrapf(err, "failed to open directory %q", dirpath))
- return nil
- }
- +
- + // Obtain dirpath's device
- + fdFi, err = os.Stat(dirpath)
- + if err != nil {
- + out.SetError(errors.Wrapf(err, "failed to stat directory %q", dirpath))
- + return nil
- + }
- + fdDev = fdFi.Sys().(*syscall.Stat_t).Dev
- +
- defer func() {
- err := fd.Close()
- if err != nil {
- @@ -186,7 +200,8 @@
- if out.AddDir(dir) {
- return nil
- }
- - if level > 0 {
- + fs.Debug(f, "fs.Config.OneFileSystem=", fs.Config.OneFileSystem)
- + if level > 0 && ! (fs.Config.OneFileSystem && ! ((fi.Sys().(*syscall.Stat_t)).Dev == fdDev )) {
- subdirs = append(subdirs, listArgs{remote: newRemote, dirpath: newPath, level: level - 1})
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement