Commit Graph

47 Commits

Author SHA1 Message Date
Levente Polyak 3ecba314fc
feat(build): consolidate repo flags in build and release subcommand
Previously the behavior was inconsistent and not fully fulfilling its
purpose of only using --repo once when initially pushing a new and
unknown package to the official repositories.

Consolidate the behavior by only allowing to use --repo during the
initial packaging and disallow any subsequent usage. The expected user
experience is to subsequently use --testing or --staging to influence
the auto-detection of the build target. This avoids any kind of human
error which leads to releasing core packages to extra-testing by
accident.

Furthermore, allow the build subcommand to automatically fallback to
extra as the default stable repository target which greatly improves the
usability for AUR or local override builds.

Fixes #193
Fixes #191

Component: pkgctl build
Component: pkgctl release
Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2024-02-08 00:52:20 +01:00
Christian Heusel 5042dcaeb4
feat(build): allow to test-install the built packages
This change introduces the new --install-to-host flag to pkgctl build,
which can be used with one of the modes 'all' or 'auto'. Depending on
the mode either all or just already installed packages are installed to
the host system.

BREAKING CHANGE: the --install flag is renamed to --install-to-chroot
to avoid confusion with the newly introduced flag.

Component: pkgctl build
Signed-off-by: Christian Heusel <christian@heusel.eu>
Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2024-02-06 19:38:50 +01:00
Levente Polyak 4d72f4560c
doc(version): extensively revamp documentation for version subcommands
Enhanced and overhauled the documentation for the 'version' subcommand.
The improvements include comprehensive details on the subcommand's
behavior, usage, and a variety of scenarios it handles.

Added a central section within the pkgctl-version manpage that documents
the nvchecker configuration and rules.

Component: pkgctl version
Singled-off-by: Levente Polyak <anthraxx@archlinux.org>
2024-01-22 19:45:16 +01:00
Levente Polyak b258bb3b7c
feat(version): add verbose option to display up-to-date versions
Sometimes it can be desired to get a results for each entry even if the
current version is up-to-date. Add a --verbose option to print this
optional detail.

Component: pkgctl version check
Component: pkgctl version upgrade
Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2024-01-22 19:45:04 +01:00
Christian Heusel 6054c869e1
feat(upgrade): introduce the version upgrade subcommand
This subcommand applies the detected upstream version upgrades to a
PKGBUILD.

Component: pkgctl version upgrade
Co-authored-by: Levente Polyak <anthraxx@archlinux.org>
Signed-off-by: Christian Heusel <christian@heusel.eu>
2024-01-21 23:28:29 +01:00
Jelle van der Waa e6f7aa395f
feat(version): introduce version check subcommand
The version subcommand handles pkgver related commands, the first
subcommand being `check`. Check runs nvchecker if a `.nvchecker.toml`
file exists and compares the current pkgver with the latest release.

Introduces nvchecker as optional dependency which has to be installed in
order to use this particular subcommand.

BREAKING CHANGE: formerly pkgctl version would output the version of the
pkgctl tool, now it is used as a version related subcommand.

Fixes #140

Component: pkgctl version
Component: pkgctl version check
Co-authored-by: Christian Heusel <christian@heusel.eu>
2024-01-10 19:44:15 +01:00
Christian Heusel 2b8033b911
feat(aur): add subcommand to drop a package from the repos to the AUR
Add an aur command to interact with the Arch User Repository including
the drop-from-repo subommand which allows to drop packages from the
official repository to the Arch User Repository in one go.

Related to #143

Component: pkgctl aur drop-from-repo
Co-authored-by: Levente Polyak <anthraxx@archlinux.org>
Signed-off-by: Christian Heusel <christian@heusel.eu>
2024-01-09 23:47:45 +01:00
Levente Polyak 8f45c65830
fix(completion): support subcommands that have multiple dashes
Dashes are not supported in function names and underscores were not
automatically translated. Replace all dashes of the current completion
token, if it is an arg which allows subcommands to use underscores
instead of dashes to declare their completion handlers.

Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2024-01-07 19:32:30 +01:00
Levente Polyak d0dc0e1a32
feat(search): add optional plain output formatting
This allows to run the search command without bats, which is not used in
the default pretty output format.

