Commit graph

39 commits

Author SHA1 Message Date
Till Wegmueller
4646d2a9c4 feat: Add .p6p archive format support for portable package distribution
Implement ArchiveBackend (read) and ArchiveWriter (create) using zip with
zstd compression. Adds archive/import-archive subcommands to pkg6repo and
.p6p source support to pkg6recv.
2026-04-03 13:21:36 +02:00
Till Wegmueller
dfc24725b8
Add signature handling for manifests
- Implemented support for fetching, importing, and storing signature payloads during transaction creation.
- Added the `Signature` struct to represent signature-related action data.
- Updated `Manifest` to include and process `signatures` as part of its fields.
- Enabled signature file imports with proper path resolution in `pkg6repo`.
2026-02-05 22:26:53 +01:00
Till Wegmueller
6ee6392b01
Standardize description, version, authors, and edition fields across packages using workspace inheritance. 2026-01-19 00:25:47 +01:00
Till Wegmueller
b080288114
Add legacy manifest handling with JSON fallback for transaction commits
- Introduced `legacy_manifest_content` field in `Transaction` to allow preserving byte-identical legacy manifests.
- Updated `commit` method to save both JSON and legacy manifests, falling back to JSON if no legacy content is provided.
- Enhanced manifest copy logic to handle both JSON and legacy formats during transaction finalization.
- Improved catalog rebuild to skip `.json` files when a corresponding legacy manifest exists.
2025-12-23 14:09:14 +01:00
Till Wegmueller
d2d1c297cc
Refactor to align with Rust formatting guidelines and enhance code readability.
- Adjusted indentation and line breaks for structs, functions, and method calls to comply with Rust formatting standards.
- Improved error message formatting and consistency across `PkgTreeError` instances.
- Restructured long function arguments and chained calls for clarity and maintainability.
- Simplified conditional statements and loops for better readability.
- No functional changes introduced.
2025-12-22 20:10:17 +01:00
Till Wegmueller
fc00304038
Remove redundant file checks and update test assertions for publisher-specific file paths
- Eliminate obsolete assertions for the root `file` directory as it is no longer created.
- Update tests to validate file paths in `publisher`-specific directories, aligning with the updated repository structure.
- Simplify `create_directories` by removing unnecessary `file` directory creation.
2025-07-31 00:29:53 +02:00
Till Wegmueller
99dd0fe87c
Refactor repository structure to use publisher-specific directories
- Introduce publisher-specific hierarchy (`publisher/<publisher_name>`) for catalog, package, and file storage.
- Replace hardcoded paths with helper methods (`construct_catalog_path`, `construct_package_dir`, `construct_file_path_with_publisher`) for consistent path generation.
- Remove outdated tests and simplify redundant assertions in repository tests.
- Update `CatalogManager` and file handling logic to leverage publisher-specific paths.
- Enhance debug logs to include publisher context where applicable.
2025-07-31 00:18:21 +02:00
Till Wegmueller
5b4b719b42
Introduce cleanup functionality for obsoleted packages with TTL support
- Add methods to find and clean up obsoleted packages older than a specified TTL (`find_obsoleted_packages_older_than_ttl` and `cleanup_obsoleted_packages_older_than_ttl`) in `libips`.
- Implement a new `CleanupObsoleted` command in `pkg6repo` to handle cleanup operations.
- Update workspace `Cargo.toml` files with unified attributes for better consistency.
- Adjust dependencies (`libips` version patterns, `thiserror` updates) and enhance metadata management for obsoleted packages.
- Enhance repository operations by adding batch processing and robust logging during cleanup.
2025-07-29 19:08:18 +02:00
Till Wegmueller
7633feb36f
Add support for null hash in obsoleted package metadata
- Introduce `NULL_HASH` constant to indicate the absence of original manifest storage.
- Add `new_with_null_hash` method to create metadata for obsoleted packages without storing full manifests.
- Implement on-the-fly generation of minimal manifests with obsoletion attributes for packages with null hash.
- Update `pkg5_import` to use null hash for obsoleted packages, reducing storage requirements.
- Document null hash usage and its benefits in `obsoleted_packages.md`.
2025-07-29 18:40:34 +02:00
Till Wegmueller
9b2f74c5c1
Introduce obsoleted package management system in IPS
- Add `obsoleted.rs` module to handle storing, metadata management, and operations for obsoleted packages.
- Implement commands for marking, listing, searching, restoring, exporting, and importing obsoleted packages (`pkg6repo`).
- Enhance `RepositoryError` with `From` implementations for various error types to manage database and serialization-related errors.
- Introduce reusable data structures for obsoleted package metadata and export representation.
- Update `Cargo.toml` and `Cargo.lock` to include new dependencies (`redb`, `bincode`, etc.).
- Document obsoleted package workflow and integration details in `doc/obsoleted_packages.md` for contributors.
- Refactor repository internals to integrate obsoleted package support without disrupting existing workflow.
- Add robust error handling, logging, and pagination for enhanced usability and scalability.
2025-07-29 16:16:12 +02:00
Till Wegmueller
1286db23fd
Implement two-level file path hierarchy in pkg5_import.rs and remove redundant e2e tests
- Introduce a two-level directory structure for file paths (`xx/yy/hash`) in `pkg5_import.rs` for improved scalability, with fallback to the old structure for compatibility.
- Remove outdated end-to-end tests for `pkg5` imports, reducing redundancy and streamlining test coverage.
2025-07-27 16:27:22 +02:00
Till Wegmueller
21de26ae82
Refactor codebase to improve formatting, logging clarity, and error handling
- Standardize formatting by aligning and cleaning up indentation, spacing, and line breaks across multiple modules.
- Enhance logging with improved message formatting for better context and readability.
- Simplify error handling in `pkg6dev`, `pkg6repo`, and core libraries by consolidating redundant patterns and improving clarity.
- Update test cases to reflect formatting and logging changes while extending coverage of edge cases.
- Perform general cleanup, including removing unused imports, refining comments, and ensuring consistent style.
2025-07-27 15:22:49 +02:00
Till Wegmueller
f4d1ce73b6
Refactor repository operations to use immutable references
- Modify `rebuild` and `refresh` methods to take `&self` instead of `&mut self`.
- Replace mutable repository instances in `pkg6dev`, `pkg6repo`, and core library with immutable ones.
- Introduce `debug` logging for enhanced traceability during metadata rebuild and refresh.
- Extract and simplify catalog rebuild logic into a dedicated `rebuild_catalog` method.
- General cleanup: remove redundant methods, reorganize logic, and refine comments across affected files.
2025-07-27 13:43:56 +02:00
Till Wegmueller
7f4ecf6346
Organize repository files into hierarchical directory structure for improved scalability
- Update `FileBackend` to store files in a multi-level directory structure (`xx/yy/hash`) based on hash prefixes.
- Adjust method signatures and logic across `FileBackend`, `pkg6dev`, and `pkg6repo` to support mutable repository operations.
- Add test cases and scripts (`test_file_structure.rs`, `test_repo_operations.sh`) to validate the new file structure.
- Refactor catalog manager to use `RefCell` for interior mutability to enable lazy initialization.
- Clean up redundant and dead code, enhance comments, and replace outdated logic for file handling and metadata operations.
2025-07-27 13:15:52 +02:00
Till Wegmueller
ea5eddbc6a
Simplify pkg5_import.rs by removing redundant directory creation logic; delegate to Transaction.commit() for handling. 2025-07-27 12:05:22 +02:00
Till Wegmueller
7889dffdea
Update workspace structure, unify metadata, enhance logging, and expand error handling
- Centralize package metadata in workspace for consistency.
- Upgrade `pkg6dev` and `pkg6repo` to version `0.5.1`, aligning with new workspace configuration.
- Introduce `EnvFilter` for dynamic logging configuration, defaulting to debug level.
- Add `LoggingEnvError` variant to `Pkg6DevError` with structured diagnostics for improved error handling.
2025-07-27 11:08:39 +02:00
Till Wegmueller
bf5d60c77c
Update Cargo.lock dependencies to latest versions to ensure compatibility and improve functionality. 2025-07-27 11:02:37 +02:00
Till Wegmueller
8760bf0c4d
Remove unused imports and the synchronous flag in pkg6repo, adjust comments for clarity and grammar, and refine logging statements. 2025-07-27 10:42:03 +02:00
Till Wegmueller
a3b2686b0a
Refine imports and comments in pkg5_import.rs for clarity, remove unused imports, adjust variable naming, and resolve grammar issues in comments. 2025-07-26 23:54:34 +02:00
Till Wegmueller
ce535c830d
Add support for importing pkg5 repositories (directory and p5p format) into pkg6, update README with usage examples, and enhance e2e tests for validation. 2025-07-26 23:14:34 +02:00
Till Wegmueller
c3ff6ac28e
Introduce Pkg5Importer for importing pkg5 repositories (directory or p5p format) into pkg6, extend error handling with ActionError, update dependencies (tempfile, flate2, and thiserror), and enhance CI workflows. 2025-07-26 23:02:56 +02:00
Till Wegmueller
cbd3dd987d
Replace all println! statements with structured logging using tracing crate for enhanced diagnostics and consistency across pkg6repo and pkg6dev. 2025-07-26 21:48:07 +02:00
Till Wegmueller
cb75c045e5
Introduce Pkg6DevError for improved error handling across pkg6dev, replace anyhow with custom error types, enable structured diagnostics with miette, update dependencies, and add tracing for logging. 2025-07-26 21:20:50 +02:00
Till Wegmueller
098c62b645
Replace legacy setup_test_env.sh script with xtask for environment setup, refactor e2e tests to use pre-built binaries, and update xtask commands and documentation for improved automation and reliability. 2025-07-26 17:49:56 +02:00
Till Wegmueller
38fba9b9db
Introduce custom Pkg6RepoError for improved error handling, replace anyhow, and update dependencies and test cases for consistency. 2025-07-26 17:07:59 +02:00
Till Wegmueller
a33a3246b6
chore(fmt): format with cargo fmt 2025-07-26 12:54:01 +02:00
Till Wegmueller
f5b80a7d12
Refactor repository property and publisher filtering in show_contents, improve clarity and efficiency by introducing section_filtered_properties and adding publisher-based property filtering logic. Update get_info to support publisher filtering. 2025-07-26 12:52:55 +02:00
Till Wegmueller
362042268a
Add publisher filtering to show_contents, enhance property filtering for repository configurations, and update synchronous operation handling across backends. 2025-07-26 12:44:39 +02:00
Till Wegmueller
a5cdb7e673
Add JSON and TSV output to repository commands, integrate serde for struct serialization, and introduce search subcommand with flexible filtering options. 2025-07-26 12:35:44 +02:00
Till Wegmueller
307dfddc7c
Remove TESTING.md, fix CLI argument naming (--repo-version), enhance transaction publisher handling, and improve manifest storage logic. 2025-07-26 11:52:42 +02:00
Till Wegmueller
4f0e2fe066
Add unit and end-to-end tests for repository functionality, including setup scripts, package management operations, and TESTING.md documentation. 2025-07-26 10:52:25 +02:00
Till Wegmueller
ead9ad12af
Refactor repository traits into ReadableRepository and WritableRepository, introduce Repository to combine traits for backward compatibility, and update relevant modules and tests to use the new structure. 2025-07-26 10:34:45 +02:00
Till Wegmueller
a0fcc13033
Introduce Catalog module with structs and functionality for managing package metadata, enhance file_backend and CLI to handle catalog operations, and update dependencies (chrono and others) to support new features. 2025-07-24 00:28:33 +02:00
Till Wegmueller
2cb63fbef0
Introduce PackageContents struct for structured representation of package data, refactor show_contents for multiple content types, and enhance handling of manifests with improved filtering and output formatting. 2025-07-23 22:39:49 +02:00
Till Wegmueller
5d987ca0cb
Refactor package FMRI handling by introducing Fmri struct, update dependencies, and adjust repository and action modules for structured FMRI data processing
Signed-off-by: Till Wegmueller <toasterson@gmail.com>
2025-07-22 14:10:37 +02:00
Till Wegmueller
e3662eaf23
Introduce PackageInfo struct for structured package data, refactor list_packages to use it, and enhance publisher directory handling
Signed-off-by: Till Wegmueller <toasterson@gmail.com>
2025-07-22 11:57:24 +02:00
Till Wegmueller
7332e0f7b5
Refactor repository info retrieval to return structured data, add detailed publisher information, and update tests accordingly
Signed-off-by: Till Wegmueller <toasterson@gmail.com>
2025-07-22 10:21:16 +02:00
Till Wegmueller
1a5e0e053d
Add repository module and update dependencies
Signed-off-by: Till Wegmueller <toasterson@gmail.com>
2025-07-21 22:02:05 +02:00
Till Wegmueller
25ff8bc9d4 merging all ips packages into one repo 2021-03-21 14:12:03 -03:00