fix(organize): use the part's install directories (#689)
Metadata
Current evaluation
Merged PR #690 in commit 0eff7cc9 (change c349e740), fixing organize_files() to use part install directories and organize under base_dir.
Resolution: closed resolved
Reason: PR #690 was approved and merged as 0eff7cc9, incorporating c349e740. It replaced incorrect relative paths with the part's install directories, preventing organization in the current working directory.
Evaluated by: mr-cal-bot
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 |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #690 in commit 0eff7cc9 (change c349e740), fixing organize_files() to use part install directories and organize under base_dir. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #689 (commit c349e740), fixing organize_files() to use the part's install directories instead of relative paths, organizing under base_dir rather than the cwd. | |
| 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 work
-
Related To:
canonical/craft-parts#689
(confidence 100%)
Referenced by the PR title as the originating issue or change.
-
Related To:
canonical/snapcraft#4654
(confidence 75%)
The PR body identifies this Snapcraft work as where the underlying problem was discovered.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #689 fix(organize): use the part's install directories | craft-parts | merged | Merged craft-parts#689: organize_files now receives each part's install directories instead of recreating relative paths, ensuring organization uses base_dir rather than cwd. | |
| #673 Organizing files fails if equivalent file already exists | craft-parts | closed | Organize collisions were fixed by PR #689 (commit c349e740), making organize_files() use part install directories instead of cwd-relative paths. | |
| #1525 Directory traversal issue when organizing a part | craft-parts | closed | Fixed by merged PR #1562 (commit 32b95b4f), rejecting organize sources that escape the install directory via absolute paths or traversal. | |
| #1562 fix(organize): reject sources outside install dir | craft-parts | merged | Merged PR #1562 as commit 32b95b4f, rejecting organize sources outside the install directory while preserving existing symlink behavior. | |
| #1544 fix: prevent organizing a directory into itself | craft-parts | closed | PR #1544 was closed unmerged as incomplete; the solution was replaced by the organize-from-build rework in #1598 (commit cc02958b). |