Component: pkgctl search
Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2024-01-07 02:38:42 +01:00
Jelle van der Waa 4673ad6c89
feat(search): add subcommand to search across the packaging group
Search for an expression across the GitLab packaging group. To use a
filter, include it in your query. You may use wildcards (*) to use glob
matching. Available filters for the blobs scope: path, extension.

Every usage of the search command must be authenticated. Consult the
'pkgctl auth' command to authenticate with GitLab or view the
authentication status.

This command uses bats for pretty printing the results including line
numbers and syntax highlighting.

Component: pkgctl search
Co-authored-by: Christian Heusel <christian@heusel.eu>
Co-authored-by: Levente Polyak <anthraxx@archlinux.org>
2024-01-07 02:35:18 +01:00
Levente Polyak 4425913e4f
chore(build): use more intuitive update-checksums option for humans
The philosophy of our CLI is to provide options that better match human
expectations in an intuitive way rather than mimic wording of previous
tools with abbreviation.

Component: pkgctl build
Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2024-01-05 01:01:52 +01:00
Christian Heusel 9a356eae82
feat(web): implement option to print the URL instead of opening it
In certain situations, users may encounter limitations when unable to
utilize xdg-open (e.g., when connected to an Arch machine via SSH).
Consequently, this commit introduces the option to simply print the
repository link to copy or click on it.

Signed-off-by: Christian Heusel <christian@heusel.eu>
Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2023-11-26 18:23:17 +01:00
kpcyrd ae14c246b8
feat(makerepropkg): Add option to skip running check for speedup
Add -n to allow running makepkg with --nocheck. This is useful to reduce
the time required to reproduce a package, as they should not depend on
running the check function for being reproducible.

Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2023-11-26 16:48:15 +01:00
Levente Polyak cc369e86d2
feat(makechrootpkg): add option to interactively inspect the chroot
Implement the -x option for makechrootpkg which allows to get an
interactive shell in the chroot after building the package. Useful to
ease the debugging of a package build.

Depending on the argument, the interactive shell is either always
spawned or only when an error occurred during build.

This option is also forwarded from `pkgctl build` via the `--inspect`
flag.

Component: pkgctl build
Component: makechrootpkg
Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2023-11-26 01:28:20 +01:00
Christian Heusel e7b82f36ef
feat(build): add --updpkgsums option
This is useful so people who update patches etc. can update their checksums on building.
The functionality itself was already implemented for --pkgver, but was not available separately.

Fixes #168
Component: pkgctl build
Signed-off-by: Christian Heusel <christian@heusel.eu>
2023-11-20 15:00:21 +01:00
Christian Heusel 0669315821
chore: refactor variable names in valid-{tags,repos}.sh
Even though the variables in these files are globablly used they have a weirdly local sounding name.
This commit fixes this by refactoring all usages throughout our codebase.

Signed-off-by: Christian Heusel <christian@heusel.eu>
2023-10-02 11:29:03 +02:00
Christian Heusel 030e6af880
chore: fix spelling mistake packge -> package
it seems like the mistake was copied to a few locations, this commit
fixes it.

Signed-off-by: Christian Heusel <christian@heusel.eu>
2023-07-06 15:30:49 +02:00
Levente Polyak a08bc2acf4
feature(clone): add protocol option to force cloning over HTTPS
This is a rather quick and simple implementation to override the current
logic and force clone with HTTPS. Allowing to explicitly clone over HTTPS
is currently required to unblock reproducible builds where no ssh keys
and GitLab user accounts are set up as of now. Hence this quick solution
comes into play to mitigate the regression on reproducible builds
builders.

