- 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. |
||
|---|---|---|
| .. | ||
| src | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| LICENSE | ||
| README.md | ||
pkg6repo
pkg6repo is a Rust implementation of the Image Packaging System (IPS) repository management utility. It is designed to replace the pkgrepo command from the original IPS implementation.
Installation
To build and install pkg6repo, you need to have Rust and Cargo installed. Then, you can build the project using:
cargo build --release
The binary will be available at target/release/pkg6repo.
Usage
pkg6repo provides several subcommands for managing package repositories:
Create a Repository
Create a new package repository:
pkg6repo create /path/to/repository
You can specify the repository version (default is 4):
pkg6repo create --version 4 /path/to/repository
Add Publishers
Add publishers to a repository:
pkg6repo add-publisher -s /path/to/repository example.com
Remove Publishers
Remove publishers from a repository:
pkg6repo remove-publisher -s /path/to/repository example.com
You can perform a dry run to see what would be removed without actually removing anything:
pkg6repo remove-publisher -n -s /path/to/repository example.com
Get Repository Properties
Get repository properties:
pkg6repo get -s /path/to/repository
You can specify specific properties to get:
pkg6repo get -s /path/to/repository publisher/prefix
Set Repository Properties
Set repository properties:
pkg6repo set -s /path/to/repository publisher/prefix=example.com
You can set publisher-specific properties:
pkg6repo set -s /path/to/repository -p example.com repository/origins=http://example.com/repository
Display Repository Information
Display information about a repository:
pkg6repo info -s /path/to/repository
List Packages
List packages in a repository:
pkg6repo list -s /path/to/repository
You can filter by publisher:
pkg6repo list -s /path/to/repository -p example.com
You can also filter by package pattern:
pkg6repo list -s /path/to/repository example/package
Show Package Contents
Show contents of packages in a repository:
pkg6repo contents -s /path/to/repository
You can filter by package pattern:
pkg6repo contents -s /path/to/repository example/package
You can also filter by action type:
pkg6repo contents -s /path/to/repository -t file
Rebuild Repository Metadata
Rebuild repository metadata:
pkg6repo rebuild -s /path/to/repository
You can skip catalog or index rebuilding:
pkg6repo rebuild -s /path/to/repository --no-catalog
pkg6repo rebuild -s /path/to/repository --no-index
Refresh Repository Metadata
Refresh repository metadata:
pkg6repo refresh -s /path/to/repository
You can skip catalog or index refreshing:
pkg6repo refresh -s /path/to/repository --no-catalog
pkg6repo refresh -s /path/to/repository --no-index
Import pkg5 Repository
Import a pkg5 repository (directory-based or p5p archive) into a pkg6 repository:
pkg6repo import-pkg5 --source /path/to/pkg5/repository --destination /path/to/pkg6/repository
You can specify a specific publisher to import:
pkg6repo import-pkg5 --source /path/to/pkg5/repository --destination /path/to/pkg6/repository --publisher example.com
Importing from a Directory-Based Repository
To import from a directory-based pkg5 repository:
pkg6repo import-pkg5 --source /path/to/pkg5/repository/directory --destination /path/to/pkg6/repository
The source directory should contain the pkg5 repository structure with a publisher directory and a pkg5.repository file.
Importing from a p5p Archive
To import from a p5p archive:
pkg6repo import-pkg5 --source /path/to/repository.p5p --destination /path/to/pkg6/repository
The p5p archive should be a valid pkg5 repository archive with the standard pkg5 repository structure.
Notes
- If the destination repository doesn't exist, it will be created automatically.
- If no publisher is specified, the first publisher found in the source repository will be used.
- The import process extracts files from the source repository, decompresses them if necessary, and adds them to the destination repository.
- After importing, the catalog and search index are automatically rebuilt.
License
This project is licensed under the same license as the original IPS implementation.