| 221 | } |
| 222 | |
| 223 | static bool check_dir(acl::scan_dir& scan, const char* to, int* ncopied) |
| 224 | { |
| 225 | const char* rpath = scan.curr_path(); |
| 226 | if (rpath == NULL) |
| 227 | { |
| 228 | logger_error("get from's path error: %s, to: %s", |
| 229 | acl::last_serror(), to); |
| 230 | return false; |
| 231 | } |
| 232 | |
| 233 | SKIP(rpath); |
| 234 | |
| 235 | acl::string to_path; |
| 236 | to_path << to << SEP << rpath; |
| 237 | |
| 238 | if (strstr(to_path.c_str(), ".svn") != NULL |
| 239 | || strstr(to_path.c_str(), ".git") != NULL |
| 240 | || strstr(to_path.c_str(), ".cvs") != NULL) |
| 241 | { |
| 242 | return true; |
| 243 | } |
| 244 | |
| 245 | // printf(">>to_path: %s, to: %s\r\n", to_path.c_str(), to); |
| 246 | |
| 247 | if (access(to_path.c_str(), 0) == 0) |
| 248 | return true; |
| 249 | |
| 250 | int ret = acl_make_dirs(to_path.c_str(), 0755); |
| 251 | if (ret == 0) |
| 252 | { |
| 253 | (*ncopied)++; |
| 254 | return true; |
| 255 | } |
| 256 | |
| 257 | logger_error("make dirs(%s) error: %s", |
| 258 | to_path.c_str(), acl::last_serror()); |
| 259 | return false; |
| 260 | } |
| 261 | |
| 262 | static void do_copy(const acl::string& from, const acl::string& to) |
| 263 | { |
no test coverage detected
searching dependent graphs…