Revisit the overall auto detection and protocol logic approach for a
later release related to some ideas floating around in pending
merge-requests.

Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2023-05-24 02:50:08 +02:00
Levente Polyak 6ce666a166
feature(parallel): run up to N jobs in parallel for repo clone/configure
Run up to N jobs in parallel. By default the number of jobs is equal to the
number of available processing units. For sequential processing this option
needs to be passed with 1.

Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2023-05-20 16:12:45 +02:00
Levente Polyak 830dcde2d8
pkgctl build: support worker slots for none tty builds
Allow overriding the worker slot with a dedicated option. Furthermore
detect if the current tty is no pts and fall back to choosing a random
worker slot between 1 and number of available processing units.

Fixes #137

Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2023-05-20 00:08:13 +02:00
Christian Heusel 8e3b6bcc5b
pkgctl repo clone: add option to switch working tree
Add an option to call the switch command after clone. Switch to a
specified version. The working tree and the index are updated to match
the version.

Signed-off-by: Christian Heusel <christian@heusel.eu>
Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2023-05-20 00:08:13 +02:00
Christian Heusel ed96635141
pkgctl repo: introduce the switch subcommand
Signed-off-by: Christian Heusel <christian@heusel.eu>
Co-Authored-By: Levente Polyak <anthraxx@archlinux.org>
2023-05-20 00:08:13 +02:00
Levente Polyak f961e2e948
completion: implemented structured declarative bash completions
This will make it tremendously easier to add arguments, subcommands and
special positional option handling. Instead of the need to code the
nested structure via bash and switch cases, we can simply declare
functions and arrays with the matching names according to the
subcommands or argument labels.

Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2023-05-20 00:08:13 +02:00
Christian Heusel 645a5a9f04
pkgctl: introduce the version subcommand
Related to https://gitlab.archlinux.org/archlinux/devtools/-/issues/125

Closes #125

Signed-off-by: Christian Heusel <christian@heusel.eu>
Co-Authored-By: Levente Polyak <anthraxx@archlinux.org>
2023-05-20 00:08:12 +02:00
Levente Polyak e1142935e5
completion: zsh: allow args even when the command has subcommands
This allows to show arguments on root level of commands that themselves
have subcommands available. Complete those when any - is used in the
completion word.
2023-05-20 00:08:12 +02:00
Levente Polyak f3518e248c
build: support nocheck for initial bootstrap builds
Output a warning when this option is used to remind packagers to rebuild
the packages with checks once the bootstrap cycle has been completed.
2023-05-20 00:08:12 +02:00
Levente Polyak fe2eb3076d
rebuildpkgs: drop legacy script, will be replaced with a smarter UX
Instead of trying to port this ancient script, which doesn't even seem
to work with community, let's instead remove it. We will be adding a
replacement script in pkgctl soon with a smarter and more convenient UX.
2023-05-20 00:08:12 +02:00
Levente Polyak f669a71e84
repo-configure: automatically determine protocol from packager identity
The remote protocol is automatically determined from the author email
address by choosing SSH for all official packager identities and
read-only HTTPS otherwise.

Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2023-05-20 00:08:11 +02:00
Levente Polyak 1d7f997215
build: command to build packages inside a clean chroot 2023-05-20 00:08:11 +02:00
Levente Polyak 5752488ef1
release: command to commit, tag and upload build artifacts
This is a smart and more convenient invocation of the classical
commitpkg and archrelease with auto-discovery for target repositories
and a shorthand option to directly call db-update.
2023-05-19 22:27:13 +02:00
Levente Polyak f834fc4700
db: command for Pacman database modification like update, move etc 2023-05-19 22:27:13 +02:00
Levente Polyak 2a59c32bf4
repo: added command to create a new packaging repository 2023-05-19 22:27:13 +02:00
Levente Polyak 77d800eab2
auth: implemented module to authenticate against our GitLab
This helps to have a convenient way to manage and test our personal
GitLab tokens. Those are used for certain API calls like creating new
repositories.

