diff options
author | Josh Gao <jmgao@google.com> | 2015-12-01 02:42:09 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-12-01 02:42:09 +0000 |
commit | a3892504acda9ab280db5ade66c0d961fbd936a6 (patch) | |
tree | d65455033ca97c20ab5488de2aa1c823a2903a88 /adb/file_sync_client.cpp | |
parent | 3a6ae02b7b604319165811b802162b6f7a3837fd (diff) | |
parent | 7b284b2f22a3c1076bbb483d6ab49afe191adc3d (diff) |
Merge changes I25bdcbc5,I12314da5,I055b0821
* changes:
adb: don't pull symlinks when pulling a directory
adb: remove extraneous newline from skip message
adb: correctly count skipped files in push/pull
Diffstat (limited to 'adb/file_sync_client.cpp')
-rw-r--r-- | adb/file_sync_client.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/adb/file_sync_client.cpp b/adb/file_sync_client.cpp index e109e3eef4..bd0e6c41e2 100644 --- a/adb/file_sync_client.cpp +++ b/adb/file_sync_client.cpp @@ -552,11 +552,12 @@ static bool local_build_list(SyncConnection& sc, std::vector<copyinfo>* filelist } else { if (!S_ISREG(st.st_mode) && !S_ISLNK(st.st_mode)) { sc.Error("skipping special file '%s'", lpath.c_str()); + ci.skip = true; } else { ci.time = st.st_mtime; ci.size = st.st_size; - filelist->push_back(ci); } + filelist->push_back(ci); } } @@ -723,8 +724,7 @@ static bool remote_build_list(SyncConnection& sc, bool empty_dir = true; // Put the files/dirs in rpath on the lists. - auto callback = [&](unsigned mode, unsigned size, unsigned time, - const char* name) { + auto callback = [&](unsigned mode, unsigned size, unsigned time, const char* name) { if (IsDotOrDotDot(name)) { return; } @@ -735,12 +735,18 @@ static bool remote_build_list(SyncConnection& sc, copyinfo ci = mkcopyinfo(lpath, rpath, name, mode); if (S_ISDIR(mode)) { dirlist.push_back(ci); - } else if (S_ISREG(mode) || S_ISLNK(mode)) { - ci.time = time; - ci.size = size; - filelist->push_back(ci); } else { - sc.Warning("skipping special file '%s'\n", name); + if (S_ISREG(mode)) { + ci.time = time; + ci.size = size; + } else if (S_ISLNK(mode)) { + sc.Warning("skipping symlink '%s'", name); + ci.skip = true; + } else { + sc.Warning("skipping special file '%s'", name); + ci.skip = true; + } + filelist->push_back(ci); } }; |