Skip to content

bcyran/bumper

Repository files navigation

bumper

CI codecov GitHub release Go Reference license

Helper for Arch Linux User Repository (AUR) package maintainers to easily bump $pkgver in their packages.

bumper demo gif

TL;DR

Imagine you have all your maintained AUR packages in a single directory. Running bumper in this dir will find the packages in subdirectories and perform the following actions for each of them:

  1. check - attempt to use URLs found in .SRCINFO to infer the latest released version number. Compare that with the .SRCINFO version.
  2. bump - update $pkgver and $pkgrel in PKGBUILD, run updpkgsums, regenerate .SRCINFO.
  3. make - build the package to make sure it's still valid.
  4. commit - git commit the changes.
  5. push - git push the changes.

Nothing will be committed or pushed in case of make or any other action failure.

Installation

AUR

AUR packages are available: bumper and bumper-bin.

Binary

You can download tarball containing the latest prebuilt binary from the releases page. The binary named bumper has to be placed in directory in your $PATH, e.g. /usr/local/bin.

Go

go install github.com/bcyran/bumper@latest

Usage

Basics

bumper accepts a single optional argument - path to a directory, if omitted $PWD is used. The path can be either a package directory or a directory with many subdirectories containing packages.

Consider the following directory structure:

/home/user/workspace/aur
├── package1
├── package2
└── package3

Example bumper usage could look like this:

# bump all three packages
bumper /home/user/workspace/aur
# or alternatively
cd /home/user/workspace/aur && bumper

# bump a single package
bumper /home/user/workspace/aur/package1
# or alternatively
cd /home/user/workspace/aur/package1 && bumper

Options

CLI option Default Description
--bump/-b true Bump outdated packages. If disabled, bumper will only check for updates.
--make/-m true Build the package after bumping and before commiting.
--commit/-c true Commit made changes. Disabling commit disables push as well.
--push/-p false Push commited changes.
--config $XDG_CONFIG_HOME/bumper/config.yaml, $HOME/.config/bumper/config.yaml Configuration file path. See configuration section.
--depth/-d 1 Depth of directory tree recursion when looking for packages. By default checks given directory and its children.
--override/-o - Override version for specified packages, e.g.: -o mypackage=1.2.3. This skips upstream check completely. Can be used multiple times for multiple overrides.
--completion - Generate and print shell completion script. Available: bash, zsh, fish.
--version/-v - Print version and exit.
--help/-h - Print help and exit.

Configuration

APIs used to retrieve the upstream versions can have some limitations for unauthorized access. GitHub and GitLab APIs in particular use rate limiting, so requests made by bumper could fail after a few usages or when bumping a lot of packages. You can configure bumper to use your API keys to avoid those limits.

It's also possible to configure the value used as the commit author.

Configuration file is expected to be present at $XDG_CONFIG_HOME/bumper/config.yaml or $HOME/.config/bumper/config.yaml. The format is as follows:

check:
  providers:
    github:
      apiKey: github_api_key
    gitlab:
      apiKeys:
        gitlab.com: gitlab_com_api_key
        other.gitlab.instance: other_api_key
commit:
  author: John Doe <[email protected]>

Warning: All configuration fields are optional and the file isn't checked for additional keys! This means that bumper will not fail if you make a typo or other mistake. It will just continue as usual without using your keys.

Supported upstream services

  • github.com - releases and tags API.
  • gitlab.com and other GitLab instances - releases and tags API. Instances other than gitlab.com need to have git in domain name to be considered.
  • pypi.org - package metadata API.

Credits / resources