prefill the access token web view as per
https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#prefill-personal-access-token-name-and-scopes

Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2023-05-19 22:27:12 +02:00
Levente Polyak b5d5402e43
src: modularize repo layout into a library
This will greatly help us to structure the functionality and commands in
a more sane way. We will distribute the sources as actual libraries and
reuse code with imports instead of processing everything with m4 and
duplicating a lot of code.
2023-05-19 22:27:12 +02:00
Levente Polyak a8be7423ef
pkgctl: add a unified command-line frontend for devtools
This is the first step of a simple and highly structured unified
interface to devtools commands in a single wrapper.

The split is based on groups like `repo`, `build` and `diff`

Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2023-05-19 22:27:12 +02:00
Levente Polyak d15bd29a9d
pkgrepo: add subcommand to open the packaging repository's website
This can be quite handy if a packager quickly wants to check the GitLab
page for merge requests or but reports. Quickly calling a cli command
inside the current packaging clone or with the pkgname provided will
open the remote location inside the browser.

Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2023-05-19 22:27:12 +02:00
Levente Polyak 95424a88eb
pkgrepo: add option to clone all existing packages
This can be very handy for cache warming on the repo server or
to perform mass operations on all PKGBUILDs.

Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2023-05-19 22:27:12 +02:00
Levente Polyak 3d3176beb6
pkgrepo: rename archco as a general purpose tool for packaging repos
Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2023-05-19 22:27:12 +02:00
Levente Polyak 30616c4fde
archco: add option to clone all packages of a maintainer
Query Archweb to retrieve a list of all packages of a maintainer by
their pkgbase. AFterwards loop through all packages and clone them.

Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2023-05-19 22:27:11 +02:00
Levente Polyak 5eb09a9cc9
archco: implement clone and configure subcommands
Manages Git packaging repositories and helps with their configuration
according to distro specs.

Git author information and the used signing key is set up from
makepkg.conf read from any valid location like /etc or XDG_CONFIG_HOME.

The configure command can be used to synchronize the distro specs and
makepkg.conf settings for previously cloned repositories.

The unprivileged option can be used for cloning packaging repositories
without SSH access using read-only HTTPS.

Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2023-05-19 22:27:11 +02:00
Levente Polyak bb72473529
crossrepomove: drop support as this is not needed anymore
We unified the source repositories to a single location. Having to cross
repo move them between physical locations is not required anymore.
2023-03-19 22:02:04 +01:00
Levente Polyak f4e8047d65
diffpkg: prefer to search inside the pool dir if available
On certain packaging machines where the pacman cache gets updated very
infrequently, the behavior of diffpkg may not function correctly as old
packages were to be downloaded as diff target. In such cases we look for
a pool directory first and search via a glob for an available pool
package sorted by version.

The pool search glob has three glob segments each disallowing the dash
delimiter to split across pkgrel, pkgver and arch. This will return the
correct package from the pool without considering overly eager wildcards
that potentially match different pkgnames.

The default pool search directory is /srv/ftp/pool
2022-08-31 02:26:47 +02:00
Levente Polyak 70a3041ff8
diffpkg: allow to set column width for side-by-side view
The magic values `columns` and `auto` allow to set specific aspects,
with 'auto' as the default value:

- auto: Set width to the maximum line length of all input files
- columns: Set width to the shell defined $COLUMNS env var

Furthermore any number can be passed to set a static width.
2022-08-31 02:26:47 +02:00
Levente Polyak ba070f1ca9
diffpkg: add colored output option with default of auto 2022-08-23 20:23:51 +02:00
Levente Polyak b9dadc5576
diffpkg: allow to choose between unified context and two columns 2022-08-23 20:23:22 +02:00
Levente Polyak 37df0765d2
cleanup: move PKGBUILD.proto to contrib folder 2022-06-22 01:05:03 +02:00
Levente Polyak bb1a89a837
make: split out completion scripts from root worktree 2022-06-22 01:05:02 +02:00