Thanks to visit codestin.com
Credit goes to github.com

Skip to content

inglor/archpkgtools

Repository files navigation

ArchPkgTools

ArchPkgTools is a Python utility for checking and upgrading Arch Linux packages using the official pkgctl tool. It traverses package directories, checks for updates using .nvchecker.toml files, and automatically upgrades packages when needed.

Features

  • Traverses directories containing Arch Linux packages (PKGBUILD files)
  • Automatically resets and pulls latest changes from git repositories
  • Uses pkgctl version check --json to check for package updates
  • Automatically upgrades packages using pkgctl version upgrade
  • Beautiful progress bar showing real-time processing status
  • Comprehensive summary of checked and upgraded packages

Requirements

  • Python >= 3.8
  • pkgctl (from the devtools package)
  • Git repositories with .nvchecker.toml files for version checking

Installation

From Source

git clone https://github.com/yourusername/archpkgtools.git
cd archpkgtools
pip install -e ".[dev]"

Usage

Basic usage - scan current directory:

archpkgtools

Scan a specific directory:

archpkgtools /path/to/packages

Enable verbose output:

archpkgtools -v

Skip Git operations (avoids SSH authentication prompts):

archpkgtools --no-git

Add SSH keys before running (prompts for password once):

archpkgtools --ssh-add

Disable colored output:

archpkgtools --no-color

How it works

For each directory found:

  1. Check for PKGBUILD: Skip directories without PKGBUILD files
  2. Git operations: If it's a git repository, reset local changes and pull from upstream
  3. Version check: If .nvchecker.toml exists, run pkgctl version check --json
  4. Upgrade: If an update is available, run pkgctl version upgrade
  5. Progress tracking: Real-time progress bar with statistics

Development

This project uses modern Python development tools:

# Install development dependencies
just install-dev

# Run the tool
just run

# Run the tool with options
just run /path/to/packages -v

# Run tests
just test

# Run tests with coverage
just test-coverage

# Format code
just format

# Run linters
just lint

# Clean up cache files
just clean

Project Structure

archpkgtools/
├── src/
│   ├── pkgops/         # Core package operations
│   │   ├── __init__.py
│   │   ├── cleanup.py
│   │   ├── gitops.py
│   │   ├── pkgctl.py
│   │   ├── runner.py
│   │   └── utils.py
│   ├── update_and_check_versions.py  # Main CLI module
│   └── __main__.py     # Module entry point (python -m src)
├── tests/              # Test suite
│   ├── test_gitops.py
│   ├── test_pkgctl.py
│   └── test_runner.py
├── pyproject.toml      # Project configuration
├── justfile           # Development commands
├── __init__.py         # Package marker
├── __main__.py         # Root entry point
├── update_and_check_versions.py  # Direct script entry
└── README.md          # This file

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Run the test suite (just test)
  4. Commit your changes (git commit -m 'Add some amazing feature')
  5. Push to the branch (git push origin feature/amazing-feature)
  6. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • The Arch Linux community
  • All contributors to this project

About

Tools for managing Arch Linux packages using pkgctl

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published