IPath pathOnRootstrap = new Path(dstPath);
IPath toFilePath = rootPath.append(pathOnRootstrap);
String passwd = SudoPasswdManager.getSudoPassword();
- String command = String.format("echo %s | sudo -S cp %s %s", passwd, srcPath,
+ String command = String.format("echo %s | sudo -S cp \"%s\" \"%s\"", passwd, srcPath,
toFilePath.toString());
ICommandStatus status = RootstrapCommandLauncher.execute(command, null, rec, null);
if (!status.isOk()) {
StringBuffer sbCheckFiles = new StringBuffer();
for (String file : sourceChecksums.keySet()) {
// key = <package filename>_<checksum>/<filepath>
- sbCheckFiles.append("\"");
+ sbCheckFiles.append("\'");
sbCheckFiles.append(new Path(file).removeFirstSegments(1).toOSString());
- sbCheckFiles.append("\" ");
+ sbCheckFiles.append("\' ");
}
String needCheckFiles = sbCheckFiles.toString().trim();
Map<String, String> targetChecksums = getTargetChecksumMap(needCheckFiles);
} else {
remainList.add(key);
}
- // if targetChecksums contains source key, remove the key from targetChecksums.
- // it is for removing unused files on device later.
- targetChecksums.remove(target_key);
} else {
// if targetChecksums does not contains source key, it should be copied.
if (!key.equals("-")) {
}
}
}
- // if targetChecksums has keys, it should be removed.
- for (String key : targetChecksums.keySet()) {
- removeList.add(key);
- }
return sbCopyFiles.toString().trim();
}