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.
- Traverses directories containing Arch Linux packages (PKGBUILD files)
- Automatically resets and pulls latest changes from git repositories
- Uses
pkgctl version check --jsonto 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
- Python >= 3.8
pkgctl(from thedevtoolspackage)- Git repositories with
.nvchecker.tomlfiles for version checking
git clone https://github.com/yourusername/archpkgtools.git
cd archpkgtools
pip install -e ".[dev]"Basic usage - scan current directory:
archpkgtoolsScan a specific directory:
archpkgtools /path/to/packagesEnable verbose output:
archpkgtools -vSkip Git operations (avoids SSH authentication prompts):
archpkgtools --no-gitAdd SSH keys before running (prompts for password once):
archpkgtools --ssh-addDisable colored output:
archpkgtools --no-colorFor each directory found:
- Check for PKGBUILD: Skip directories without PKGBUILD files
- Git operations: If it's a git repository, reset local changes and pull from upstream
- Version check: If
.nvchecker.tomlexists, runpkgctl version check --json - Upgrade: If an update is available, run
pkgctl version upgrade - Progress tracking: Real-time progress bar with statistics
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 cleanarchpkgtools/
├── 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
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Run the test suite (
just test) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- The Arch Linux community
- All contributors to this project