fix(organize): use the part's install directories (#689)
Metadata
Current evaluation
Merged fix for organize_files() using the current working directory instead of the project base directory. The function now accepts the part's install directories directly, eliminating relative path redefinition.
Suggested action: —
No scores available.
Issue body
Fixes an issue discovered via canonical/snapcraft#4654 where `organize_files()`
would organize in the cwd instead of the project's base_dir.
The problem was that `organize_files()` was redefining a part's install directories
incorrectly by creating relative filepaths.
To fix this, organize_files now accepts the part's install directories instead of
redefining them.
- [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
-----
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged fix for organize_files() using the current working directory instead of the project base directory. The function now accepts the part's install directories directly, eliminating relative path redefinition. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged #689. Fixed organize_files() incorrectly operating in the current working directory due to relative path generation. The function now accepts the part's install directories directly, ensuring files are organized within the project base directory. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #689 fix(organize): use the part's install directories | craft-parts | merged | Merged fix for organize_files() which incorrectly used relative paths, organizing files in cwd instead of base_dir. The function now accepts the part's install directories directly. Approved by two reviewers and passed CI. | |
| #1525 Directory traversal issue when organizing a part | craft-parts | closed | Fixed via PR #1562. Added validation to reject organize source paths escaping the part install directory, blocking directory traversal and absolute path misuse. Merged and closed. | |
| #1562 fix(organize): reject sources outside install dir | craft-parts | merged | Merged fix preventing the organize step from processing sources outside the part install directory. Blocks absolute paths and directory traversal while preserving symlink behavior. Unrelated CI failures did not block the merge. |