fix: forward rn working dir to target path in handleLongNameExtract - #444
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR updates the long-name extraction flow to pass the target extraction directory as 7z's working directory for the rename operation, ensuring temporary archives are created in the target path instead of /tmp to avoid ENOSPC issues. Sequence diagram for updated long-name extract working directory handlingsequenceDiagram
participant CliInterface
participant CliProps
participant MoveProgram
CliInterface->>CliInterface: handleLongNameExtract(files)
CliInterface->>CliProps: moveArgs(m_longNameTempArchivePath,m_renameEntries,archiveData,m_longNamePassword)
CliProps-->>CliInterface: args
CliInterface->>CliInterface: args append -w options.strTargetPath
CliInterface->>MoveProgram: startLongNameProcess(program,args)
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Consider guarding the addition of the
-wargument based on the specificmoveProgram(e.g. 7z rn) or a capability flag, so that other potential move programs are not passed an unsupported option. - It may be worth validating
options.strTargetPath(non-empty, valid directory) before appending-w%1to avoid passing an invalid working directory argument to the rename process.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider guarding the addition of the `-w` argument based on the specific `moveProgram` (e.g. 7z rn) or a capability flag, so that other potential move programs are not passed an unsupported option.
- It may be worth validating `options.strTargetPath` (non-empty, valid directory) before appending `-w%1` to avoid passing an invalid working directory argument to the rename process.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
7z rn -w<targetDir> prevents rn's temporary archive from stacking on /tmp, avoiding ENOSPC when the working copy in /tmp and rn's internal temp would otherwise double the space requirement. Bug: https://pms.uniontech.com/bug-view-371965.html
deepin pr auto review★ 总体评分:95分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 QString program = m_cliProps->property("moveProgram").toString();
QStringList args = m_cliProps->moveArgs(m_longNameTempArchivePath, m_renameEntries,
DataManager::get_instance().archiveData(), m_longNamePassword);
// -w 插在命令之后、归档之前,符合 7z 惯例
QString wdir = QDir::cleanPath(options.strTargetPath);
if (wdir.isEmpty()) {
wdir = QDir::tempPath();
}
if (args.size() > 1) {
args.insert(1, QStringLiteral("-w%1").arg(wdir));
} else {
args.append(QStringLiteral("-w%1").arg(wdir));
}
qInfo() << "handleLongNameExtract: starting async rename" << m_renameEntries.count() << "files";
if (!startLongNameProcess(program, args, options.strTargetPath)) {
m_longNamePhase = LNE_None;
m_longNameTempDir.reset();
m_renameEntries.clear(); |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: LiHua000, max-lvs The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/merge |
7z rn -w prevents rn's temporary archive from stacking on /tmp, avoiding ENOSPC when the working copy in /tmp and rn's internal temp would otherwise double the space requirement.
Bug: https://pms.uniontech.com/bug-view-371965.html
Summary by Sourcery
Bug Fixes: