(entries []EntryInfo, targetID string)
| 442 | } |
| 443 | |
| 444 | func setAllParentIDAttributes(entries []EntryInfo, targetID string) error { |
| 445 | fmt.Printf(" Setting all parent IDs to '%s':\n", targetID) |
| 446 | |
| 447 | for _, entry := range entries { |
| 448 | if entry.ParentID == targetID { |
| 449 | fmt.Printf(" - Skipping '%s' (already has target ID).\n", filepath.Base(entry.Path)) |
| 450 | continue |
| 451 | } |
| 452 | |
| 453 | fmt.Printf(" - Removing all attributes from '%s'. It will be re-assimilated\n", filepath.Base(entry.Path)) |
| 454 | filepath.WalkDir(entry.Path, func(path string, d os.DirEntry, err error) error { |
| 455 | if err != nil { |
| 456 | return fmt.Errorf("error walking path '%s': %w", path, err) |
| 457 | } |
| 458 | |
| 459 | // Remove all attributes from the file. |
| 460 | if err := removeAttributes(path); err != nil { |
| 461 | fmt.Printf("failed to remove attributes from '%s': %v", path, err) |
| 462 | } |
| 463 | return nil |
| 464 | }) |
| 465 | } |
| 466 | return nil |
| 467 | } |
| 468 | |
| 469 | // updateOwnerIndexFile handles the logic of reading, modifying, and writing the MessagePack index file. |
| 470 | func updateOwnerIndexFile(basePath string, obsoleteIDs []string) error { |
no test coverage detected