ips/pkg6repo
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
..
src Introduce cleanup functionality for obsoleted packages with TTL support 2025-07-29 19:08:18 +02:00
.gitignore merging all ips packages into one repo 2021-03-21 14:12:03 -03:00
Cargo.lock merging all ips packages into one repo 2021-03-21 14:12:03 -03:00
Cargo.toml Introduce cleanup functionality for obsoleted packages with TTL support 2025-07-29 19:08:18 +02:00
LICENSE merging all ips packages into one repo 2021-03-21 14:12:03 -03:00
README.md 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

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.