Commit graph

7 commits

Author SHA1 Message Date
Till Wegmueller
f2922dab11
Fix catalog import logic 2025-08-05 00:44:29 +02:00
Till Wegmueller
92cce0f767
Add debugging utilities and improved package listing
- Add support for debugging database tables with `--stats`, `--dump-all`, and `--dump-table` options.
- Introduce CLI command `DebugDb` for inspecting catalog, obsoleted, and installed tables.
- Enhance `List` command to include an `--all` flag for listing all available packages.
- Update logging for database operations and package queries.
- Add methods to dump and analyze table contents in `InstalledPackages` and `ImageCatalog`.
2025-08-05 00:20:57 +02:00
Till Wegmueller
0ec1c1928a
Update Image and Catalog functionalities with improved catalog handling and new refresh logic
- Introduced `Image::refresh_catalogs` to support refreshing catalogs selectively or fully for specified publishers.
- Enhanced `CatalogManager::load` to handle missing fields gracefully, including fallback mechanisms for `packages`.
- Added detailed logging and error diagnostics for catalog parsing and directory operations.
- Improved publisher-specific directory management, including cleaning and recreating directories during full refresh.
- Updated tests to verify correct behavior for catalog directory clearing and new catalog handling logic.
2025-08-04 23:45:41 +02:00
Till Wegmueller
f31d2e11af
Add support for partial image creation and improve logging
- Introduced the `ImageType` enum to support both `Full` and `Partial` image types during creation.
- Updated `Image::create_image` to accept `ImageType` as a parameter.
- Enhanced logging with detailed debug statements for catalog building, image queries, and package processing.
- Refactored CLI to include a new `--type` option for specifying image type during image creation.
- Simplified path determination logic in `pkg6` with a new `determine_image_path` helper function.
- Removed unused imports and unnecessary file checks for cleaner code.
2025-08-04 23:01:04 +02:00
Till Wegmueller
e27cd35d8d
Add ImageCatalog and InstalledPackages modules for package management
- Introduced `ImageCatalog` for handling catalog-related operations, including initialization, building from publishers, querying, and manifest management.
- Added `InstalledPackages` for managing installed package operations, such as adding, removing, querying, and retrieving manifests.
- Defined database schemas and error types to support both modules.
- Refactored table handling, ensuring consistent transaction scoping with `redb`.
2025-08-04 22:01:38 +02:00
Till Wegmueller
2777f153c9
Introduce progress reporting infrastructure and error management refinements
- Add `ProgressReporter` trait with `start`, `update`, and `finish` methods for customizable progress tracking during operations.
- Implement `ProgressInfo` struct for detailed progress state reporting, including operation, progress, and context information.
- Create a no-op implementation `NoopProgressReporter` for cases where progress reporting is not needed.
- Enhance `pkg6` with structured error handling using `Pkg6Error` and new diagnostic variants for I/O, JSON, FMRI, and logging errors.
- Update `Image` functionality to leverage progress reporting during catalog downloads and include robust publisher management.
- Introduce `TestProgressReporter` for unit tests to validate progress reporting integration.
2025-08-03 14:28:36 +02:00
Till Wegmueller
f7f017f7b9
Add tests for Image functionality and refactor image handling logic
- Implement unit tests to cover `Image` creation, metadata management, saving/loading, and error handling.
- Add separate constructors for `Full` and `Partial` image types (`new_full`, `new_partial`).
- Introduce robust path handling methods (`metadata_dir`, `image_json_path`) for consistent metadata structure.
- Enhance error diagnostics with `InvalidPath` variant in `ImageError`.
- Update `Cargo.toml` for test module inclusion.
2025-08-02 22:12:37 +02:00