Compare commits

...

46 Commits

Author SHA1 Message Date
Christian Heusel
88b595433a wip testinstall 2024-10-10 18:33:28 +02:00
Christian Heusel
e1401ce41c fix: disable confirmation when dropping packages
Since commit 1d433f6 ("feat(db): confirm list of all packages that will be removed") packages need confirmation by default when being dropped from the db. If we make it to the DB drop phase the package already is pushed to the AUR, so it is safe to remove from the database and not removing it would create a somewhat broken state, so we assume that the package should unconditionally be removed from the db.

Component: pkgctl aur drop-from-repo
Signed-off-by: Christian Heusel <christian@heusel.eu>
2024-09-29 12:40:22 +02:00
Orhun Parmaksız
8612b41a20 fix: update the personal access token URL
PAT settings are now under `user_settings` instead of `profile`

Component: pkgctl auth login
2024-09-25 13:20:46 +02:00
Jaroslav Lichtblau
fbb661645b doc: fix the example in the help text
Without the "--release" flag the example command fails with
==> ERROR: cannot use --message without --release.

Component: pkgctl build
2024-09-10 10:59:18 +02:00
Christian Heusel
f1dc2e18f7 fix: remove duplicate error message
It seems like nvchecker emits two log entries for errors:

    $ nvchecker --logger json -c .nvchecker.toml
    {"logger_name": "nvchecker.core", "name": "curl", "event": "token not given but it is required", "level": "error"}
    {"logger_name": "nvchecker.core", "name": "curl", "error": "token not given but it is required", "event": "no-result", "level": "error"}

This leads to a double error message as described in the related issue,
which we fix by narrowing the selector to filter for the error entry.

Fixes #235

Component: pkgctl version check
Signed-off-by: Christian Heusel <christian@heusel.eu>
2024-09-08 22:38:19 +02:00
Christian Heusel
c9d821448b fix(makechrootpkg): improve btrfs sanity checks
If the chroot was created in a way where it resides on a BTRFS file
system but "$copydir/root" is not a snapshot an error like the following
would be emitted:

  $ makechrootpkg -r ~/chroot
  ==> Synchronizing chroot copy [/home/chris/chroot/root] -> [chris]...ERROR: Not a Btrfs subvolume: Invalid argument
  ==> ERROR: Unable to create subvolume /home/chris/chroot/chris

Fix this by adding an additional check, which detects if the folder is
actually the root of a BTRFS snapshot before attempting to clone it.

Related to https://gitlab.archlinux.org/archlinux/devtools/-/merge_requests/259

Signed-off-by: Christian Heusel <christian@heusel.eu>
2024-09-08 22:33:45 +02:00
Fox2Code
a620250535 doc: specify default chroot folder for pkgctl-build 2024-08-21 11:26:33 +02:00
Jaroslav Lichtblau
27eebe383d doc: fix the example command in the help text
the '--pkgver' argument is not space-separated but instead specified
with an equals sign.

Component: pkgctl build
2024-06-26 21:00:19 +02:00
Jakub Klinkovský
d6d416b653 feat(checkpkg): enhance diff command for comparing file lists
Replace `sdiff` with `diff` (also from `diffutils`) with the following
parameters:

- `--side-by-side` for the `sdiff`-like output
- `--suppress-common-lines` for the `sdiff -s` behavior
- `--width="$COLUMNS"` to use the full terminal width (long lines are
  still truncated but it is definitely better than the default width of
  130 chars)
- `--color=auto` just because 😉
2024-06-26 07:40:12 +02:00
Chih-Hsuan Yen
9ff63503b9 fix(pkgctl): make sure git signing uses PGP
Component: pkgctl repo configure
2024-06-19 17:37:18 +08:00
Christian Heusel
3f02a1a24c chore(release): version v1.2.1 2024-06-18 14:14:22 +02:00
Christian Heusel
1df0979da6 fix(common): guard the WORKDIR environment var
This avoids the unwanted removal of the folder if someone has already
pre-defined the variable.

Fixes #219

Suggested-by: Levente Polyak <anthraxx@archlinux.org>
Signed-off-by: Christian Heusel <christian@heusel.eu>
2024-06-15 14:55:18 +02:00
Christian Heusel
c1a3ed224b misc: add a editorconfig to devtools
Signed-off-by: Christian Heusel <christian@heusel.eu>
2024-06-11 22:04:58 +02:00
David Runge
144f9a871e fix(version): Ignore warnings when nvchecker ignores invalid versions
Since version 2.15.1 nvchecker emits a warning for version strings that
it consideres invalid (e.g. in the case of PyPI).
These warning messages get in the way (the first version emitted via a
warning is used as version to compare against) of retrieving the latest
version of an upstream and therefore we ignore them.

Component: pkgctl version check
Signed-off-by: David Runge <dvzrv@archlinux.org>
2024-06-09 14:36:47 +02:00
Christian Heusel
44328cd9a3 test: fix the testcases so they pass again
The expected output for these tests has now changed since git smash
(which we test against) has changed their version scheme.

Component: pkgctl version setup
Signed-off-by: Christian Heusel <christian@heusel.eu>
2024-06-08 17:35:46 +02:00
Christian Heusel
0e2b16b0ac fix: disable systemd-nspawn terminal coloring
Systemd 256 introduces functionality which colors the terminal
background on systemd-nspawn invocations which makes the pkgctl output
look weird.

Disable this bevaviour for pkgctl, so it stays active for arch-nspawn
(for now).

Component: pkgctl
Signed-off-by: Christian Heusel <christian@heusel.eu>
2024-05-22 12:33:09 +02:00
Maharshi Basu
6f0a8c345d doc: add manpage info for pkgctl, pkgctl-db(1) & pkgctl-build
Changes made:
- add description in doc/man/pkgctl.1.asciidoc
- add description in doc/man/pkgctl-db(1).asciidoc
- add manpage for pkgctl-db(1) in doc/man/pkgctl-db(1).asciidoc

Fixes #231

Signed-off-by: Maharshi Basu <basumaharshi10@gmail.com>
2024-05-18 20:36:09 +02:00
依云
5f19853414 feat: support bind mounting a tmpfs
A .cache can be bind mounted into the container to save the caches for
reuse, but sometimes we want to exclude specific caches (because they
don't work well, e.g. bazel's).

Component: makechrootpkg
2024-05-18 19:39:18 +02:00
Frédéric Pierret (fepitre)
2b62ac660d feat(mkarchroot): allow to specify file destination inside chroot
Co-authored-by: Christian Heusel <christian@heusel.eu>
2024-05-18 13:53:39 +02:00
Jan Alexander Steffens (heftig)
7cb72699f6 fix: consider all git repos inside the chroot safe
Git 2.45.1 expanded its security checks to deny cloning even local repos
that are owned by another user. Previously, this just affected network
filesystems.

On our buildserver, this prevents makepkg from cloning repos from our
shared srcdest into the srcdir, if these repos were created by another
packager.

To disable this check, set `safe.directory` to `*`. This looks like a
glob, but is really just a special value. The only other option would be
to add each Git repository in srcdest to the configuration.

Component: makechrootpkg
2024-05-18 00:15:06 +02:00
Levente Polyak
d1790c295a fix(version): escape pkgbase in nvchecker toml
This fixes issues with packages containing plus signs, that need to be
escaped in toml as well as the extended grep regex.

Component: pkgctl version check
2024-05-10 21:22:23 +02:00
Levente Polyak
12a0d0c7b5 chore(release): version v1.2.0 2024-05-01 16:38:19 +02:00
Jakub Klinkovský
952f483574 feat(offload-build): fetch logs after building from the remote server
Since logs from offloaded builds are collected in a temporary directory
on the remote server, it is rather difficult/error-prone to get to them,
because the path changes in each rebuild. Fetching logs from the server
into $LOGDEST makes it easier to investigate them and also brings the
behavior of offload-build closer to archbuild.

Log files are always downloaded, even for failed builds.

Component: offload-build
Signed-off-by: Jakub Klinkovský <lahwaacz@archlinux.org>
Co-authored-by: Levente Polyak <anthraxx@archlinux.org>
2024-04-30 23:30:47 +02:00
Christian Heusel
c484a55cde fix(version): dont die if no PKGBUILD is found
So far the commands would stop execution if one of the target
directories did not contain a PKGBUILD instead of just reporting failure
for that directory. Fix this by replacing the 'die' calls with setting
the error for the spinner facility.

Component: pkgctl version check
Component: pkgctl version upgrade
Signed-off-by: Christian Heusel <christian@heusel.eu>
2024-04-29 19:04:46 +02:00
Robin Candau
a46b2d4fb7 feat(repo): add repo clean command to remove untracked files
This introduces the `pkgctl repo clean` command which removes every
untracked files from local package repositories (via `git clean`).

The usage is as simple as `pkgctl repo clean [OPTION] [PATH]` (where
"[PATH]" can be equal to a wildcard "*").

Component: pkgctl repo clean
2024-04-28 19:42:02 +02:00
Felix Yan
e828111ff7 feat(arch-nspawn): add support for pacman CacheServer
pacman 6.1 added support for CacheServer which allows us to download
packages faster and reduce the burden on tier0 server.

They won't be used to fetch databases so it should be pretty safe in the
repository consistency context.

Component: arch-nspawn
2024-04-28 17:06:46 +02:00
Levente Polyak
35b417d226 fix(db): check valid target repo on db remove
Return an error and abort operation when an invalid target repo is
passed.

Component: pkgctl db remove
Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2024-04-28 15:56:00 +02:00
Levente Polyak
1d433f600e feat(db): confirm list of all packages that will be removed
Sometimes it isn't obvious which set of packages are removed from a
split package when the pkgbase matches also a subset of a pkgbase. This
can happen for example with bootstrapping packages, when the intention
is to just remove a partial part of the bootstrap pkgbase.

To make the intention more explicit, list all to be removed packages and
await for confirmation.

Component: pkgctl db remove
Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2024-04-28 15:55:53 +02:00
Levente Polyak
7b553afcb2 feat(db): add partial split package option to db remove
By default passing a pkgbase removes all split packages, debug packages
as well as entries from the state repo for all existing architectures.

When using the `--partial` option it may most likely lead to undesired
effects by leaving debug packages behind as well as dangling entries in
the state repository. However, for specific use cases its required to
get rid of old split package parts.

Fixes #218

Component: pkgctl db remove
Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2024-04-27 18:38:12 +02:00
sfan5
01614c6817 feat(arch-nspawn): set console mode to autopipe
systemd-nspawn sets up a pts in the container by default which build
scripts might use to ask for interactive input.  This is only okay if
the host side is also a TTY.  The 'autopipe' mode deals with this
situation appropriately.
2024-04-27 14:52:13 +02:00
Christian Heusel
dced77d23d fix(completion): fix erroneous completion variables
The architecture definition of the variable was using invalid bash
syntax and was previously unused:

    $ _binary_arch=${DEVTOOLS_VALID_ARCHES[*]:0:-1}
    bash: -1: substring expression < 0

We therefore fix the definition of the variable and use it for the
autocompletion of the offload-build command.

Furthermore fix wrongly named architecture variables that have been
missed from previous refactoring.

Fixes #222

Component: completion
Fixes: f961e2e ("completion: implemented structured declarative bash completions")
Fixes: 4173e0a ("chore: refactor variable names in valid-{tags,repos}.sh")
Signed-off-by: Christian Heusel <christian@heusel.eu>
Co-authored-by: Levente Polyak <anthraxx@archlinux.org>
2024-04-24 22:55:18 +02:00
Levente Polyak
5780ba0e38 fix(release): ensure we release split package uploads as one batch
Use a central location in common.sh to define the default rsync options.
Switch to use batched uploads by targeting a partial directory which is
not taken into account by db update. Instead, once all packages that
belong to a split package group are uploaded into the .partial
directory, all artifacts are moved in one batch into the staging
directory of the repo server. This reduced the window of opportunity for
a partial release significantly to a tiny window.

Component: pkgctl release
2024-04-23 22:48:55 +02:00
Levente Polyak
9a5181db5b feat(pkgctl): add internal update checksums to better control output
This allows us to have more control over the output and status logs.
Using this method we are able to avoid cluttering the version upgrade
subcommand while downloading sources for updating the checksums.

Having this internally will also allow us in the future to have smart
checksums updating by only trying to change the checksums of sources
that have actually changed, for example when adjusting a patch file we
should avoid trying to overwrite the archive checksums unintentionally.

Component: pkgctl version upgrade
2024-04-23 20:23:49 +02:00
Robin Candau
55c2ca1312 feat(version): let upgrade subcommand also update checksums
This commit aims to make 'pkgctl version upgrade' also update checksums
in addition of bumping the pkgver and reseting the pkgrel.

Component: pkgctl version upgrade
2024-04-23 20:23:42 +02:00
Vekhir --
ccee85b2ab fix: conflicting packages when using -I
Originally fixed in b7893a2ca8, that approach created another bug when packages have several providers. In that case, pacman expects a number, so "yes" is not a valid answer, leading to an infinite loop.

Using the undocumented, but stable option "--ask=4" allows to selectively change the default answer for conflicts, therefore properly fixing the underlying issue.
See also: https://gitlab.archlinux.org/pacman/pacman/-/issues/60
Fixes #163

Component: makechrootpkg
2024-04-16 23:50:12 +02:00
Levente Polyak
05bea3e922 test: add basic bats setup and test cases for version setup
Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2024-03-23 23:57:46 +01:00
Levente Polyak
de0ea3b2f8 fix(version): do not prompt for input on terminal during check
In certain scenarios, like when an URL is checked that asks for
credentials or other kind of input, the process blocks and waits for
stdin input. This isn't particularly useful during scripted execution
and in our cases also just an indicator for like a none existing GitHub
repository.

To avoid this situation, disable git terminal prompts.

Component: pkgctl version check
Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2024-03-23 23:57:45 +01:00
Jelle van der Waa
81f5e7b3b3 feat(version): add command to automatically detect and setup nvchecker
Introduce a new version subcommand `setup` which does a best effort to
generate the most minimal required .nvchecker.toml file for specific
sources.

It supports a wide range of common sources like:
- Git, GitHub, GitLab, Hackage, NPM, PyPI, RubyGems, CPAN, crates.io

The creation logic is based on matching a domain for a source which is
something predictable and then simply passes an array of the url parts
for every source creator to extract the useful bits out of the url
array.

Component: pkgctl version setup
Co-authored-by: Levente Polyak <anthraxx@archlinux.org>
Signed-off-by: Jelle van der Waa <jelle@archlinux.org>
2024-03-23 23:57:45 +01:00
Levente Polyak
01b6b0849e doc(man): fix cut off page names by switching to modern asciidoctor
Asciidoc is the old reference implementation in Python, which has some
shortcoming. Specifically we are hitting cut off page names for long
subcommands. Fix this by switching to a more modern implementation named
asciidoctor.

During the migration, get rid of the explicit asciidoc.conf file that
was required to define a linkman macro, which is now supported out of
the box.

Fixes #170

Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2024-03-09 02:48:14 +01:00
Caleb Maclennan
7033554e45 fix(drop-from-repo): avoid Git trying to push tags to the AUR
If users have enabled push.followTags in their Git config then dropping
packages to the AUR spews errors because all the release tags from
official repos are rejected by AUR repos.
2024-03-09 01:33:56 +01:00
Morten Linderud
40f476c649 fix(pkgctl): skip path arguments that are not directories
Several subcommands accept multiple paths in a way that passing a
wildcard is an expected use case. Previously this wasn't possible if the
main directory contained any text files or scripts.
Fix this by skipping none directory paths for such commands.

Component: pkgctl
Signed-off-by: Morten Linderud <foxboron@archlinux.org>
2024-03-09 00:49:24 +01:00
Levente Polyak
509dd24bdc fix(completion): allow multi opts more than once in zsh
Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2024-02-29 23:35:29 +01:00
Frederik “Freso” S. Olesen
7a9ef3bc57 feat(makepkg.conf): Add no-omit-frame-pointer flags by default
RFC-26 proposes to add -fno-omit-frame-pointer and
-mno-omit-leaf-frame-pointer to the default compilation flags
to improve the effectiveness of profiling and debugging tools.

See https://rfc.archlinux.page/0026-fno-omit-frame-pointer/
2024-02-29 21:39:22 +01:00
Levente Polyak
354c9dcd12 fix(drop-from-repo): avoid error when updating remote head
We can only update the local ref to the remote head from main to master
once we have actually pushed the master branch to the remote. If we do
this too early, the call will simply error out.

Instead, only update the local head for the configured remote after we
have successfully renamed the branch and pushed it to the AUR.

Fixes #212

Component: pkgctl aur drop-from-repo
Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2024-02-29 21:20:31 +01:00
Orhun Parmaksız
39eaeaa4b2 feat(offload-build): use rsync instead of scp
This commit simply replaces the usage of `scp` with `rsync`
for faster file transfer.

Signed-off-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2024-02-15 22:23:54 +01:00
kpcyrd
c79a993148 feat(makepkg.conf): Increase _FORTIFY_SOURCE level to 3
RFC: https://rfc.archlinux.page/0017-increase-fortification-level/
2024-02-14 02:08:01 +01:00
118 changed files with 2668 additions and 235 deletions

15
.editorconfig Normal file
View File

@@ -0,0 +1,15 @@
# EditorConfig configuration for devtools
# https://editorconfig.org
# Top-most EditorConfig file
root = true
# Unix-style newlines without trailing whitespaces, but with a newline
# ending every file, utf-8 charset, set indent to tabs
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
indent_style = tab
tab_width = 4

View File

@@ -8,14 +8,37 @@ build:
stage: build
needs: []
script:
- pacman -Syu --noconfirm m4 make openssh subversion rsync arch-install-scripts git bzr mercurial diffutils asciidoc
- pacman -Syu --noconfirm m4 make openssh subversion rsync arch-install-scripts git bzr mercurial diffutils asciidoctor
- make PREFIX=/usr
- make PREFIX=/usr DESTDIR=build install
check:
lint:
stage: test
needs: []
script:
- pacman -Syu --noconfirm m4 make openssh subversion rsync arch-install-scripts git bzr mercurial diffutils asciidoc shellcheck
- pacman -Syu --noconfirm m4 make openssh subversion rsync arch-install-scripts git bzr mercurial diffutils asciidoctor shellcheck
- make check || true
- SHELLCHECK_OPTS="-S error" make check
test:
stage: test
needs: []
script:
- pacman -Syu --noconfirm m4 make openssh subversion rsync arch-install-scripts git bzr mercurial diffutils coreutils asciidoctor shellcheck nvchecker bats
- make test BATS_EXTRA_ARGS='--formatter junit'
artifacts:
reports:
junit: build/coverage/bats-report.xml
coverage:
stage: test
needs: []
script:
- pacman -Syu --noconfirm m4 make openssh subversion rsync arch-install-scripts git bzr mercurial diffutils coreutils asciidoctor shellcheck nvchecker bats kcov jq
- make coverage
coverage: '/Percent covered\s+\d+\.\d+/'
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: build/coverage/bats.*/cobertura.xml

View File

@@ -1,6 +1,6 @@
SHELL=/bin/bash
SHELL=/bin/bash -o pipefail
V=1.1.1
V=1.2.1
BUILDTOOLVER ?= $(V)
PREFIX = /usr/local
@@ -52,6 +52,13 @@ ARCHBUILD_LINKS = \
COMPLETIONS = $(addprefix $(BUILDDIR)/,$(patsubst %.in,%,$(wildcard contrib/completion/*/*)))
CASES ?= test/case
JOBS ?= $(shell nproc)
BATS_EXTRA_ARGS ?=
BATS_ARGS ?= --jobs $(JOBS) $(BATS_EXTRA_ARGS) --verbose-run
COVERAGE_DIR ?= $(BUILDDIR)/coverage
all: binprogs library conf completion man
binprogs: $(BINPROGS)
library: $(LIBRARY)
@@ -92,10 +99,10 @@ $(eval $(call buildInScript,build/bin,src/,.in,755))
$(eval $(call buildInScript,build/lib,src/lib/,,644))
$(foreach completion,$(wildcard contrib/completion/*),$(eval $(call buildInScript,build/$(completion),$(completion)/,.in,444)))
$(BUILDDIR)/doc/man/%: doc/man/%.asciidoc doc/asciidoc.conf doc/man/include/footer.asciidoc
$(BUILDDIR)/doc/man/%: doc/man/%.asciidoc doc/man/include/footer.asciidoc
$(GEN_MSG)
@mkdir -p $(BUILDDIR)/doc/man
@a2x --no-xmllint --asciidoc-opts="-f doc/asciidoc.conf" -d manpage -f manpage --destination-dir=$(BUILDDIR)/doc/man -a pkgdatadir=$(DATADIR) $<
@asciidoctor --backend=manpage --destination-dir=$(BUILDDIR)/doc/man --attribute pkgdatadir=$(DATADIR) $<
conf:
@install -d $(BUILDDIR)/makepkg.conf.d
@@ -168,8 +175,24 @@ dist:
git archive --format=tar --prefix=devtools-$(V)/ v$(V) | gzip > devtools-$(V).tar.gz
gpg --detach-sign --use-agent devtools-$(V).tar.gz
test: binprogs library conf completion man
@mkdir -p $(COVERAGE_DIR)
bats $(BATS_ARGS) $(CASES) | tee $(COVERAGE_DIR)/bats-report.xml
coverage: binprogs library conf completion man
kcov --include-path=src $(COVERAGE_DIR) bats $(BATS_ARGS) $(CASES)
jq -r '. | ["Percent covered", .percent_covered], ["Covered lines", .covered_lines], ["Total lines", .total_lines], ["Percent low", .percent_low], ["Percent high", .percent_high] | @tsv' \
$(COVERAGE_DIR)/bats.*/coverage.json
testinstall:
tar --transform 's,^,devtools/,' -cz -f test/devtools.tar.gz --exclude='test' --exclude='./build' .
mv test/devtools.tar.gz devtools.tar.gz
pkgctl build --repo extra-testing
rm devtools.tar.gz
sudo pacman -U $$(makepkg --packagelist)
check: $(BINPROGS_SRC) $(LIBRARY_SRC) contrib/completion/bash/devtools.in config/makepkg/x86_64.conf contrib/makepkg/PKGBUILD.proto
shellcheck $^
.PHONY: all binprogs library completion conf man clean install uninstall tag dist upload check
.PHONY: all binprogs library completion conf man clean install uninstall tag dist upload test coverage check
.DELETE_ON_ERROR:

64
PKGBUILD Normal file
View File

@@ -0,0 +1,64 @@
# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Maintainer: Christian Heusel <gromit@archlinux.org>
# Contributor: Pierre Schmitz <pierre@archlinux.de>
pkgname=devtools-devel
_pkgname=devtools
epoch=1
pkgver=1.0.4.r10.g4a78f0e
pkgrel=1
pkgdesc='Tools for Arch Linux package maintainers (devel version)'
arch=('any')
license=('GPL')
url='https://gitlab.archlinux.org/archlinux/devtools'
depends=(
arch-install-scripts
awk
bash
binutils
coreutils
diffutils
fakeroot
findutils
grep
jq
openssh
parallel
rsync
sed
util-linux
breezy
git
mercurial
subversion
)
makedepends=(
asciidoctor
shellcheck
)
optdepends=('btrfs-progs: btrfs support')
conflicts=(devtools)
provides=(devtools)
source=(test/devtools.tar.gz)
sha256sums=('SKIP')
b2sums=('SKIP')
pkgver() {
cd ${_pkgname}
git describe --long --abbrev=7 | sed 's/v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}
build() {
cd ${_pkgname}
make BUILDTOOLVER="${epoch}:${pkgver}-${pkgrel}-${arch}" PREFIX=/usr
}
package() {
cd ${_pkgname}
make PREFIX=/usr DESTDIR="${pkgdir}" install
}
# vim: ts=2 sw=2 et:

View File

@@ -71,6 +71,7 @@ Component: pkgctl db remove
- coreutils
- curl
- diffutils
- expac
- fakeroot
- findutils
- grep
@@ -91,13 +92,13 @@ Component: pkgctl db remove
- bat (pretty printing)
- nvchecker (version checking)
- pacman-contrib (--update-checksums options for pkgctl build)
### Development Dependencies
- asciidoc
- asciidoctor
- make
- shellcheck
- bats
## License

View File

@@ -41,13 +41,14 @@ CHOST="x86_64-pc-linux-gnu"
#-- Compiler and Linker Flags
#CPPFLAGS=""
CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions \
-Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
-fstack-clash-protection -fcf-protection"
-Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security \
-fstack-clash-protection -fcf-protection \
-fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"
CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now \
-Wl,-z,pack-relative-relocs"
LTOFLAGS="-flto=auto"
RUSTFLAGS=""
RUSTFLAGS="-Cforce-frame-pointers=yes"
#-- Make Flags: change this for DistCC/SMP systems
#MAKEFLAGS="-j2"
#-- Debugging flags

View File

@@ -41,13 +41,14 @@ CHOST="x86_64-pc-linux-gnu"
#-- Compiler and Linker Flags
#CPPFLAGS=""
CFLAGS="-march=x86-64-v3 -mtune=generic -O2 -pipe -fno-plt -fexceptions \
-Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
-fstack-clash-protection -fcf-protection"
-Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security \
-fstack-clash-protection -fcf-protection \
-fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"
CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now \
-Wl,-z,pack-relative-relocs"
LTOFLAGS="-flto=auto"
RUSTFLAGS=""
RUSTFLAGS="-Cforce-frame-pointers=yes"
#-- Make Flags: change this for DistCC/SMP systems
#MAKEFLAGS="-j2"
#-- Debugging flags

112
config/pacman/universe.conf Normal file
View File

@@ -0,0 +1,112 @@
#
# /etc/pacman.conf
#
# See the pacman.conf(5) manpage for option and repository directives
#
# GENERAL OPTIONS
#
[options]
# The following paths are commented out with their default values listed.
# If you wish to use different paths, uncomment and update the paths.
#RootDir = /
#DBPath = /var/lib/pacman/
#CacheDir = /var/cache/pacman/pkg/
#LogFile = /var/log/pacman.log
#GPGDir = /etc/pacman.d/gnupg/
#HookDir = /etc/pacman.d/hooks/
HoldPkg = pacman glibc
#XferCommand = /usr/bin/curl -L -C - -f -o %o %u
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#CleanMethod = KeepInstalled
Architecture = auto
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
#IgnorePkg =
#IgnoreGroup =
#NoUpgrade =
#NoExtract =
# Misc options
#UseSyslog
#Color
NoProgressBar
# We cannot check disk space from within a chroot environment
#CheckSpace
VerbosePkgLists
ParallelDownloads = 5
# By default, pacman accepts packages signed by keys that its local keyring
# trusts (see pacman-key and its man page), as well as unsigned packages.
SigLevel = Required DatabaseOptional
LocalFileSigLevel = Optional
#RemoteFileSigLevel = Required
# NOTE: You must run `pacman-key --init` before first using pacman; the local
# keyring can then be populated with the keys of all official Arch Linux
# packagers with `pacman-key --populate archlinux`.
#
# REPOSITORIES
# - can be defined here or included from another file
# - pacman will search repositories in the order defined here
# - local/custom mirrors can be added here or in separate files
# - repositories listed first will take precedence when packages
# have identical names, regardless of version number
# - URLs will have $repo replaced by the name of the current repo
# - URLs will have $arch replaced by the name of the architecture
#
# Repository entries are of the format:
# [repo-name]
# Server = ServerName
# Include = IncludePath
#
# The header [repo-name] is crucial - it must be present and
# uncommented to enable the repo.
#
# The testing repositories are disabled by default. To enable, uncomment the
# repo name header and Include lines. You can add preferred servers immediately
# after the header, and they will be used before the default mirrors.
[gnome-unstable]
Include = /etc/pacman.d/mirrorlist
[kde-unstable]
Include = /etc/pacman.d/mirrorlist
[core-staging]
Include = /etc/pacman.d/mirrorlist
[core-testing]
Include = /etc/pacman.d/mirrorlist
[core]
Include = /etc/pacman.d/mirrorlist
[extra-staging]
Include = /etc/pacman.d/mirrorlist
[extra-testing]
Include = /etc/pacman.d/mirrorlist
[extra]
Include = /etc/pacman.d/mirrorlist
# If you want to run 32 bit applications on your x86_64 system,
# enable the multilib repositories as required here.
[multilib-staging]
Include = /etc/pacman.d/mirrorlist
[multilib-testing]
Include = /etc/pacman.d/mirrorlist
[multilib]
Include = /etc/pacman.d/mirrorlist
# An example of a custom package repository. See the pacman manpage for
# tips on creating your own repositories.
#[custom]
#SigLevel = Optional TrustAll
#Server = file:///home/custompkgs

View File

@@ -0,0 +1,83 @@
#
# /etc/pacman.conf
#
# See the pacman.conf(5) manpage for option and repository directives
#
# GENERAL OPTIONS
#
[options]
# The following paths are commented out with their default values listed.
# If you wish to use different paths, uncomment and update the paths.
#RootDir = /
#DBPath = /var/lib/pacman/
#CacheDir = /var/cache/pacman/pkg/
#LogFile = /var/log/pacman.log
#GPGDir = /etc/pacman.d/gnupg/
#HookDir = /etc/pacman.d/hooks/
HoldPkg = pacman glibc
#XferCommand = /usr/bin/curl -L -C - -f -o %o %u
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#CleanMethod = KeepInstalled
Architecture = auto
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
#IgnorePkg =
#IgnoreGroup =
#NoUpgrade =
#NoExtract =
# Misc options
#UseSyslog
#Color
NoProgressBar
# We cannot check disk space from within a chroot environment
#CheckSpace
VerbosePkgLists
ParallelDownloads = 5
# By default, pacman accepts packages signed by keys that its local keyring
# trusts (see pacman-key and its man page), as well as unsigned packages.
SigLevel = Required DatabaseOptional
LocalFileSigLevel = Optional
#RemoteFileSigLevel = Required
# NOTE: You must run `pacman-key --init` before first using pacman; the local
# keyring can then be populated with the keys of all official Arch Linux
# packagers with `pacman-key --populate archlinux`.
#
# REPOSITORIES
# - can be defined here or included from another file
# - pacman will search repositories in the order defined here
# - local/custom mirrors can be added here or in separate files
# - repositories listed first will take precedence when packages
# have identical names, regardless of version number
# - URLs will have $repo replaced by the name of the current repo
# - URLs will have $arch replaced by the name of the architecture
#
# Repository entries are of the format:
# [repo-name]
# Server = ServerName
# Include = IncludePath
#
# The header [repo-name] is crucial - it must be present and
# uncommented to enable the repo.
#
# The testing repositories are disabled by default. To enable, uncomment the
# repo name header and Include lines. You can add preferred servers immediately
# after the header, and they will be used before the default mirrors.
[gnome-unstable]
Include = /etc/pacman.d/mirrorlist
[kde-unstable]
Include = /etc/pacman.d/mirrorlist
# An example of a custom package repository. See the pacman manpage for
# tips on creating your own repositories.
#[custom]
#SigLevel = Optional TrustAll
#Server = file:///home/custompkgs

View File

@@ -14,7 +14,6 @@ source "${_DEVTOOLS_LIBRARY_DIR}"/lib/valid-inspect.sh
# shellcheck source=src/lib/valid-search.sh
source "${_DEVTOOLS_LIBRARY_DIR}"/lib/valid-search.sh
_binary_arch=${DEVTOOLS_VALID_ARCHES[*]:0:-1}
_colors=(never always auto)
@@ -28,6 +27,7 @@ _makechrootpkg_args=(
-I
-l
-n
-t
-T
-U
-x
@@ -37,6 +37,7 @@ _makechrootpkg_args_D_opts() { _filedir -d; }
_makechrootpkg_args_r_opts() { _filedir -d; }
_makechrootpkg_args_I_opts() { _filedir '*.pkg.tar.*'; }
_makechrootpkg_args_l_opts() { _filedir -d; }
_makechrootpkg_args_t_opts() { _filedir -d; }
_makechrootpkg_args_U_opts() { :; }
_makechrootpkg_args_x_opts() { _devtools_completions_inspect; }
_makechrootpkg() { __devtools_complete _makechrootpkg; }
@@ -62,12 +63,14 @@ _mkarchroot_args=(
-C
-M
-c
-f
-h
)
_mkarchroot_args_U_opts() { _filedir '*.pkg.tar.*'; }
_mkarchroot_args_C_opts() { _filedir '*.conf'; }
_mkarchroot_args_M_opts() { _filedir '*.conf'; }
_mkarchroot_args_c_opts() { _filedir -d; }
_mkarchroot_args_f_opts() { _filedir -d; }
_mkarchroot_opts() {
local args
args=$(__pkgctl_word_count_after_subcommand)
@@ -128,7 +131,7 @@ _offload_build_args=(
)
_offload_build_args__repo_opts() { _devtools_completions_build_repo; }
_offload_build_args_r_opts() { _offload_build_args__repo_opts; }
_offload_build_args__arch_opts() { _devtools_completions_arch; }
_offload_build_args__arch_opts() { _devtools_completions_binary_arch; }
_offload_build_args_a_opts() { _offload_build_args__arch_opts; }
_offload_build_args__server_opts() { :; }
_offload_build_args_s_opts() { _offload_build_args__server_opts; }
@@ -196,7 +199,7 @@ _pkgctl_build_args=(
-h --help
)
_pkgctl_build_args__arch_opts() { _devtools_completions_arch; }
_pkgctl_build_args__arch_opts() { _devtools_completions_binary_arch; }
_pkgctl_build_args__repo_opts() { _devtools_completions_repo; }
_pkgctl_build_args__worker_opts() { :; }
_pkgctl_build_args_w_opts() { _pkgctl_build_args__worker_opts; }
@@ -241,9 +244,13 @@ _pkgctl_db_move_opts() {
_pkgctl_db_remove_args=(
--partial
--noconfirm
-a --arch
-h --help
)
_pkgctl_db_remove_args__arch_opts() { _devtools_completions_binary_arch; }
_pkgctl_db_remove_args_a_opts() { _pkgctl_db_remove_args__arch_opts; }
_pkgctl_db_remove_opts() {
local subcommand args
subcommand=(db remove)
@@ -289,6 +296,7 @@ _pkgctl_aur_drop_from_repo_opts() { _filedir -d; }
_pkgctl_repo_cmds=(
clean
clone
configure
create
@@ -314,6 +322,12 @@ _pkgctl_repo_clone_args__jobs_opts() { :; }
_pkgctl_repo_clone_args_j_opts() { _pkgctl_repo_clone_args__jobs_opts; }
_pkgctl_repo_clone_opts() { _devtools_completions_all_packages; }
_pkgctl_repo_clean_args=(
-i --interactive
-n --dry-run
-h --help
)
_pkgctl_repo_clean_opts() { _filedir -d; }
_pkgctl_repo_configure_args=(
--protocol
@@ -350,6 +364,7 @@ _pkgctl_repo_switch_opts() {
_pkgctl_version_cmds=(
check
setup
upgrade
)
@@ -360,7 +375,19 @@ _pkgctl_version_check_args=(
_pkgctl_version_check_opts() { _filedir -d; }
_pkgctl_version_setup_args=(
--prefer-platform-api
--url
--no-check
-f --force
-h --help
)
_pkgctl_version_setup_opts() { _filedir -d; }
_pkgctl_version_setup_args__url_opts() { :; }
_pkgctl_version_upgrade_args=(
--no-update-checksums
-v --verbose
-h --help
)
@@ -421,6 +448,9 @@ _devtools_completions_color() {
_devtools_completions_arch() {
mapfile -t COMPREPLY < <(compgen -W "${DEVTOOLS_VALID_ARCHES[*]}" -- "$cur")
}
_devtools_completions_binary_arch() {
mapfile -t COMPREPLY < <(compgen -W "${DEVTOOLS_VALID_BINARY_ARCHES[*]}" -- "$cur")
}
_devtools_completions_repo() {
local optional=${1:-}
mapfile -t COMPREPLY < <(compgen -W "${optional} ${DEVTOOLS_VALID_REPOS[*]}" -- "$cur")

View File

@@ -14,7 +14,6 @@ source "${_DEVTOOLS_LIBRARY_DIR}"/lib/valid-inspect.sh
# shellcheck source=src/lib/valid-search.sh
source "${_DEVTOOLS_LIBRARY_DIR}"/lib/valid-search.sh
_binary_arch=${DEVTOOLS_VALID_ARCHES[*]:0:-1}
_colors=(never always auto)
_archbuild_args=(
@@ -41,15 +40,15 @@ _pkgctl_auth_status_args=(
)
_pkgctl_build_args=(
"--arch=[Specify architectures to build for (disables auto-detection)]:arch:($_arch[*])"
"--repo=[Specify a target repository (disables auto-detection)]:repo:($DEVTOOLS_VALID_REPOS[*])"
"--arch[Specify architectures to build for (disables auto-detection)]:arch:($DEVTOOLS_VALID_BINARY_ARCHES[*])"
"--repo[Specify a target repository (disables auto-detection)]:repo:($DEVTOOLS_VALID_REPOS[*])"
'(-s --staging)'{-s,--staging}'[Build against the staging counterpart of the auto-detected repo]'
'(-t --testing)'{-t,--testing}'[Build against the testing counterpart of the auto-detected repo]'
'(-o --offload)'{-o,--offload}'[Build on a remote server and transfer artifacts afterwards]'
'(-c --clean)'{-c,--clean}'[Recreate the chroot before building]'
"--inspect[Spawn an interactive shell to inspect the chroot (never, always, failure)]:inspect:($DEVTOOLS_VALID_INSPECT_MODES[*])"
'(-I --install-to-chroot)'{-I,--install-to-chroot}'[Install a package to the working copy of the chroot]:target:_files -g "*.pkg.tar.*(.)"'
'(-i --install-to-host)'{-i,--install-to-host}"[Install the built packages to the host system]:mode:($DEVTOOLS_VALID_BUILD_INSTALL[*])"
'*'{-I,--install-to-chroot}'[Install a package to the working copy of the chroot]:target:_files -g "*.pkg.tar.*(.)"'
'*'{-i,--install-to-host}"[Install the built packages to the host system]:mode:($DEVTOOLS_VALID_BUILD_INSTALL[*])"
'(-w --worker)'{-w,--worker}'[Name of the worker slot, useful for concurrent builds (disables auto-detection)]:slot:'
'--nocheck[Do not run the check() function in the PKGBUILD]'
'--pkgver=[Set pkgver, reset pkgrel and update checksums]:pkgver:'
@@ -79,7 +78,9 @@ _pkgctl_db_move_args=(
)
_pkgctl_db_remove_args=(
'(-a --arch=)'{-a,--arch=}"[Override the architecture (disables auto-detection)]:arch:($_arch[*])"
'--partial[Remove only partial pkgnames from a split package]'
'--noconfirm[Bypass any confirmation messages, should only be used with caution]'
'(-a --arch)'{-a,--arch}"[Override the architecture (disables auto-detection)]:arch:($DEVTOOLS_VALID_BINARY_ARCHES[*])"
'(-h --help)'{-h,--help}'[Display usage]'
"1:repo:($DEVTOOLS_VALID_REPOS[*])"
'*:pkgbase:_devtools_completions_all_packages'
@@ -113,6 +114,7 @@ _pkgctl_aur_drop_from_repo_args=(
_pkgctl_repo_cmds=(
"pkgctl repo command"
"clean[Remove untracked files from the working tree]"
"clone[Clone a package repository]"
"configure[Configure a clone according to distro specs]"
"create[Create a new GitLab package repository]"
@@ -127,6 +129,13 @@ _pkgctl_repo_switch_args=(
'*:git_dir:_files -/'
)
_pkgctl_repo_clean_args=(
'(-i --interactive)'{-i,--interactive}'[Show what would be done and clean files interactively]'
'(-n --dry-run)'{-n,--dry-run}"[Don't remove anything, just show what would be done]"
'(-h --help)'{-h,--help}'[Display usage]'
'*:git_dir:_files -/'
)
_pkgctl_repo_clone_args=(
'(-m --maintainer=)'{-m,--maintainer=}'[Clone all packages of the named maintainer]:maintainer:'
'--protocol[Clone the repository over https]:proto:(https)'
@@ -168,8 +177,8 @@ _pkgctl_search_args=(
_arch_nspawn_args=(
'-C[Location of a pacman config file]:pacman_config:_files -g "*.conf(.)"'
'-M[Location of a makepkg config file]:makepkg_config:_files -g "*.conf(.)"'
'-c[Set pacman cache]:pacman_cache:_files -/'
'-f[Copy file from the host to the chroot]:copy_file:_files'
'*-c[Set pacman cache]:pacman_cache:_files -/'
'*-f[Copy file from the host to the chroot]:copy_file:_files'
'-s[Do not run setarch]'
'-h[Display usage]'
'1:chroot_dir:_files -/'
@@ -211,11 +220,12 @@ _finddeps_args=(
_makechrootpkg_args=(
'-h[Display usage]'
'-c[Clean the chroot before building]'
'-d[Bind directory into build chroot as read-write]:bind_dir_rw:_files -/'
'-D[Bind directory into build chroot as read-only]:bind_dir_ro:_files -/'
'*-d[Bind directory into build chroot as read-write]:bind_dir_rw:_files -/'
'*-D[Bind directory into build chroot as read-only]:bind_dir_ro:_files -/'
'*-t[Mount a tmpfs at directory]:tmpfs_dir:_files -/'
'-u[Update the working copy of the chroot before building]'
'-r[The chroot dir to use]:chroot_dir:_files -/'
'-I[Install a package into the working copy]:target:_files -g "*.pkg.tar.*(.)"'
'*-I[Install a package into the working copy]:target:_files -g "*.pkg.tar.*(.)"'
'-l[The directory to use as the working copy]:copy_dir:_files -/'
'-n[Run namcap on the package]'
'-T[Build in a temporary directory]'
@@ -228,6 +238,7 @@ _mkarchroot_args=(
'-C[Location of a pacman config file]:pacman_config:_files -g "*.conf(.)"'
'-M[Location of a makepkg config file]:makepkg_config:_files -g "*.conf(.)"'
'-c[Set pacman cache]:pacman_cache:_files -/'
'-f[Copy src file from the host to the chroot]:target:_files -/'
'-h[Display usage]'
'1:working_dir:_files -/'
'*:packages:_devtools_completions_all_packages'
@@ -250,7 +261,7 @@ _sogrep_args=(
_offload_build_args=(
'(-r --repo)'{-r,--repo}'[Build against a specific repository]:repo:($DEVTOOLS_VALID_BUILDREPOS[*])'
'(-a --arch)'{-a,--arch}'[Build against a specific architecture]:arch:(${_binary_arch[*]})'
'(-a --arch)'{-a,--arch}'[Build against a specific architecture]:arch:(${DEVTOOLS_VALID_BINARY_ARCHES[*]})'
'(-s --server)'{-s,--server}'[Offload to a specific Build server]:server:'
'(-h --help)'{-h,--help}'[Display usage]'
)
@@ -291,6 +302,7 @@ _pkgctl_args=(
_pkgctl_version_cmds=(
"pkgctl version command"
"check[Compares local package versions against upstream versions]"
"setup[Automatically detect and setup a basic nvchecker config]"
"upgrade[Adjust the PKGBUILD to match the latest upstream version]"
)
@@ -300,7 +312,17 @@ _pkgctl_version_check_args=(
'*:git_dir:_files -/'
)
_pkgctl_version_setup_args=(
'(-f --force)'{-f,--force}'[Do not prompt before overwriting]'
'--prefer-platform-api[Prefer platform specific GitHub/GitLab API for complex cases]'
'--url[Derive check target from URL instead of source array]:url:'
'--no-check[Do not run version check after setup]'
'(-h --help)'{-h,--help}'[Display usage]'
'*:git_dir:_files -/'
)
_pkgctl_version_upgrade_args=(
'--no-update-checksums[Disable computation and update of the checksums]'
'(-v --verbose)'{-v,--verbose}'[Display results including up-to-date versions]'
'(-h --help)'{-h,--help}'[Display usage]'
'*:git_dir:_files -/'

View File

@@ -1,37 +0,0 @@
## linkman: macro
# Inspired by/borrowed from the GIT source tree at Documentation/asciidoc.conf
#
# Usage: linkman:command[manpage-section]
#
# Note, {0} is the manpage section, while {target} is the command.
#
# Show man link as: <command>(<section>); if section is defined, else just show
# the command.
[macros]
(?su)[\\]?(?P<name>linkman):(?P<target>\S*?)\[(?P<attrlist>.*?)\]=
[attributes]
asterisk=&#42;
plus=&#43;
caret=&#94;
startsb=&#91;
endsb=&#93;
backslash=&#92;
tilde=&#126;
apostrophe=&#39;
backtick=&#96;
litdd=&#45;&#45;
ifdef::backend-docbook[]
[linkman-inlinemacro]
{0%{target}}
{0#<citerefentry>}
{0#<refentrytitle>{target}</refentrytitle><manvolnum>{0}</manvolnum>}
{0#</citerefentry>}
endif::backend-docbook[]
ifdef::backend-xhtml11[]
[linkman-inlinemacro]
<a href="{target}.{0}.html">{target}{0?({0})}</a>
endif::backend-xhtml11[]

View File

@@ -28,8 +28,9 @@ Options
*-c* <dir>::
Set pacman cache, if no directory is specified the passed pacman.conf's cachedir is used with a fallback to '/etc/pacman.conf'
*-f* <file>::
Copy file from the host to the chroot
*-f* <src>[:<dst>]::
Copy file from the host to the chroot.
If 'dst' is not provided, it defaults to 'src' inside of the chroot.
*-s*::
Do not run setarch

View File

@@ -43,6 +43,6 @@ Options
See Also
--------
linkman:devtools[7]
devtools(7)
include::include/footer.asciidoc[]

View File

@@ -38,6 +38,6 @@ Options
See Also
--------
linkman:find-libprovides[1]
find-libprovides(1)
include::include/footer.asciidoc[]

View File

@@ -21,47 +21,47 @@ Programs
The list below gives a short overview; see the respective documentation
for details.
linkman:pkgctl[1]
pkgctl(1)
Unified command-line frontend for devtools
linkman:archbuild[1]
archbuild(1)
Build an Arch Linux package inside a clean chroot
linkman:arch-nspawn[1]
arch-nspawn(1)
Run a command or OS in a light-weight namespace container
linkman:checkpkg[1]
checkpkg(1)
Compare the current build package with the repository version
linkman:diffpkg[1]
diffpkg(1)
Compare package files using different modes
linkman:export-pkgbuild-keys[1]
export-pkgbuild-keys(1)
Export valid source signing keys from a PKGBUILD
linkman:find-libdeps[1]
find-libdeps(1)
Find soname dependencies for a package
linkman:find-libprovides[1]
find-libprovides(1)
Find soname's which are provided by a package
linkman:lddd[1]
lddd(1)
Find broken library links on your system
linkman:mkarchroot[1]
mkarchroot(1)
Creates an arch chroot in a specified location with a specified set of
packages
linkman:makechrootpkg[1]
makechrootpkg(1)
Build a PKGBUILD in a given chroot environment
linkman:makerepropkg[1]
makerepropkg(1)
Rebuild a package to see if it is reproducible
linkman:offload-build[1]
offload-build(1)
Build a PKGBUILD on a remote server using makechrootpkg
linkman:sogrep[1]
sogrep(1)
Find packages using a linked to a given shared library
include::include/footer.asciidoc[]

View File

@@ -20,6 +20,6 @@ collected data is written to a temporary directory created by mktemp.
See Also
--------
linkman:ldd[1]
ldd(1)
include::include/footer.asciidoc[]

View File

@@ -45,6 +45,9 @@ Options
*-D* <dir>::
Bind directory into build chroot as read-only
*-t* <dir>[:opts]::
Mount a tmpfs at 'dir'. See the '--tmpfs' argument in systemd-nspawn(1) for more details.
*-u*::
Update the working copy of the chroot before building
This is useful for rebuilds without dirtying the pristine
@@ -76,5 +79,9 @@ Options
*-x* <when>::
Inspect chroot after build, possible modes are 'never' (default), 'always' or 'failure'
See Also
--------
systemd-nspawn(1)
include::include/footer.asciidoc[]

View File

@@ -16,7 +16,7 @@ Given the path to a built pacman package(s), attempt to rebuild it using the
PKGBUILD in the current directory. The package will be built in an environment
as closely matching the environment of the initial package as possible, by
building up a chroot to match the information exposed in the package's
linkman:BUILDINFO[5] manifest. On success, the resulting package will be
BUILDINFO(5) manifest. On success, the resulting package will be
compared to the input package, and makerepropkg will report whether the
artifacts are identical.

View File

@@ -32,8 +32,9 @@ Options
*-c* <dir>::
Set pacman cache.
*-f* <file>::
*-f* <src>[:<dst>]::
Copy file from the host to the chroot.
If 'dst' is not provided, it defaults to 'src' inside of the chroot.
*-s*::
Do not run setarch.
@@ -44,6 +45,6 @@ Options
See Also
--------
linkman:pacman[1]
pacman(1)
include::include/footer.asciidoc[]

View File

@@ -36,6 +36,6 @@ Options
See Also
--------
linkman:pkgctl-db-remove[1]
pkgctl-db-remove(1)
include::include/footer.asciidoc[]

View File

@@ -32,6 +32,6 @@ pkgctl aur drop-from-repo::
See Also
--------
linkman:pkgctl-aur-drop-from-repo[1]
pkgctl-aur-drop-from-repo(1)
include::include/footer.asciidoc[]

View File

@@ -35,6 +35,6 @@ Options
See Also
--------
linkman:pkgctl-auth-status[1]
pkgctl-auth-status(1)
include::include/footer.asciidoc[]

View File

@@ -27,6 +27,6 @@ Options
See Also
--------
linkman:pkgctl-auth-login[1]
pkgctl-auth-login(1)
include::include/footer.asciidoc[]

View File

@@ -32,7 +32,7 @@ pkgctl auth status::
See Also
--------
linkman:pkgctl-auth-login[1]
linkman:pkgctl-auth-status[1]
pkgctl-auth-login(1)
pkgctl-auth-status(1)
include::include/footer.asciidoc[]

View File

@@ -12,7 +12,10 @@ pkgctl build [OPTIONS] [PATH...]
Description
-----------
TODO
Build packages in clean chroot environment, offering various options
and functionalities to customize the package building process.
By default, chroot environments are located in '/var/lib/archbuild/'.
Build Options
-------------
@@ -107,7 +110,7 @@ Options
See Also
--------
linkman:pkgctl-release[1]
linkman:pkgctl-db-update[1]
pkgctl-release(1)
pkgctl-db-update(1)
include::include/footer.asciidoc[]

View File

@@ -12,13 +12,27 @@ pkgctl db remove [OPTIONS] [REPO] [PKGBASE]...
Description
-----------
Remove packages from pacman repositories.
Remove packages from pacman repositories. By default passing a pkgbase removes
all split packages, debug packages as well as entries from the state repo for
all existing architectures.
Beware when using the `--partial` option, as it may most likely lead to
undesired effects by leaving debug packages behind as well as dangling entries
in the state repository.
Options
-------
*--partial*::
Remove only partial pkgnames from a split package. This leaves debug
packages behind and pkgbase entries in the state repo.
*-a, --arch* 'ARCH'::
Override the architecture (disables auto-detection)
Remove only one specific architecture (disables auto-detection).
By default all architectures are removed when this option is not used.
*--noconfirm*::
Bypass any confirmation messages, should only be used with caution.
*-h, --help*::
Show a help text

View File

@@ -1,5 +1,5 @@
pkgctl-db-update(1)
=================
===================
Name
----

View File

@@ -0,0 +1,43 @@
pkgctl-db(1)
============
NAME
----
pkgctl-db - Pacman database modification utility for package updates, moves, and more.
SYNOPSIS
--------
pkgctl db [OPTIONS] [SUBCOMMAND]
DESCRIPTION
-----------
Managing the Pacman database and facilitate the modification of packages and their metadata
within the database
OPTIONS
-------
*-h, --help*::
Display usage information and available options.
Subcommands
-----------
pkgctl db update::
Update the binary repository as final release step
pkgctl db move::
Move packages between binary repositories
pkgctl db remove::
Remove packages from binary repositories
SEE ALSO
--------
pkgctl-db-update(1)
pkgctl-db-move(1)
pkgctl-db-remove(1)
include::include/footer.asciidoc[]

View File

@@ -46,6 +46,6 @@ Options
See Also
--------
linkman:pkgctl-db-update[1]
pkgctl-db-update(1)
include::include/footer.asciidoc[]

View File

@@ -0,0 +1,40 @@
pkgctl-repo-clean(1)
====================
Name
----
pkgctl-repo-clean - Remove untracked files from the working tree
Synopsis
--------
pkgctl repo clean [OPTION] [PATH]...
Description
-----------
Cleans the working tree by recursively removing files that are not under
version control, starting from the current directory.
Files unknown to Git as well as ignored files are removed. This can, for
example, be useful to remove all build products.
Options
-------
*-i, --interactive*::
Show what would be done and clean files interactively
*-n, --dry-run*::
Don't actually remove anything, just show what would be done
*-h, --help*::
Show a help text
See Also
--------
git-clean(1)
include::include/footer.asciidoc[]

View File

@@ -46,7 +46,7 @@ Options
See Also
--------
linkman:pkgctl-repo-configure[1]
linkman:pkgctl-repo-switch[1]
pkgctl-repo-configure(1)
pkgctl-repo-switch(1)
include::include/footer.asciidoc[]

View File

@@ -33,8 +33,8 @@ Options
See Also
--------
linkman:pkgctl-auth[1]
linkman:pkgctl-repo-clone[1]
linkman:pkgctl-repo-configure[1]
pkgctl-auth(1)
pkgctl-repo-clone(1)
pkgctl-repo-configure(1)
include::include/footer.asciidoc[]

View File

@@ -32,6 +32,9 @@ Options
Subcommands
-----------
pkgctl repo clean::
Remove untracked files from the working tree
pkgctl repo clone::
Clone a package repository
@@ -50,10 +53,11 @@ pkgctl repo web::
See Also
--------
linkman:pkgctl-repo-clone[1]
linkman:pkgctl-repo-configure[1]
linkman:pkgctl-repo-create[1]
linkman:pkgctl-repo-switch[1]
linkman:pkgctl-repo-web[1]
pkgctl-repo-clean(1)
pkgctl-repo-clone(1)
pkgctl-repo-configure(1)
pkgctl-repo-create(1)
pkgctl-repo-switch(1)
pkgctl-repo-web(1)
include::include/footer.asciidoc[]

View File

@@ -66,6 +66,6 @@ Output Options
See Also
--------
linkman:pkgctl-auth[1]
pkgctl-auth(1)
include::include/footer.asciidoc[]

View File

@@ -28,8 +28,8 @@ required to track version changes from upstream sources.
Configuration
-------------
Uses linkman:nvchecker[1] and a `.nvchecker.toml` file located alongside the
PKGBUILD. Refer to the configuration section in linkman:pkgctl-version[1].
Uses nvchecker(1) and a `.nvchecker.toml` file located alongside the
PKGBUILD. Refer to the configuration section in pkgctl-version(1).
Options
-------
@@ -60,7 +60,7 @@ On exit, return one of the following codes:
See Also
--------
linkman:pkgctl-version[1]
linkman:nvchecker[1]
pkgctl-version(1)
nvchecker(1)
include::include/footer.asciidoc[]

View File

@@ -0,0 +1,120 @@
pkgctl-version-setup(1)
=======================
Name
----
pkgctl-version-setup - Automatically detect and setup a basic nvchecker config
Synopsis
--------
pkgctl version setup [OPTIONS] [PKGBASE...]
Description
-----------
This subcommand automates the creation of a basic nvchecker(1) configuration
file by analyzing the source array specified in the PKGBUILD(1) file of a
package. This command intelligently detects various platforms and APIs (e.g.,
GitHub, GitLab, PyPI) used by the package sources and generates a corresponding
`.nvchecker.toml` configuration based on its best guess.
This is particularly useful for initializing nvchecker(1) settings for a
package without manually crafting the `.nvchecker.toml` file. It simplifies the
process of setting up version checks, especially when transitioning a package's
monitoring from one source platform to another or starting version checks for a
new package.
If no `PKGBASE` is specified, the command defaults to using the current working
directory.
To obtain a list of supported sources and their expected URL formats, please
consult the sources section.
Options
-------
*-f, --force*::
Overwrite existing nvchecker(1) configuration
*--prefer-platform-api*::
Prefer platform specific GitHub/GitLab API over git for complex cases
*--url* 'URL'::
Derive check target from the given URL instead of the source array entries
*--no-check*::
Do not run pkgctl-version-check(1) after setup
*-h, --help*::
Show a help text
Sources
-------
Here are the currently supported platforms and sources, along with examples of
URL formats that enable their automatic detection as specific source types:
*Git*::
* https://github.com/example/project
* https://gitlab.com/example/group/project
* git://git.foobar.org/example
* git+https://git.foobar.org/example
*GitHub*::
* https://github.com/example/project
* https://github.com/example/project/archive/v1.0/project-v1.0.tar.gz
*GitLab*::
* https://gitlab.com/example/group/project
* https://gitlab.archlinux.org/archlinux/devtools.git
* https://gitlab.archlinux.org/archlinux/devtools/-/releases/v1.1.0/downloads/devtools-v1.1.0.tar.gz
*Hackage*::
* https://hackage.haskell.org/package/xmonad
* https://hackage.haskell.org/package/xmonad-0.18.0/xmonad-0.18.0.tar.gz
* https://hackage.haskell.org/packages/archive/xmonad/0.18.0/xmonad-0.18.0.tar.gz
*NPM*::
* https://registry.npmjs.org/node-gyp/-/node-gyp-10.0.1.tgz
* https://www.npmjs.com/package/node-gyp
*PyPI*::
* https://pypi.io/packages/source/p/pyflakes
* https://pypi.org/packages/source/b/bleach
* https://files.pythonhosted.org/packages/source/p/pyflakes
* https://pypi.org/project/SQLAlchemy/
*RubyGems*::
* https://rubygems.org/downloads/diff-lcs-1.5.1.gem
* https://rubygems.org/gems/diff-lcs
*CPAN*::
* https://search.cpan.org/CPAN/authors/id/C/CO/COSIMO/Locale-PO-0.27.tar.gz
* https://cpan.metacpan.org/authors/id/C/CO/COSIMO/Locale-PO-0.27.tar.gz
*crates.io*::
* https://static.crates.io/crates/shotgun/shotgun-1.0.crate
* https://crates.io/api/v1/crates/shotgun/1.0/download
* https://crates.io/crates/git-smash
Examples
--------
*pkgctl version setup*::
Detects the source from the current directory's PKGBUILD(1) and
sets up a basic `.nvchecker.toml`.
*pkgctl version setup --url https://github.com/example/project*::
Generates an `.nvchecker.toml` for the current PKGBUILD(1) but
overrides the source URL with the specified GitHub project.
See Also
--------
pkgctl-version(1)
pkgctl-version-check(1)
nvchecker(1)
PKGBUILD(5)
include::include/footer.asciidoc[]

View File

@@ -18,7 +18,7 @@ upstream versions.
Upon execution, it automatically adjusts the PKGBUILD file, ensuring that the
pkgver field is set to match the latest version available from the upstream
source. In addition to updating the pkgver, this command also resets the pkgrel
to 1.
to 1 and updates checksums.
Outputs a summary of upgraded packages, up-to-date packages, and any check
failures.
@@ -29,12 +29,15 @@ required to track and implement version changes from upstream sources.
Configuration
-------------
Uses linkman:nvchecker[1] and a `.nvchecker.toml` file located alongside the
PKGBUILD. Refer to the configuration section in linkman:pkgctl-version[1].
Uses nvchecker(1) and a `.nvchecker.toml` file located alongside the
PKGBUILD. Refer to the configuration section in pkgctl-version(1).
Options
-------
*--no-update-checksums*::
Disable computation and update of the checksums
*-v, --verbose*::
Display results including up-to-date versions
@@ -44,7 +47,7 @@ Options
See Also
--------
linkman:pkgctl-version[1]
linkman:nvchecker[1]
pkgctl-version(1)
nvchecker(1)
include::include/footer.asciidoc[]

View File

@@ -15,7 +15,7 @@ Description
Commands related to package versions, including checks for outdated packages.
Uses linkman:nvchecker[1] and a `.nvchecker.toml` file located alongside the
Uses nvchecker(1) and a `.nvchecker.toml` file located alongside the
PKGBUILD.
Configuration
@@ -26,9 +26,12 @@ package's pkgbase. The pkgbase section within the `.nvchecker.toml` file
specifies the source and method for checking the latest version of the
corresponding package.
Use pkgctl-version-setup(1) to automatically detect and setup a basic nvchecker
config based on the source array of the package PKGBUILD.
For detailed information on the various configuration options available for the
`.nvchecker.toml` file, refer to the configuration files section in
linkman:nvchecker[1]. This documentation provides insights into the possible
nvchecker(1). This documentation provides insights into the possible
options that can be utilized to customize the version checking process.
To supply GitHub or GitLab tokens to nvchecker, a `keyfile.toml` should be
@@ -48,13 +51,17 @@ Subcommands
pkgctl version check::
Compares local package versions against upstream
pkgctl version setup::
Automatically detect and setup a basic nvchecker config
pkgctl version upgrade::
Adjust the PKGBUILD to match the latest upstream version
See Also
--------
linkman:pkgctl-version-check[1]
linkman:pkgctl-version-upgrade[1]
pkgctl-version-check(1)
pkgctl-version-setup(1)
pkgctl-version-upgrade(1)
include::include/footer.asciidoc[]

View File

@@ -12,7 +12,12 @@ pkgctl [SUBCOMMAND] [OPTIONS]
Description
-----------
TODO
Command-line utility serving as a unified interface for multiple development tools.
This tool aims to simplify and optimize interactions with devtools by offering
various subcommands for executing tasks related to package management, repository management,
version control, among others.
Utilizing pkgctl enables users to efficiently administer their development workflows.
Options
-------
@@ -56,14 +61,14 @@ pkgctl version::
See Also
--------
linkman:pkgctl-aur[1]
linkman:pkgctl-auth[1]
linkman:pkgctl-build[1]
linkman:pkgctl-db[1]
linkman:pkgctl-diff[1]
linkman:pkgctl-release[1]
linkman:pkgctl-repo[1]
linkman:pkgctl-search[1]
linkman:pkgctl-version[1]
pkgctl-aur(1)
pkgctl-auth(1)
pkgctl-build(1)
pkgctl-db(1)
pkgctl-diff(1)
pkgctl-release(1)
pkgctl-repo(1)
pkgctl-search(1)
pkgctl-version(1)
include::include/footer.asciidoc[]

View File

@@ -22,12 +22,13 @@ usage() {
echo "A wrapper around systemd-nspawn. Provides support for pacman."
echo
echo ' options:'
echo ' -C <file> Location of a pacman config file'
echo ' -M <file> Location of a makepkg config file'
echo ' -c <dir> Set pacman cache'
echo ' -f <file> Copy file from the host to the chroot'
echo ' -s Do not run setarch'
echo ' -h This message'
echo ' -C <file> Location of a pacman config file'
echo ' -M <file> Location of a makepkg config file'
echo ' -c <dir> Set pacman cache'
echo ' -f <src>[:<dst>] Copy src file from the host to the chroot.'
echo ' If dst file is not provided, it defaults to src'
echo ' -s Do not run setarch'
echo ' -h This message'
exit 1
}
@@ -63,6 +64,7 @@ nspawn_args=(
--slice="devtools-$(systemd-escape "${SUDO_USER:-$USER}")"
--machine="arch-nspawn-$$"
--as-pid2
--console=autopipe
)
if (( ${#cache_dirs[@]} == 0 )); then
@@ -71,6 +73,7 @@ fi
# shellcheck disable=2016
host_mirrors=($(pacman-conf --repo extra Server 2> /dev/null | sed -r 's#(.*/)extra/os/.*#\1$repo/os/$arch#'))
host_cachemirrors=($(pacman-conf --repo extra CacheServer 2> /dev/null | sed -r 's#(.*/)extra/os/.*#\1$repo/os/$arch#'))
for host_mirror in "${host_mirrors[@]}"; do
if [[ $host_mirror == *file://* ]]; then
@@ -105,13 +108,17 @@ copy_hostconf () {
printf 'Server = %s\n' "${host_mirrors[@]}" >"$working_dir/etc/pacman.d/mirrorlist"
[[ -n $host_cachemirrors ]] && printf 'CacheServer = %s\n' "${host_cachemirrors[@]}" >>"$working_dir/etc/pacman.d/mirrorlist"
[[ -n $pac_conf ]] && cp "$pac_conf" "$working_dir/etc/pacman.conf"
[[ -n $makepkg_conf ]] && cp "$makepkg_conf" "$working_dir/etc/makepkg.conf"
local file
for file in "${files[@]}"; do
mkdir -p "$(dirname "$working_dir$file")"
cp -T "$file" "$working_dir$file"
src="${file%%:*}"
dst="${file#*:}"
mkdir -p "$(dirname "$working_dir$dst")"
cp -T "$src" "$working_dir$dst"
done
sed -r "s|^#?\\s*CacheDir.+|CacheDir = ${cache_dirs[*]}|g" -i "$working_dir/etc/pacman.conf"

View File

@@ -140,7 +140,7 @@ for _pkgname in "${pkgname[@]}"; do
bsdtar tf "$TEMPDIR/$oldpkg" | sort > "$TEMPDIR/filelist-$_pkgname-old"
bsdtar tf "$pkgfile" | sort > "$TEMPDIR/filelist-$_pkgname"
sdiff -s "$TEMPDIR/filelist-$_pkgname-old" "$TEMPDIR/filelist-$_pkgname"
diff --side-by-side --suppress-common-lines --width="$COLUMNS" --color=auto "$TEMPDIR/filelist-$_pkgname-old" "$TEMPDIR/filelist-$_pkgname"
find-libprovides "$TEMPDIR/$oldpkg" 2>/dev/null | sort > "$TEMPDIR/libraries-$_pkgname-old"
find-libprovides "$pkgfile" 2>/dev/null | sort > "$TEMPDIR/libraries-$_pkgname"

View File

@@ -151,7 +151,7 @@ fi
server=${PACKAGING_REPO_RELEASE_HOST}
rsyncopts=(-e ssh -p '--chmod=ug=rw,o=r' -c -h -L --progress --partial -y)
rsyncopts=("${RSYNC_OPTS[@]}" --perms --chmod='ug=rw,o=r')
archreleaseopts=()
while getopts ':l:a:s:f' flag; do
case $flag in

View File

@@ -92,14 +92,19 @@ pkgctl_aur_drop_from_repo() {
fi
for path in "${paths[@]}"; do
if ! realpath=$(realpath -e "${path}"); then
# resolve symlink for basename
if ! realpath=$(realpath --canonicalize-existing -- "${path}"); then
die "No such directory: ${path}"
fi
# skip paths that are not directories
if [[ ! -d "${realpath}" ]]; then
continue
fi
pkgbase=$(basename "${realpath}")
pkgbase=${pkgbase%.git}
if [[ ! -d "${path}/.git" ]]; then
if [[ ! -d "${realpath}/.git" ]]; then
die "Not a Git repository: ${path}"
fi
@@ -120,7 +125,6 @@ pkgctl_aur_drop_from_repo() {
if [[ $(git symbolic-ref --quiet --short HEAD) == main ]]; then
git branch --move master
git config branch.master.merge refs/heads/master
git remote set-head origin master
fi
# auto generate .SRCINFO if not already present
@@ -137,11 +141,14 @@ pkgctl_aur_drop_from_repo() {
if (( FORCE )); then
AUR_OVERWRITE=1 \
GIT_SSH_COMMAND="ssh -o SendEnv=AUR_OVERWRITE" \
git push --force origin master
git push --force --no-follow-tags origin master
else
git push origin master
git push --no-follow-tags origin master
fi
# update the local default branch in case this clone is used in the future
git remote set-head origin master
if (( DISOWN )); then
msg "Disowning ${pkgbase} on the AUR"
# shellcheck disable=SC2029
@@ -158,7 +165,7 @@ pkgctl_aur_drop_from_repo() {
warning 'Did not find %s in any repository, please delete manually' "${pkgbase}"
else
msg2 " repo: ${pkgrepo}"
pkgctl_db_remove "${pkgrepo}" "${pkgbase}"
pkgctl_db_remove --noconfirm "${pkgrepo}" "${pkgbase}"
fi
popd >/dev/null

View File

@@ -63,7 +63,7 @@ pkgctl_auth_login() {
esac
done
personal_access_token_url="https://${GITLAB_HOST}/-/profile/personal_access_tokens?name=pkgctl+token&scopes=api,write_repository"
personal_access_token_url="https://${GITLAB_HOST}/-/user_settings/personal_access_tokens?name=pkgctl+token&scopes=api,write_repository"
cat <<- _EOF_
Logging into ${BOLD}${GITLAB_HOST}${ALL_OFF}

View File

@@ -79,8 +79,8 @@ pkgctl_build_usage() {
EXAMPLES
$ ${COMMAND}
$ ${COMMAND} --rebuild --staging --message 'libyay 0.42 rebuild' libfoo libbar
$ ${COMMAND} --pkgver 1.42 --release --db-update
$ ${COMMAND} --rebuild --staging --release --message 'libyay 0.42 rebuild' libfoo libbar
$ ${COMMAND} --pkgver=1.42 --release --db-update
_EOF_
}
@@ -312,13 +312,17 @@ pkgctl_build() {
# Update pacman cache for auto-detection
if [[ -z ${REPO} ]]; then
update_pacman_repo_cache
update_pacman_repo_cache multilib
# Check valid repos if not resolved dynamically
elif ! in_array "${REPO}" "${DEVTOOLS_VALID_REPOS[@]}"; then
die "Invalid repository target: %s" "${REPO}"
fi
for path in "${paths[@]}"; do
# skip paths that are not directories
if [[ ! -d "${path}" ]]; then
continue
fi
pushd "${path}" >/dev/null
if [[ ! -f PKGBUILD ]]; then
@@ -433,10 +437,11 @@ pkgctl_build() {
stat_done
fi
# update checksums if any sources are declared
if (( UPDATE_CHECKSUMS )) && (( ${#source[@]} >= 1 )); then
updpkgsums
if ! result=$(pkgbuild_update_checksums /dev/stderr); then
die "${result}"
fi
fi
# re-source the PKGBUILD if it changed

View File

@@ -15,6 +15,9 @@ $DEVTOOLS_INCLUDE_COMMON_SH
# Avoid any encoding problems
export LANG=C.UTF-8
# Avoid systemd trying to color the terminal on systemd-nspawn
export SYSTEMD_TINT_BACKGROUND=no
# Set buildtool properties
export BUILDTOOL=devtools
export BUILDTOOLVER=@buildtoolver@
@@ -31,6 +34,17 @@ export PACKAGING_REPO_RELEASE_HOST=repos.archlinux.org
export PKGBASE_MAINTAINER_URL=https://archlinux.org/packages/pkgbase-maintainer
export AUR_URL_SSH=aur@aur.archlinux.org
export RSYNC_OPTS=(
--rsh=ssh
--checksum
--copy-links
--human-readable
--progress
--partial
--partial-dir=.partial
--delay-updates
)
# ensure TERM is set with a fallback to dumb
export TERM=${TERM:-dumb}
@@ -106,6 +120,8 @@ print_workdir_error() {
}
_setup_workdir=false
# Ensure that there is no outside value for WORKDIR leaking in
unset WORKDIR
setup_workdir() {
[[ -z ${WORKDIR:-} ]] && WORKDIR=$(mktemp -d --tmpdir "${0##*/}.XXXXXXXXXX")
_setup_workdir=true
@@ -342,3 +358,17 @@ is_debug_package() {
pkgdesc="$(getpkgdesc "${pkgfile}")"
[[ ${pkgdesc} == "Detached debugging symbols for "* && ${pkgbase}-debug = "${pkgname}" ]]
}
# Proxy function to check if a file exists. Using [[ -f ... ]] directly is not
# always wanted because we might want to expand bash globs first. This way we
# can pass unquoted globs to is_globfile() and have them expanded as function
# arguments before being checked.
is_globfile() {
[[ -f $1 ]]
}
join_by() {
local IFS="$1"
shift
echo "$*"
}

View File

@@ -8,6 +8,12 @@ DEVTOOLS_INCLUDE_DB_REMOVE_SH=1
_DEVTOOLS_LIBRARY_DIR=${_DEVTOOLS_LIBRARY_DIR:-@pkgdatadir@}
# shellcheck source=src/lib/common.sh
source "${_DEVTOOLS_LIBRARY_DIR}"/lib/common.sh
# shellcheck source=src/lib/util/pacman.sh
source "${_DEVTOOLS_LIBRARY_DIR}"/lib/util/pacman.sh
# shellcheck source=src/lib/util/term.sh
source "${_DEVTOOLS_LIBRARY_DIR}"/lib/util/term.sh
# shellcheck source=src/lib/valid-repos.sh
source "${_DEVTOOLS_LIBRARY_DIR}"/lib/valid-repos.sh
set -e
@@ -17,10 +23,19 @@ pkgctl_db_remove_usage() {
cat <<- _EOF_
Usage: ${COMMAND} [OPTIONS] [REPO] [PKGBASE]...
Remove packages from binary repositories.
Remove packages from pacman repositories. By default passing a pkgbase removes
all split packages, debug packages as well as entries from the state repo for
all existing architectures.
Beware when using the --partial option, as it may most likely lead to
undesired effects by leaving debug packages behind as well as dangling entries
in the state repository.
OPTIONS
-a, --arch Override the architecture (disables auto-detection)
-a, --arch Remove only one specific architecture (disables auto-detection)
--partial Remove only partial pkgnames from a split package. This leaves
debug packages behind and pkgbase entries in the state repo.
--noconfirm Bypass any confirmation messages, should only be used with caution
-h, --help Show this help text
EXAMPLES
@@ -31,8 +46,13 @@ _EOF_
pkgctl_db_remove() {
local REPO=""
local ARCH=any
local PKGBASES=()
local pkgnames=()
local partial=0
local confirm=1
local dbscripts_options=()
local lookup_repo=multilib
local pkgname
# option checking
while (( $# )); do
@@ -41,11 +61,20 @@ pkgctl_db_remove() {
pkgctl_db_remove_usage
exit 0
;;
--partial)
partial=1
dbscripts_options+=(--partial)
shift
;;
-a|--arch)
(( $# <= 1 )) && die "missing argument for %s" "$1"
ARCH=$2
dbscripts_options+=(--arch "$2")
shift 2
;;
--noconfirm)
confirm=0
shift
;;
-*)
die "invalid argument: %s" "$1"
;;
@@ -63,7 +92,62 @@ pkgctl_db_remove() {
REPO=$1
shift
PKGBASES+=("$@")
pkgnames=("${PKGBASES[@]}")
# check if the target repo is valid
if ! in_array "${REPO}" "${DEVTOOLS_VALID_REPOS[@]}"; then
die "Invalid repository target: %s" "${REPO}"
fi
# update pacman cache to query all pkgnames
if (( ! partial )); then
case ${REPO} in
*-unstable)
update_pacman_repo_cache unstable
;;
*-staging)
update_pacman_repo_cache multilib-staging
;;
*-testing)
update_pacman_repo_cache multilib-testing
;;
*)
update_pacman_repo_cache multilib
;;
esac
# fetch the pkgnames of all pkgbase as present in the repo
mapfile -t pkgnames < <(get_pkgnames_from_repo_pkgbase "${REPO}" "${PKGBASES[@]}")
echo
if (( ! ${#pkgnames[@]} )); then
error "Packages not found in %s" "${REPO}"
exit 1
fi
fi
# print list of packages
printf "%sRemoving packages from %s:%s\n" "${RED}" "${REPO}" "${ALL_OFF}"
for pkgname in "${pkgnames[@]}"; do
printf "• %s\n" "${pkgname}"
done
# print explenation about partial removal
if (( partial )); then
echo
msg_warn "${YELLOW}Removing only partial pkgnames from a split package.${ALL_OFF}"
msg_warn "${YELLOW}This leaves debug packages and pkgbase entries in the state repo!${ALL_OFF}"
fi
# ask for confirmation
if (( confirm )); then
echo
if ! prompt "${GREEN}${BOLD}?${ALL_OFF} Are you sure this is correct?"; then
exit 1
fi
fi
echo
# shellcheck disable=SC2029
ssh "${PACKAGING_REPO_RELEASE_HOST}" db-remove "${REPO}" "${ARCH}" "${PKGBASES[@]}"
ssh "${PACKAGING_REPO_RELEASE_HOST}" db-remove "${dbscripts_options[@]}" "${REPO}" "${PKGBASES[@]}"
}

View File

@@ -124,7 +124,7 @@ pkgctl_release() {
# Update pacman cache for auto-detection
if [[ -z ${REPO} ]]; then
update_pacman_repo_cache
update_pacman_repo_cache multilib
# Check valid repos if not resolved dynamically
elif ! in_array "${REPO}" "${DEVTOOLS_VALID_REPOS[@]}"; then
die "Invalid repository target: %s" "${REPO}"

View File

@@ -27,6 +27,7 @@ pkgctl_repo_usage() {
without SSH access using read-only HTTPS.
COMMANDS
clean Remove untracked files from the working tree
clone Clone a package repository
configure Configure a clone according to distro specs
create Create a new GitLab package repository
@@ -37,6 +38,7 @@ pkgctl_repo_usage() {
-h, --help Show this help text
EXAMPLES
$ ${COMMAND} clean --interactive *
$ ${COMMAND} clone libfoo linux libbar
$ ${COMMAND} clone --maintainer mynickname
$ ${COMMAND} configure *
@@ -59,6 +61,14 @@ pkgctl_repo() {
pkgctl_repo_usage
exit 0
;;
clean)
_DEVTOOLS_COMMAND+=" $1"
shift
# shellcheck source=src/lib/repo/clean.sh
source "${_DEVTOOLS_LIBRARY_DIR}"/lib/repo/clean.sh
pkgctl_repo_clean "$@"
exit 0
;;
clone)
_DEVTOOLS_COMMAND+=" $1"
shift

114
src/lib/repo/clean.sh Normal file
View File

@@ -0,0 +1,114 @@
#!/bin/bash
#
# SPDX-License-Identifier: GPL-3.0-or-later
[[ -z ${DEVTOOLS_INCLUDE_REPO_CLEAN_SH:-} ]] || return 0
DEVTOOLS_INCLUDE_REPO_CLEAN_SH=1
_DEVTOOLS_LIBRARY_DIR=${_DEVTOOLS_LIBRARY_DIR:-@pkgdatadir@}
# shellcheck source=src/lib/common.sh
source "${_DEVTOOLS_LIBRARY_DIR}"/lib/common.sh
source /usr/share/makepkg/util/message.sh
set -eo pipefail
pkgctl_repo_clean_usage() {
local -r COMMAND=${_DEVTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
cat <<- _EOF_
Usage: ${COMMAND} [OPTION] [PATH]...
Cleans the working tree by recursively removing files that are not under
version control, starting from the current directory.
Files unknown to Git as well as ignored files are removed. This can, for
example, be useful to remove all build products.
OPTIONS
-i, --interactive Show what would be done and clean files interactively
-n, --dry-run Don't remove anything, just show what would be done
-h, --help Show this help text
EXAMPLES
$ ${COMMAND} libfoo linux libbar
$ ${COMMAND} --interactive libfoo linux libbar
$ ${COMMAND} --dry-run *
_EOF_
}
pkgctl_repo_clean() {
# options
local git_clean_options=()
local paths
local path pkgbase
while (( $# )); do
case $1 in
-i|--interactive)
git_clean_options+=("$1")
shift
;;
-n|--dry-run)
git_clean_options+=("$1")
shift
;;
-h|--help)
pkgctl_repo_clean_usage
exit 0
;;
--)
shift
break
;;
-*)
die "invalid argument: %s" "$1"
;;
*)
paths=("$@")
break
;;
esac
done
# check if invoked without any path from within a packaging repo
if (( ${#paths[@]} == 0 )); then
paths=(".")
fi
# print message about the work chunk
printf "🗑️ Removing untracked files from %s working trees\n" "${BOLD}${#paths[@]}${ALL_OFF}"
for path in "${paths[@]}"; do
# skip paths that are not directories
if [[ ! -d "${path}" ]]; then
continue
fi
if [[ ! -f "${path}/PKGBUILD" ]]; then
msg_error "Not a package repository: ${path}"
continue
fi
if [[ ! -d "${path}/.git" ]]; then
msg_error "Not a Git repository: ${path}"
continue
fi
pkgbase=$(basename "$(realpath "${path}")")
pkgbase=${pkgbase%.git}
# run dry mode to see if git would clean any files
if [[ ! $(git -C "${path}" clean -x -d --dry-run 2>&1) ]]; then
continue
fi
# git clean untracked files
msg_success "Cleaning ${BOLD}${pkgbase}${ALL_OFF}"
if ! git -C "${path}" clean -x -d --force "${git_clean_options[@]}"; then
msg_error "Failed to remove untracked files"
fi
echo
done
}

View File

@@ -207,9 +207,14 @@ pkgctl_repo_configure() {
fi
for path in "${paths[@]}"; do
if ! realpath=$(realpath -e "${path}"); then
# resolve symlink for basename
if ! realpath=$(realpath --canonicalize-existing -- "${path}"); then
die "No such directory: ${path}"
fi
# skip paths that aren't directories
if [[ ! -d "${realpath}" ]]; then
continue
fi
pkgbase=$(basename "${realpath}")
pkgbase=${pkgbase%.git}
@@ -266,6 +271,7 @@ pkgctl_repo_configure() {
if [[ -n $GPGKEY ]]; then
git config commit.gpgsign true
git config user.signingKey "${GPGKEY}"
git config gpg.format openpgp
fi
# set default git exclude

View File

@@ -101,16 +101,21 @@ pkgctl_repo_switch() {
fi
for path in "${paths[@]}"; do
if ! realpath=$(realpath -e -- "${path}"); then
# resolve symlink for basename
if ! realpath=$(realpath --canonicalize-existing -- "${path}"); then
die "No such directory: ${path}"
fi
pkgbase=$(basename "${realpath}")
if [[ ! -d "${path}/.git" ]]; then
# skip paths that are not directories
if [[ ! -d "${realpath}" ]]; then
continue
fi
# skip paths that are not git repositories
if [[ ! -d "${realpath}/.git" ]]; then
error "Not a Git repository: ${path}"
continue
fi
pkgbase=$(basename "${realpath}")
if ! git -C "${path}" checkout "${GIT_CHECKOUT_OPTIONS[@]}" "${GIT_REF}"; then
die "Failed to switch ${pkgbase} to version ${VERSION}"
fi

View File

@@ -22,9 +22,11 @@ makepkg_source_package() {
return
fi
(
# shellcheck disable=SC2030 disable=SC2031
export LIBMAKEPKG_LINT_PKGBUILD_SH=1
lint_pkgbuild() { :; }
# shellcheck disable=SC2030 disable=SC2031
export LIBMAKEPKG_SRCINFO_SH=1
write_srcinfo() { print_srcinfo; }
@@ -35,3 +37,21 @@ makepkg_source_package() {
source "$(command -v makepkg)"
)
}
makepkg_generate_integrity() {
if [[ -z ${DEVTOOLS_GENERATE_INTEGRITY} ]]; then
[[ -z ${WORKDIR:-} ]] && setup_workdir
export WORKDIR DEVTOOLS_INCLUDE_COMMON_SH
bash -$- -c "DEVTOOLS_GENERATE_INTEGRITY=1; source '${BASH_SOURCE[0]}' && ${FUNCNAME[0]}"
return
fi
(
# shellcheck disable=SC2030 disable=SC2031
export LIBMAKEPKG_LINT_PKGBUILD_SH=1
lint_pkgbuild() { :; }
set +e -- --geninteg
# shellcheck source=/usr/bin/makepkg
source "$(command -v makepkg)"
)
}

View File

@@ -18,10 +18,12 @@ readonly _DEVTOOLS_MAKEPKG_CONF_DIR=${_DEVTOOLS_LIBRARY_DIR}/makepkg.conf.d
update_pacman_repo_cache() {
local repo=${1:-multilib}
mkdir -p "${_DEVTOOLS_PACMAN_CACHE_DIR}"
msg "Updating pacman database cache"
lock 10 "${_DEVTOOLS_PACMAN_CACHE_DIR}.lock" "Locking pacman database cache"
fakeroot -- pacman --config "${_DEVTOOLS_PACMAN_CONF_DIR}/multilib.conf" \
fakeroot -- pacman --config "${_DEVTOOLS_PACMAN_CONF_DIR}/${repo}.conf" \
--dbpath "${_DEVTOOLS_PACMAN_CACHE_DIR}" \
-Sy
lock_close 10
@@ -29,6 +31,7 @@ update_pacman_repo_cache() {
get_pacman_repo_from_pkgbuild() {
local path=${1:-PKGBUILD}
local repo=${2:-multilib}
# shellcheck source=contrib/makepkg/PKGBUILD.proto
mapfile -t pkgnames < <(source "${path}"; printf "%s\n" "${pkgname[@]}")
@@ -40,12 +43,12 @@ get_pacman_repo_from_pkgbuild() {
# update the pacman repo cache if it doesn't exist yet
if [[ ! -d "${_DEVTOOLS_PACMAN_CACHE_DIR}" ]]; then
update_pacman_repo_cache
update_pacman_repo_cache "${repo}"
fi
slock 10 "${_DEVTOOLS_PACMAN_CACHE_DIR}.lock" "Locking pacman database cache"
# query repo of passed pkgname, specify --nodeps twice to skip all dependency checks
mapfile -t repos < <(pacman --config "${_DEVTOOLS_PACMAN_CONF_DIR}/multilib.conf" \
mapfile -t repos < <(pacman --config "${_DEVTOOLS_PACMAN_CONF_DIR}/${repo}.conf" \
--dbpath "${_DEVTOOLS_PACMAN_CACHE_DIR}" \
--sync \
--nodeps \
@@ -58,3 +61,30 @@ get_pacman_repo_from_pkgbuild() {
printf "%s" "${repos[0]}"
}
get_pkgnames_from_repo_pkgbase() {
local repo=$1
shift
local pkgbases=("$@")
# update the pacman repo cache if it doesn't exist yet
if [[ ! -d "${_DEVTOOLS_PACMAN_CACHE_DIR}" ]]; then
update_pacman_repo_cache universe
fi
slock 10 "${_DEVTOOLS_PACMAN_CACHE_DIR}.lock" "Locking pacman database cache"
# query pkgnames of passed pkgbase inside a repo
mapfile -t pkgnames < <(expac --config <(sed "s|#DBPath.*|DBPath = $(realpath "${_DEVTOOLS_PACMAN_CACHE_DIR}")|" < "${_DEVTOOLS_PACMAN_CONF_DIR}/universe.conf") \
--sync '%r %e %n' 2>/dev/null \
| sort | awk -v pkgbase="${pkgbases[*]}" \
'BEGIN { split(pkgbase, array); for (item in array) filter[array[item]]=1 } $1=="'"${repo}"'" && $2 in filter {print $3}'
)
lock_close 10
if (( ! ${#pkgnames[@]} )); then
return 1
fi
printf "%s\n" "${pkgnames[@]}"
return 0
}

View File

@@ -6,10 +6,13 @@
DEVTOOLS_INCLUDE_UTIL_PKGBUILD_SH=1
_DEVTOOLS_LIBRARY_DIR=${_DEVTOOLS_LIBRARY_DIR:-@pkgdatadir@}
# shellcheck source=src/lib/util/makepkg.sh
source "${_DEVTOOLS_LIBRARY_DIR}"/lib/util/makepkg.sh
source /usr/share/makepkg/util/message.sh
source /usr/share/makepkg/util/schema.sh
set -e
set -eo pipefail
# set the pkgver variable in a PKGBUILD
@@ -41,3 +44,48 @@ pkgbuild_set_pkgrel() {
sed --regexp-extended "s|^(pkgrel=)${pkgrel}$|\1${new_pkgrel}|g" --in-place PKGBUILD
}
pkgbuild_update_checksums() {
local status_file=$1
local builddir newbuildfile sumtypes newsums
[[ -z ${WORKDIR:-} ]] && setup_workdir
builddir=$(mktemp --tmpdir="${WORKDIR}" --directory update-checksums.XXXXXX)
newbuildfile="${builddir}/PKGBUILD"
# generate new integrity checksums
if ! newsums=$(BUILDDIR=${builddir} makepkg_generate_integrity 2>"${status_file}"); then
printf 'Failed to generate new checksums'
return 1
fi
# early exit if no integrity checksums are needed
if [[ -z ${newsums} ]]; then
return 0
fi
# replace the integrity sums and write it to a temporary file
sumtypes=$(IFS='|'; echo "${known_hash_algos[*]}")
if ! awk --assign=sumtypes="${sumtypes}" --assign=newsums="${newsums}" '
$0 ~"^[[:blank:]]*(" sumtypes ")sums(_[^=]+)?\\+?=", $0 ~ "\\)[[:blank:]]*(#.*)?$" {
if (!w) {
print newsums
w++
}
next
}
1
END { if (!w) print newsums }' PKGBUILD > "${newbuildfile}"; then
printf 'Failed to replace the generated checksums'
return 1
fi
# overwrite the original PKGBUILD while preserving permissions
if ! cat -- "${newbuildfile}" > PKGBUILD; then
printf "Failed to write to the PKGBUILD file"
return 1
fi
return 0
}

View File

@@ -180,3 +180,19 @@ term_spinner_stop() {
# show the cursor after stopping the spinner
term_cursor_show
}
prompt() {
local message=$1
local answer
read -r -p "${message} (y/N) " answer
case "${answer}" in
y|Y|yes|Yes|YES)
true
;;
*)
false
;;
esac
}

View File

@@ -4,8 +4,13 @@
:
# shellcheck disable=2034
DEVTOOLS_VALID_ARCHES=(
DEVTOOLS_VALID_BINARY_ARCHES=(
x86_64
)
# shellcheck disable=2034
DEVTOOLS_VALID_ARCHES=(
"${DEVTOOLS_VALID_BINARY_ARCHES[@]}"
any
)

View File

@@ -19,6 +19,7 @@ pkgctl_version_usage() {
COMMANDS
check Compares local package versions against upstream
setup Automatically detect and setup a basic nvchecker config
upgrade Adjust the PKGBUILD to match the latest upstream version
OPTIONS
@@ -26,6 +27,7 @@ pkgctl_version_usage() {
EXAMPLES
$ ${COMMAND} check libfoo linux libbar
$ ${COMMAND} setup libfoo
_EOF_
}
@@ -57,6 +59,14 @@ pkgctl_version() {
pkgctl_version_upgrade "$@"
exit $?
;;
setup)
_DEVTOOLS_COMMAND+=" $1"
shift
# shellcheck source=src/lib/version/setup.sh
source "${_DEVTOOLS_LIBRARY_DIR}"/lib/version/setup.sh
pkgctl_version_setup "$@"
exit 0
;;
*)
die "invalid argument: %s" "$1"
;;

View File

@@ -108,11 +108,11 @@ pkgctl_version_check() {
term_spinner_start "${status_dir}"
for path in "${pkgbases[@]}"; do
pushd "${path}" >/dev/null
if [[ ! -f "PKGBUILD" ]]; then
die "No PKGBUILD found for ${path}"
# skip paths that are not directories
if [[ ! -d "${path}" ]]; then
continue
fi
pushd "${path}" >/dev/null
# update the current terminal spinner status
(( ++current_item ))
@@ -124,6 +124,13 @@ pkgctl_version_check() {
"${current_item}" \
"${#pkgbases[@]}"
if [[ ! -f "PKGBUILD" ]]; then
result="${BOLD}${path}${ALL_OFF}: no PKGBUILD found"
failure+=("${result}")
popd >/dev/null
continue
fi
# reset common PKGBUILD variables
unset pkgbase pkgname arch source pkgver pkgrel validpgpkeys
# shellcheck source=contrib/makepkg/PKGBUILD.proto
@@ -219,8 +226,8 @@ get_upstream_version() {
opts+=(--keyfile "${keyfile}")
fi
if ! output=$(nvchecker --file "${config}" --logger json "${opts[@]}" 2>&1 | \
jq --raw-output 'select(.level != "debug")'); then
if ! output=$(GIT_TERMINAL_PROMPT=0 nvchecker --file "${config}" --logger json "${opts[@]}" 2>&1 | \
jq --raw-output 'select((.level != "debug") and (.event != "ignoring invalid version"))'); then
printf "failed to run nvchecker: %s" "${output}"
return 1
fi
@@ -260,13 +267,13 @@ nvchecker_check_config() {
done
# check if the config contains a pkgbase section
if [[ -n ${pkgbase} ]] && ! grep --max-count=1 --extended-regexp --quiet "^\\[\"?${pkgbase}\"?\\]" < "${config}"; then
if [[ -n ${pkgbase} ]] && ! grep --max-count=1 --extended-regexp --quiet "^\\[\"?${pkgbase//+/\\+}\"?\\]" < "${config}"; then
printf "missing pkgbase section in %s: %s" "${config}" "${pkgbase}"
return 1
fi
# check if the config contains any section other than pkgbase
if [[ -n ${pkgbase} ]] && property=$(grep --max-count=1 --perl-regexp "^\\[(?!\"?${pkgbase}\"?\\]).+\\]" < "${config}"); then
if [[ -n ${pkgbase} ]] && property=$(grep --max-count=1 --perl-regexp "^\\[(?!\"?${pkgbase//+/\\+}\"?\\]).+\\]" < "${config}"); then
printf "non-pkgbase section not supported in %s: %s" "${config}" "${property}"
return 1
fi
@@ -277,7 +284,7 @@ nvchecker_check_error() {
local errors
if ! errors=$(jq --raw-output --exit-status \
'select(.level == "error") | "\(.event)" + if .error then ": \(.error)" else "" end' \
'select((.level == "error") and (.error != null)) | "\(.event)" + if .error then ": \(.error)" else "" end' \
<<< "${result}"); then
return 0
fi

528
src/lib/version/setup.sh Normal file
View File

@@ -0,0 +1,528 @@
#!/bin/bash
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
[[ -z ${DEVTOOLS_INCLUDE_VERSION_SETUP_SH:-} ]] || return 0
DEVTOOLS_INCLUDE_VERSION_SETUP_SH=1
_DEVTOOLS_LIBRARY_DIR=${_DEVTOOLS_LIBRARY_DIR:-@pkgdatadir@}
# shellcheck source=src/lib/common.sh
source "${_DEVTOOLS_LIBRARY_DIR}"/lib/common.sh
# shellcheck source=src/lib/version/check.sh
source "${_DEVTOOLS_LIBRARY_DIR}"/lib/version/check.sh
source /usr/share/makepkg/util/message.sh
source /usr/share/makepkg/util/source.sh
set -eo pipefail
pkgctl_version_setup_usage() {
local -r COMMAND=${_DEVTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
cat <<- _EOF_
Usage: ${COMMAND} [OPTIONS] [PKGBASE]...
Automate the creation of a basic nvchecker configuration file by
analyzing the source array specified in the PKGBUILD file of a package.
If no PKGBASE is specified, the command defaults to using the current
working directory.
OPTIONS
-f, --force Overwrite existing nvchecker configuration
--prefer-platform-api Prefer platform specific GitHub/GitLab API for complex cases
--url URL Derive check target from URL instead of source array
--no-check Do not run version check after setup
-h, --help Show this help text
EXAMPLES
$ ${COMMAND} neovim vim
_EOF_
}
pkgctl_version_setup() {
local pkgbases=()
local override_url=
local run_check=1
local force=0
local prefer_platform_api=0
local path ret
local checks=()
while (( $# )); do
case $1 in
-h|--help)
pkgctl_version_setup_usage
exit 0
;;
-f|--force)
force=1
shift
;;
--prefer-platform-api)
prefer_platform_api=1
shift
;;
--url)
(( $# <= 1 )) && die "missing argument for %s" "$1"
override_url=$2
shift 2
;;
--no-check)
run_check=0
shift
;;
--)
shift
break
;;
-*)
die "invalid argument: %s" "$1"
;;
*)
pkgbases=("$@")
break
;;
esac
done
# Check if used without pkgbases in a packaging directory
if (( ${#pkgbases[@]} == 0 )); then
if [[ -f PKGBUILD ]]; then
pkgbases=(".")
else
pkgctl_version_setup_usage
exit 1
fi
fi
ret=0
for path in "${pkgbases[@]}"; do
# skip paths that are not directories
if [[ ! -d "${path}" ]]; then
continue
fi
pushd "${path}" >/dev/null
if nvchecker_setup "${path}" "${force}" "${prefer_platform_api}" "${override_url}"; then
checks+=("${path}")
else
ret=1
fi
popd >/dev/null
done
# run checks on the setup targets
if (( run_check )) && (( ${#checks[@]} >= 1 )); then
echo
pkgctl_version_check --verbose "${checks[@]}" || true
fi
return $ret
}
nvchecker_setup() {
local path=$1
local force=$2
local prefer_platform_api=$3
local override_url=$4
local pkgbase pkgname source source_url proto domain url_parts section body
if [[ ! -f PKGBUILD ]]; then
msg_error "${BOLD}${path}:${ALL_OFF} no PKGBUILD found"
return 1
fi
unset body pkgbase pkgname source url
# shellcheck source=contrib/makepkg/PKGBUILD.proto
if ! . ./PKGBUILD; then
msg_error "${BOLD}${path}:${ALL_OFF} failed to source PKGBUILD"
return 1
fi
pkgbase=${pkgbase:-$pkgname}
# try to guess from url as last try
if [[ -n ${url} ]]; then
source+=("${url}")
fi
# handle overwrite of existing config
if [[ -f .nvchecker.toml ]] && (( ! force )); then
msg_warn "${BOLD}${pkgbase}:${ALL_OFF} nvchecker already configured"
return 1
fi
# override the source array with a passed URL
if [[ -n ${override_url} ]]; then
source=("${override_url}")
fi
# skip empty source array
if (( ${#source[@]} == 0 )); then
msg_error "${BOLD}${pkgbase}:${ALL_OFF} PKGBUILD has no source array"
return 1
fi
for source_url in "${source[@]}"; do
# Strips out filename::http for example
source_url=$(get_url "${source_url}")
# discard query fragments
source_url=${source_url%\?*}
source_url=${source_url%#*}
# skip patches
if [[ ${source_url} == *.patch ]]; then
continue
fi
# skip signatures
if [[ ${source_url} == *.asc ]] || [[ ${source_url} == *.sig ]]; then
continue
fi
# skip local files
if [[ ${source_url} != *://* ]]; then
continue
fi
# split URL segments while avoiding empty element after protocol and newline at the end
mapfile -td / url_parts <<< "${source_url/:\/\//\/}/"
unset "url_parts[-1]"
# extract protocol and domain to select the configuration type
proto=${url_parts[0]}
domain=${url_parts[1]}
case "${domain}" in
gitlab.*)
if (( prefer_platform_api )); then
body=$(nvchecker_setup_gitlab "${url_parts[@]}")
else
body=$(nvchecker_setup_git "${url_parts[@]}")
fi
break
;;
github.com)
if (( prefer_platform_api )); then
body=$(nvchecker_setup_github "${url_parts[@]}")
else
body=$(nvchecker_setup_git "${url_parts[@]}")
fi
break
;;
codeberg.org)
body=$(nvchecker_setup_git "${url_parts[@]}")
break
;;
pypi.org|pypi.io|files.pythonhosted.org)
body=$(nvchecker_setup_pypi "${url_parts[@]}")
break
;;
hackage.haskell.org)
body=$(nvchecker_setup_hackage "${url_parts[@]}")
break
;;
registry.npmjs.org|npmjs.com|www.npmjs.com)
body=$(nvchecker_setup_npm "${url_parts[@]}")
break
;;
rubygems.org)
body=$(nvchecker_setup_rubygems "${url_parts[@]}")
break
;;
*.cpan.org|*.mcpan.org|*.metacpan.org)
body=$(nvchecker_setup_cpan "${url_parts[@]}")
break
;;
crates.io|*.crates.io)
body=$(nvchecker_setup_crates_io "${url_parts[@]}")
break
;;
*)
if [[ ${proto} == git ]] || [[ ${proto} == git+https ]]; then
body=$(nvchecker_setup_git "${url_parts[@]}")
fi
;;
esac
done
if [[ -z "${body}" ]]; then
msg_error "${BOLD}${pkgbase}:${ALL_OFF} unable to automatically setup nvchecker"
return 1
fi
# escape the section if it contains toml subsection chars
section="${pkgbase}"
if [[ ${section} == *.* ]] || [[ ${section} == *+* ]]; then
section="\"${section}\""
fi
msg_success "${BOLD}${pkgbase}:${ALL_OFF} successfully configured nvchecker"
cat > .nvchecker.toml << EOF
[${section}]
${body}
EOF
}
get_git_url_from_parts() {
local url_parts=("$@")
local proto=${url_parts[0]#*+}
local domain=${url_parts[1]}
local url
url="${proto}://$(join_by / "${url_parts[@]:1}")"
case "${domain}" in
gitlab.*)
url=${url%/-/*/*}
[[ ${url} != *.git ]] && url+=.git
;;
github.com|codeberg.org)
url="${proto}://$(join_by / "${url_parts[@]:1:3}")"
[[ ${url} != *.git ]] && url+=.git
;;
esac
printf '%s' "${url}"
}
# PyPI
#
# As Arch python packages don't necessarily match the pypi name, when the
# provided source url comes from pypi.io or pypi.org try to extract the package
# name from the (predictable) tarball download url for example:
#
# https://pypi.io/packages/source/p/pyflakes/pyflakes-3.1.0.tar.gz
# https://pypi.io/packages/source/p/pyflakes
# https://pypi.org/packages/source/b/bleach
# https://files.pythonhosted.org/packages/source/p/pyflakes
# https://pypi.org/project/SQLAlchemy/
nvchecker_setup_pypi() {
local url_parts=("$@")
local pypi
if [[ ${url_parts[2]} == packages ]]; then
pypi=${url_parts[5]}
elif [[ ${url_parts[2]} == project ]]; then
pypi=${url_parts[3]}
else
return 1
fi
cat << EOF
source = "pypi"
pypi = "${pypi}"
EOF
}
# Git
#
# Set up a generic Git source, while removing the proto specific part from makepkg
#
# git+https://github.com/prometheus/prometheus.git
# https://git.foobar.com/some/path/group/project.git
# https://gitlab.com/sub/group/project/-/archive/8.0.0/packages-8.0.0.tar.gz
nvchecker_setup_git() {
local url_parts=("$@")
local url
url=$(get_git_url_from_parts "${url_parts[@]}")
cat << EOF
source = "git"
git = "${url}"
EOF
# best effort check if the tags are prefixed with v
if git_tags_have_version_prefix "${url}"; then
echo 'prefix = "v"'
fi
}
git_tags_have_version_prefix() {
local url=$1
# best effort check if the tags are prefixed with v
if ! grep --max-count=1 --quiet --extended-regex 'refs/tags/v[0-9]+[\.0-9]*$' \
<(GIT_TERMINAL_PROMPT=0 git ls-remote --quiet --tags "${url}" 2>/dev/null); then
return 1
fi
return 0
}
# Github
#
# We want to know the $org/$project name from the url
#
# https://github.com/prometheus/prometheus/archive/v2.49.1.tar.gz
nvchecker_setup_github() {
local url_parts=("$@")
local url project
if ! url=$(get_git_url_from_parts "${url_parts[@]}"); then
return 1
fi
project=${url#*://*/}
project=${project%.git}
cat << EOF
source = "github"
github = "${project}"
use_max_tag = true
EOF
# best effort check if the tags are prefixed with v
if git_tags_have_version_prefix "${url}"; then
echo 'prefix = "v"'
fi
}
# GitLab
#
# We want to know the $org/$project name from the url
#
# git+https://gitlab.com/inkscape/inkscape.git#tag=091e20ef0f204eb40ecde54436e1ef934a03d894
nvchecker_setup_gitlab() {
local url_parts=("$@")
local url project host
if ! url=$(get_git_url_from_parts "${url_parts[@]}"); then
return 1
fi
project=${url#*://*/}
project=${project%.git}
cat << EOF
source = "gitlab"
gitlab = "${project}"
EOF
host=${url#*://}
host=${host%%/*}
if [[ ${host} != gitlab.com ]]; then
echo "host = \"${host}\""
fi
echo "use_max_tag = true"
# best effort check if the tags are prefixed with v
if git_tags_have_version_prefix "${url}"; then
echo 'prefix = "v"'
fi
}
# Hackage
#
# We want to know the project name
#
# https://hackage.haskell.org/package/xmonad
# https://hackage.haskell.org/package/xmonad-0.18.0/xmonad-0.18.0.tar.gz
# https://hackage.haskell.org/packages/archive/digits/0.3.1/digits-0.3.1.tar.gz
nvchecker_setup_hackage() {
local url_parts=("$@")
local hackage
if [[ ${url_parts[2]} == packages ]]; then
hackage=${url_parts[4]}
elif [[ ${url_parts[2]} == package ]] && (( ${#url_parts[@]} == 4 )); then
hackage=${url_parts[3]}
elif [[ ${url_parts[2]} == package ]] && (( ${#url_parts[@]} >= 5 )); then
hackage=${url_parts[3]%-*}
else
return 1
fi
cat << EOF
source = "hackage"
hackage = "${hackage}"
EOF
}
# NPM
#
# We want to know the project name
#
# https://registry.npmjs.org/eslint_d/-/eslint_d-12.1.0.tgz
# https://www.npmjs.com/package/node-gyp
nvchecker_setup_npm() {
local url_parts=("$@")
local npm
if [[ ${url_parts[1]} == registry.npmjs.org ]]; then
npm=${url_parts[2]}
elif [[ ${url_parts[2]} == package ]] && (( ${#url_parts[@]} == 4 )); then
npm=${url_parts[3]}
else
return 1
fi
cat << EOF
source = "npm"
npm = "${npm}"
EOF
}
# RubyGems
#
# We want to know the project name
#
# https://rubygems.org/downloads/polyglot-0.3.5.gem
# https://rubygems.org/gems/diff-lcs
nvchecker_setup_rubygems() {
local url_parts=("$@")
local gem
if [[ ${url_parts[2]} == downloads ]]; then
gem=${url_parts[-1]%-*}
elif [[ ${url_parts[2]} == gems ]]; then
gem=${url_parts[3]}
else
return 1
fi
cat << EOF
source = "gems"
gems = "${gem}"
EOF
}
# CPAN
#
# We want to know the project name
#
# source = https://search.cpan.org/CPAN/authors/id/C/CO/COSIMO/Locale-PO-1.2.3.tar.gz
nvchecker_setup_cpan() {
local url_parts=("$@")
local cpan=${url_parts[-1]}
cpan=${cpan%-*}
cat << EOF
source = "cpan"
cpan = "${cpan}"
EOF
}
# crates.io
#
# We want to know the crate name
#
# https://crates.io/api/v1/crates/${pkgname}/${pkgver}/download
# https://static.crates.io/crates/${pkgname}/$pkgname-$pkgver.crate
# https://crates.io/crates/git-smash
nvchecker_setup_crates_io() {
local url_parts=("$@")
local crate
if [[ ${url_parts[2]} == crates ]]; then
crate=${url_parts[3]}
elif [[ ${url_parts[4]} == crates ]]; then
crate=${url_parts[5]}
else
return 1
fi
for i in "${!url_parts[@]}"; do
if [[ ${url_parts[i]} == crates ]]; then
crate=${url_parts[(( i + 1 ))]}
fi
done
cat << EOF
source = "cratesio"
cratesio = "${crate}"
EOF
}

View File

@@ -30,14 +30,15 @@ pkgctl_version_upgrade_usage() {
Upon execution, it automatically adjusts the PKGBUILD file, ensuring that the
pkgver field is set to match the latest version available from the upstream
source. In addition to updating the pkgver, this command also resets the pkgrel
to 1.
to 1 and updates checksums.
Outputs a summary of upgraded packages, up-to-date packages, and any check
failures.
OPTIONS
-v, --verbose Display results including up-to-date versions
-h, --help Show this help text
--no-update-checksums Disable computation and update of the checksums
-v, --verbose Display results including up-to-date versions
-h, --help Show this help text
EXAMPLES
$ ${COMMAND} neovim vim
@@ -50,6 +51,7 @@ pkgctl_version_upgrade() {
local verbose=0
local exit_code=0
local current_item=0
local update_checksums=1
while (( $# )); do
case $1 in
@@ -57,6 +59,10 @@ pkgctl_version_upgrade() {
pkgctl_version_upgrade_usage
exit 0
;;
--no-update-checksums)
update_checksums=0
shift
;;
-v|--verbose)
verbose=1
shift
@@ -99,21 +105,20 @@ pkgctl_version_upgrade() {
term_spinner_start "${status_dir}"
for path in "${pkgbases[@]}"; do
# skip paths that aren't directories
if [[ ! -d "${path}" ]]; then
continue
fi
pushd "${path}" >/dev/null
if [[ ! -f "PKGBUILD" ]]; then
die "No PKGBUILD found for ${path}"
fi
# update the current terminal spinner status
(( ++current_item ))
pkgctl_version_upgrade_spinner \
"${status_dir}" \
"${#up_to_date[@]}" \
"${#out_of_date[@]}" \
"${#failure[@]}" \
"${current_item}" \
"${#pkgbases[@]}"
if [[ ! -f "PKGBUILD" ]]; then
result="${BOLD}${path}${ALL_OFF}: no PKGBUILD found"
failure+=("${result}")
popd >/dev/null
continue
fi
# reset common PKGBUILD variables
unset pkgbase pkgname arch source pkgver pkgrel validpgpkeys
@@ -121,6 +126,17 @@ pkgctl_version_upgrade() {
. ./PKGBUILD
pkgbase=${pkgbase:-$pkgname}
# update the current terminal spinner status
pkgctl_version_upgrade_spinner \
"${status_dir}" \
"${#up_to_date[@]}" \
"${#out_of_date[@]}" \
"${#failure[@]}" \
"${current_item}" \
"${#pkgbases[@]}" \
"${pkgbase}" \
"query latest version"
if ! result=$(get_upstream_version); then
result="${BOLD}${pkgbase}${ALL_OFF}: ${result}"
failure+=("${result}")
@@ -149,6 +165,24 @@ pkgctl_version_upgrade() {
# change the PKGBUILD
pkgbuild_set_pkgver "${upstream_version}"
pkgbuild_set_pkgrel 1
# download sources and update the checksums
if (( update_checksums )); then
pkgctl_version_upgrade_spinner \
"${status_dir}" \
"${#up_to_date[@]}" \
"${#out_of_date[@]}" \
"${#failure[@]}" \
"${current_item}" \
"${#pkgbases[@]}" \
"${pkgbase}" \
"updating checksums"
if ! result=$(pkgbuild_update_checksums /dev/null); then
result="${BOLD}${pkgbase}${ALL_OFF}: failed to update checksums for version ${DARK_GREEN}${upstream_version}${ALL_OFF}"
failure+=("${result}")
fi
fi
fi
popd >/dev/null
@@ -227,6 +261,8 @@ pkgctl_version_upgrade_spinner() {
local failure_count=$4
local current=$5
local total=$6
local pkgbase=$7
local message=$8
local percentage=$(( 100 * current / total ))
local tmp_file="${status_dir}/tmp"
@@ -239,8 +275,10 @@ pkgctl_version_upgrade_spinner() {
"${failure_count}" > "${tmp_file}"
# print the progress status
printf "📡 Upgrading: %s/%s [%s] %%spinner%%" \
"${BOLD}${current}" "${total}" "${percentage}%${ALL_OFF}" \
printf "📡 %s: %s\n" \
"${pkgbase}" "${BOLD}${message}${ALL_OFF}" >> "${tmp_file}"
printf "⌛ Upgrading: %s/%s [%s] %%spinner%%" \
"${BOLD}${current}" "${total}" "${percentage}%${ALL_OFF}" \
>> "${tmp_file}"
# swap the status file

View File

@@ -38,6 +38,7 @@ inspect=never
bindmounts_ro=()
bindmounts_rw=()
bindmounts_tmpfs=()
copy=$USER
[[ -n ${SUDO_USER:-} ]] && copy=$SUDO_USER
@@ -65,23 +66,24 @@ usage() {
echo "Default makepkg args: ${default_makepkg_args[*]}"
echo ''
echo 'Flags:'
echo '-h This help'
echo '-c Clean the chroot before building'
echo '-d <dir> Bind directory into build chroot as read-write'
echo '-D <dir> Bind directory into build chroot as read-only'
echo '-u Update the working copy of the chroot before building'
echo ' This is useful for rebuilds without dirtying the pristine'
echo ' chroot'
echo '-r <dir> The chroot dir to use'
echo '-I <pkg> Install a package into the working copy of the chroot'
echo '-l <copy> The directory to use as the working copy of the chroot'
echo ' Useful for maintaining multiple copies'
echo " Default: $copy"
echo '-n Run namcap on the package'
echo '-C Run checkpkg on the package'
echo '-T Build in a temporary directory'
echo '-U Run makepkg as a specified user'
echo '-x <when> Inspect chroot after build (never, always, failure)'
echo '-h This help'
echo '-c Clean the chroot before building'
echo '-d <dir> Bind directory into build chroot as read-write'
echo '-D <dir> Bind directory into build chroot as read-only'
echo '-t <dir[:opts]> Mount a tmpfs at directory'
echo '-u Update the working copy of the chroot before building'
echo ' This is useful for rebuilds without dirtying the pristine'
echo ' chroot'
echo '-r <dir> The chroot dir to use'
echo '-I <pkg> Install a package into the working copy of the chroot'
echo '-l <copy> The directory to use as the working copy of the chroot'
echo ' Useful for maintaining multiple copies'
echo " Default: $copy"
echo '-n Run namcap on the package'
echo '-C Run checkpkg on the package'
echo '-T Build in a temporary directory'
echo '-U Run makepkg as a specified user'
echo '-x <when> Inspect chroot after build (never, always, failure)'
exit 1
}
@@ -103,7 +105,7 @@ sync_chroot() {
"Locking clean chroot [%s]" "$chrootdir/root"
stat_busy "Synchronizing chroot copy [%s] -> [%s]" "$chrootdir/root" "$copy"
if is_btrfs "$chrootdir" && ! mountpoint -q "$copydir"; then
if is_btrfs "$chrootdir" && is_subvolume "$chrootdir/root" && ! mountpoint -q "$copydir"; then
subvolume_delete_recursive "$copydir" ||
die "Unable to delete subvolume %s" "$copydir"
btrfs subvolume snapshot "$chrootdir/root" "$copydir" >/dev/null ||
@@ -148,8 +150,8 @@ install_packages() {
pkgnames=("${install_pkgs[@]##*/}")
cp -- "${install_pkgs[@]}" "$copydir/root/"
arch-nspawn "$copydir" "${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \
bash -c 'yes y | pacman -U -- "$@"' -bash "${pkgnames[@]/#//root/}"
arch-nspawn "$copydir" "${bindmounts_ro[@]}" "${bindmounts_rw[@]}" "${bindmounts_tmpfs[@]}" \
pacman -U --noconfirm --ask=4 -- "${pkgnames[@]/#//root/}"
ret=$?
rm -- "${pkgnames[@]/#/$copydir/root/}"
@@ -188,6 +190,11 @@ builduser ALL = NOPASSWD: /usr/bin/pacman
EOF
chmod 440 "$copydir/etc/sudoers.d/builduser-pacman"
cat > "$copydir/etc/gitconfig" <<EOF
[safe]
directory = *
EOF
# This is a little gross, but this way the script is recreated every time in the
# working copy
{
@@ -286,11 +293,12 @@ move_products() {
}
# }}}
while getopts 'hcur:I:l:nCTD:d:U:x:' arg; do
while getopts 'hcur:I:l:nCTD:d:U:x:t:' arg; do
case "$arg" in
c) clean_first=1 ;;
D) bindmounts_ro+=("--bind-ro=$OPTARG") ;;
d) bindmounts_rw+=("--bind=$OPTARG") ;;
t) bindmounts_tmpfs+=("--tmpfs=$OPTARG") ;;
u) update_first=1 ;;
r) passeddir="$OPTARG" ;;
I) install_pkgs+=("$OPTARG") ;;
@@ -360,7 +368,7 @@ if [[ ! -d $copydir ]] || (( clean_first )); then
fi
(( update_first )) && arch-nspawn "$copydir" \
"${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \
"${bindmounts_ro[@]}" "${bindmounts_rw[@]}" "${bindmounts_tmpfs[@]}" \
pacman -Syuu --noconfirm
if [[ -n ${install_pkgs[*]:-} ]]; then
@@ -385,6 +393,7 @@ nspawn_build_args=(
--tmpfs="/tmp:${tmp_opts}"
"${bindmounts_ro[@]}"
"${bindmounts_rw[@]}"
"${bindmounts_tmpfs[@]}"
)
if arch-nspawn "$copydir" \

View File

@@ -22,13 +22,14 @@ nspawn_args=()
usage() {
echo "Usage: ${0##*/} [options] working-dir package-list..."
echo ' options:'
echo ' -U Use pacman -U to install packages'
echo ' -C <file> Location of a pacman config file'
echo ' -M <file> Location of a makepkg config file'
echo ' -c <dir> Set pacman cache'
echo ' -f <file> Copy file from the host to the chroot'
echo ' -s Do not run setarch'
echo ' -h This message'
echo ' -U Use pacman -U to install packages'
echo ' -C <file> Location of a pacman config file'
echo ' -M <file> Location of a makepkg config file'
echo ' -c <dir> Set pacman cache'
echo ' -f <src>[:<dst>] Copy src file from the host to the chroot.'
echo ' If dst file is not provided, it defaults to src'
echo ' -s Do not run setarch'
echo ' -h This message'
exit 1
}
@@ -84,8 +85,10 @@ if is_btrfs "$working_dir"; then
fi
for file in "${files[@]}"; do
mkdir -p "$(dirname "$working_dir$file")"
cp "$file" "$working_dir$file"
src="${file%%:*}"
dst="${file#*:}"
mkdir -p "$(dirname "$working_dir$dst")"
cp "$src" "$working_dir$dst"
done
unshare --mount pacstrap -${umode}Mc ${pac_conf:+-C "$pac_conf"} "$working_dir" \

View File

@@ -23,6 +23,7 @@ fi
repo=extra
arch=x86_64
server=build.archlinux.org
rsyncopts=("${RSYNC_OPTS[@]}")
usage() {
cat <<- _EOF_
@@ -106,6 +107,7 @@ mapfile -t files < <(
cd "$temp" &&
{
bsdtar --strip-components 1 -xvf - &&
export LOGDEST="" &&
script -qefc "'"${archbuild_cmd[@]@Q}"'" /dev/null &&
printf "%s\n" "" "-> build complete" &&
printf "\t%s\n" "$temp"/*
@@ -119,14 +121,25 @@ mapfile -t files < <(
[[ -f "${file}" ]] && printf "%s\n" "${file}" ||:
done < <(makepkg --config <(cat "${makepkg_user_config}" "${makepkg_config}" 2>/dev/null) --packagelist) &&
printf "%s\n" "${temp}/PKGBUILD"
find "${temp}" -name "*.log"
')
if (( ${#files[@]} )); then
printf '%s\n' '' '-> copying files...'
scp "${files[@]/#/$server:}" "${TEMPDIR}/"
mv "${TEMPDIR}"/*.pkg.tar* "${PKGDEST:-${PWD}}/"
msg 'Downloading files...'
rsync "${rsyncopts[@]}" "${files[@]/#/$server:}" "${TEMPDIR}/" || die
if is_globfile "${TEMPDIR}"/*.log; then
mv "${TEMPDIR}"/*.log "${LOGDEST:-${PWD}}/"
fi
# missing PKGBUILD download means the build failed
if [[ ! -f "${TEMPDIR}/PKGBUILD" ]]; then
error "Build failed, check logs in ${LOGDEST:-${PWD}}"
exit 1
fi
mv "${TEMPDIR}/PKGBUILD" "${PWD}/"
mv "${TEMPDIR}"/*.pkg.tar* "${PKGDEST:-${PWD}}/"
else
exit 1
fi

View File

@@ -0,0 +1,127 @@
bats_require_minimum_version 1.5.0
export _DEVTOOLS_LIBRARY_DIR="${PWD}/src"
_pkgctl_version_setup() {
source ${_DEVTOOLS_LIBRARY_DIR}/lib/version/setup.sh
pkgctl_version_setup "$@"
}
setup_and_check_config() {
pushd "test/fixture/version/setup/$1"
shift
_pkgctl_version_setup --force --no-check "$@"
diff .nvchecker.toml nvchecker.assert.toml
popd
}
@test "opt-no-force" {
pushd test/fixture/version/setup/opt-no-force
touch .nvchecker.toml
run ! _pkgctl_version_setup --no-check "$@"
popd
}
@test "opt-url" {
pushd test/fixture/version/setup/opt-url
_pkgctl_version_setup --no-check --force --url \
"https://crates.io/api/v1/crates/shotgun/1.0/download" "$@"
diff .nvchecker.toml nvchecker.assert.toml
popd
}
@test "codeberg-tarball" {
setup_and_check_config codeberg-tarball
}
@test "files.pythonhosted.org" {
setup_and_check_config files.pythonhosted.org
}
@test "github-git" {
setup_and_check_config github-git
}
@test "github-git-as-platform" {
setup_and_check_config github-git-as-platform --prefer-platform-api
}
@test "github-git-v-prefix" {
setup_and_check_config github-git-v-prefix
}
@test "github-git-v-prefix-as-platform" {
setup_and_check_config github-git-v-prefix-as-platform --prefer-platform-api
}
@test "github-tarball" {
setup_and_check_config github-tarball
}
@test "github-tarball-as-platform" {
setup_and_check_config github-tarball-as-platform --prefer-platform-api
}
@test "gitlab-archlinux-tarball" {
setup_and_check_config gitlab-archlinux-tarball
}
@test "gitlab-archlinux-tarball-as-platform" {
setup_and_check_config gitlab-archlinux-tarball-as-platform --prefer-platform-api
}
@test "gitlab-git-multi-group" {
setup_and_check_config gitlab-git-multi-group
}
@test "gitlab-git-multi-group-as-platform" {
setup_and_check_config gitlab-git-multi-group-as-platform --prefer-platform-api
}
@test "gitlab-tarball-multi-group" {
setup_and_check_config gitlab-tarball-multi-group
}
@test "gitlab-tarball-multi-group-as-platform" {
setup_and_check_config gitlab-tarball-multi-group-as-platform --prefer-platform-api
}
@test "hackage-tarball" {
setup_and_check_config hackage-tarball
}
@test "pkgbase-with-dot" {
setup_and_check_config pkgbase-with-dot
}
@test "pypi.io" {
setup_and_check_config pypi.io
}
@test "pypi.org" {
setup_and_check_config pypi.org
}
@test "registry.npmjs.org" {
setup_and_check_config registry.npmjs.org
}
@test "git-custom" {
setup_and_check_config git-custom
}
@test "rubygems.org" {
setup_and_check_config rubygems.org
}
@test "cpan.org" {
setup_and_check_config cpan.org
}
@test "crates.io" {
setup_and_check_config crates.io
}
@test "static.crates.io" {
setup_and_check_config static.crates.io
}

1
test/fixture/version/setup/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
*/.nvchecker.toml

View File

@@ -0,0 +1,18 @@
pkgname=xmobar
pkgver=1.0
pkgrel=1
pkgdesc=''
url='https://codeberg.org/xmobar/xmobar'
arch=(any)
source=(
dynamic-compilation.patch
${pkgname}-${pkgver}.tar.gz::https://codeberg.org/xmobar/xmobar/archive/${pkgver}.tar.gz
)
sha512sums=('319f3a77d500c505826ab487e4011bb1a22b8cae70c17b964574a09a6488a864a1aaabb6a298468d121110dd485f179bc712a5106e49eb8ae638e02b5115190a'
'15db3e27d1ff957e26e706e4c67cec6e43d89f5a39cd6d81ddb5ae8426e32d938494fbba39fa322461d992a95d2e522c10b186a1ca2c5c3e996f944b6e6ef7c4')
package() {
:
}
# vim: ts=2 sw=2 et:

View File

@@ -0,0 +1,3 @@
[xmobar]
source = "git"
git = "https://codeberg.org/xmobar/xmobar.git"

View File

@@ -0,0 +1,14 @@
pkgname=perl-locale-po
pkgver=0.3.5
pkgrel=1
pkgdesc=''
arch=(any)
url='http://polyglot.rubyforge.org/'
source=("https://search.cpan.org/CPAN/authors/id/C/CO/COSIMO/Locale-PO-$pkgver.tar.gz")
sha256sums=('59d66ef5e3c166431c39cb8b7c1d02af419051352f27912f6a43981b3def16af')
package() {
:
}
# vim: ts=2 sw=2 et:

View File

@@ -0,0 +1,3 @@
[perl-locale-po]
source = "cpan"
cpan = "Locale-PO"

View File

@@ -0,0 +1,17 @@
pkgname=shotgun
pkgver=0.3.5
pkgrel=1
pkgdesc='Minimal X screenshot utility'
arch=('any')
url='https://github.com/neXromancers/shotgun'
license=('MIT')
depends=('cargo')
options=('!emptydirs')
source=("https://crates.io/api/v1/crates/${pkgname}/${pkgver}/download")
sha256sums=('59d66ef5e3c166431c39cb8b7c1d02af419051352f27912f6a43981b3def16af')
package() {
:
}
# vim: ts=2 sw=2 et:

View File

@@ -0,0 +1,3 @@
[shotgun]
source = "cratesio"
cratesio = "shotgun"

View File

@@ -0,0 +1,15 @@
_pyname=ipyparallel
pkgname=python-$_pyname
pkgver=8.6.1
pkgrel=1
pkgdesc='Interactive Parallel Computing in Python'
url='https://pypi.org/project/ipyparallel/'
arch=(any)
license=(BSD)
source=(https://files.pythonhosted.org/packages/source/${_pyname::1}/$_pyname/$_pyname-$pkgver.tar.gz)
depends=(python)
sha256sums=('a39aa5ef9560170bf0e9afedca9ff045e1b9c1832c49303377edcc91cea9fb77')
package() {
:
}

View File

@@ -0,0 +1,3 @@
[python-ipyparallel]
source = "pypi"
pypi = "ipyparallel"

View File

@@ -0,0 +1,14 @@
pkgname=libfakekey
pkgver=0.3
pkgrel=1
pkgdesc='X virtual keyboard library.'
arch=('x86_64')
url='https://www.yoctoproject.org/tools-resources/projects/matchbox'
license=('GPL')
depends=('libxtst')
source=("git://git.yoctoproject.org/libfakekey")
sha256sums=('d282fa6481a5b85f71e36e8bad4cfa938cc8eaac4c42ffa27f9203ac634813f4')
package() {
:
}

View File

@@ -0,0 +1,3 @@
[libfakekey]
source = "git"
git = "git://git.yoctoproject.org/libfakekey"

View File

@@ -0,0 +1,17 @@
pkgname=minisign
pkgver=0.11
pkgrel=1
pkgdesc="A dead-simple tool to sign files and verify digital signatures"
arch=('x86_64')
url="https://github.com/jedisct1/minisign"
license=('custom:ISC')
depends=('libsodium')
makedepends=('cmake' 'git')
_commit=feefda7af87f64342bd07bf446ceb0467cbd0fb4 # git rev-parse $pkgver
source=("git+https://github.com/jedisct1/minisign.git?signed#tag=$_commit")
sha512sums=('SKIP')
validpgpkeys=(54A2B8892CC3D6A597B92B6C210627AABA709FE1) # Frank Denis
package() {
:
}

View File

@@ -0,0 +1,4 @@
[minisign]
source = "github"
github = "jedisct1/minisign"
use_max_tag = true

View File

@@ -0,0 +1,17 @@
pkgname=vim
pkgver=9.1.0131
pkgrel=1
pkgdesc="A dead-simple tool to sign files and verify digital signatures"
arch=('x86_64')
url="https://github.com/jedisct1/minisign"
license=('custom:ISC')
depends=('libsodium')
makedepends=('cmake' 'git')
_commit=feefda7af87f64342bd07bf446ceb0467cbd0fb4 # git rev-parse $pkgver
source=("git+https://github.com/vim/vim.git?signed#tag=v${pkgver}")
sha512sums=('SKIP')
validpgpkeys=(54A2B8892CC3D6A597B92B6C210627AABA709FE1) # Frank Denis
package() {
:
}

View File

@@ -0,0 +1,5 @@
[vim]
source = "github"
github = "vim/vim"
use_max_tag = true
prefix = "v"

View File

@@ -0,0 +1,17 @@
pkgname=vim
pkgver=9.1.0131
pkgrel=1
pkgdesc="A dead-simple tool to sign files and verify digital signatures"
arch=('x86_64')
url="https://github.com/jedisct1/minisign"
license=('custom:ISC')
depends=('libsodium')
makedepends=('cmake' 'git')
_commit=feefda7af87f64342bd07bf446ceb0467cbd0fb4 # git rev-parse $pkgver
source=("git+https://github.com/vim/vim.git?signed#tag=v${pkgver}")
sha512sums=('SKIP')
validpgpkeys=(54A2B8892CC3D6A597B92B6C210627AABA709FE1) # Frank Denis
package() {
:
}

View File

@@ -0,0 +1,4 @@
[vim]
source = "git"
git = "https://github.com/vim/vim.git"
prefix = "v"

View File

@@ -0,0 +1,17 @@
pkgname=minisign
pkgver=0.11
pkgrel=1
pkgdesc="A dead-simple tool to sign files and verify digital signatures"
arch=('x86_64')
url="https://github.com/jedisct1/minisign"
license=('custom:ISC')
depends=('libsodium')
makedepends=('cmake' 'git')
_commit=feefda7af87f64342bd07bf446ceb0467cbd0fb4 # git rev-parse $pkgver
source=("git+https://github.com/jedisct1/minisign.git?signed#tag=$_commit")
sha512sums=('SKIP')
validpgpkeys=(54A2B8892CC3D6A597B92B6C210627AABA709FE1) # Frank Denis
package() {
:
}

View File

@@ -0,0 +1,3 @@
[minisign]
source = "git"
git = "https://github.com/jedisct1/minisign.git"

View File

@@ -0,0 +1,29 @@
pkgname=git-smash
pkgver=0.1.0
pkgrel=1
pkgdesc='Smash staged changes into previous commits to support your Git workflow'
url='https://github.com/anthraxx/git-smash'
arch=('x86_64')
license=('MIT')
depends=('glibc' 'gcc-libs' 'git')
makedepends=('cargo' 'scdoc')
optdepends=(
'skim: selection menu alternative'
'fzf: selection menu alternative'
)
source=(${url}/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz
${url}/releases/download/${pkgver}/${pkgname}-${pkgver}.tar.gz.sig)
options=('!makeflags')
sha512sums=('64a8b6e2afa7007966245a4888e51251e8c35f0b82421f3cee634a3e7b82256a24459cba2941800a6e50a047766a0f8de20b435904d17df3fd456b6c09ac4c5f'
'SKIP')
b2sums=('acc46b7a87135380fe36c378e9055b8b7c9b88a818c955f04677161f50d5ccd5699ac05f0a858dd11ca7b42b3505c0ac037f50efcd690f9e5a76be395d5d6590'
'SKIP')
validpgpkeys=(
'E240B57E2C4630BA768E2F26FC1B547C8D8172C8' # Levente Polyak
)
package() {
:
}
# vim: ts=2 sw=2 et:

View File

@@ -0,0 +1,5 @@
[git-smash]
source = "github"
github = "anthraxx/git-smash"
use_max_tag = true
prefix = "v"

View File

@@ -0,0 +1,25 @@
pkgname=git-smash
pkgver=0.1.0
pkgrel=1
pkgdesc='Smash staged changes into previous commits to support your Git workflow'
url='https://github.com/anthraxx/git-smash'
arch=('x86_64')
license=('MIT')
depends=('glibc' 'gcc-libs' 'git')
makedepends=('cargo' 'scdoc')
source=(${url}/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz
${url}/releases/download/${pkgver}/${pkgname}-${pkgver}.tar.gz.sig)
options=('!makeflags')
sha512sums=('64a8b6e2afa7007966245a4888e51251e8c35f0b82421f3cee634a3e7b82256a24459cba2941800a6e50a047766a0f8de20b435904d17df3fd456b6c09ac4c5f'
'SKIP')
b2sums=('acc46b7a87135380fe36c378e9055b8b7c9b88a818c955f04677161f50d5ccd5699ac05f0a858dd11ca7b42b3505c0ac037f50efcd690f9e5a76be395d5d6590'
'SKIP')
validpgpkeys=(
'E240B57E2C4630BA768E2F26FC1B547C8D8172C8' # Levente Polyak
)
package() {
:
}
# vim: ts=2 sw=2 et:

View File

@@ -0,0 +1,4 @@
[git-smash]
source = "git"
git = "https://github.com/anthraxx/git-smash.git"
prefix = "v"

View File

@@ -0,0 +1,57 @@
pkgname=devtools
epoch=1
pkgver=1.1.1
pkgrel=1
pkgdesc='Tools for Arch Linux package maintainers'
arch=('any')
license=('GPL-3.0-or-later')
url='https://gitlab.archlinux.org/archlinux/devtools'
depends=(
arch-install-scripts
awk
bash
binutils
coreutils
curl
diffutils
fakeroot
findutils
grep
jq
openssh
parallel
rsync
sed
util-linux
breezy
git
mercurial
subversion
)
makedepends=(
asciidoc
shellcheck
)
optdepends=(
'btrfs-progs: btrfs support'
'bat: pretty printing for pkgctl search'
'nvchecker: pkgctl version subcommand'
'pacman-contrib: support for the --update-checksums option'
)
replaces=(devtools-git-poc)
source=(https://gitlab.archlinux.org/archlinux/devtools/-/releases/v${pkgver}/downloads/devtools-${pkgver}.tar.gz{,.sig})
validpgpkeys=(
'E240B57E2C4630BA768E2F26FC1B547C8D8172C8' # Levente Polyak <anthraxx@archlinux.org>
'F00B96D15228013FFC9C9D0393B11DAA4C197E3D' # Christian Heusel (gromit packager key) <gromit@archlinux.org>
)
sha256sums=('b2a12bb8b4b568110b055ccec903c9a0b0b979ab44f0cba574c026d243d5ce36'
'SKIP')
b2sums=('be9601a4fcbb576b9a8637abdaec70f8ec730cf5752793c2f8fdce20e489b74555f624d0a0b5f8bb58c0914413a29d51698c8474430010502ab80d6c18c4332e'
'SKIP')
package() {
:
}
# vim: ts=2 sw=2 et:

View File

@@ -0,0 +1,6 @@
[devtools]
source = "gitlab"
gitlab = "archlinux/devtools"
host = "gitlab.archlinux.org"
use_max_tag = true
prefix = "v"

View File

@@ -0,0 +1,57 @@
pkgname=devtools
epoch=1
pkgver=1.1.1
pkgrel=1
pkgdesc='Tools for Arch Linux package maintainers'
arch=('any')
license=('GPL-3.0-or-later')
url='https://gitlab.archlinux.org/archlinux/devtools'
depends=(
arch-install-scripts
awk
bash
binutils
coreutils
curl
diffutils
fakeroot
findutils
grep
jq
openssh
parallel
rsync
sed
util-linux
breezy
git
mercurial
subversion
)
makedepends=(
asciidoc
shellcheck
)
optdepends=(
'btrfs-progs: btrfs support'
'bat: pretty printing for pkgctl search'
'nvchecker: pkgctl version subcommand'
'pacman-contrib: support for the --update-checksums option'
)
replaces=(devtools-git-poc)
source=(https://gitlab.archlinux.org/archlinux/devtools/-/releases/v${pkgver}/downloads/devtools-${pkgver}.tar.gz{,.sig})
validpgpkeys=(
'E240B57E2C4630BA768E2F26FC1B547C8D8172C8' # Levente Polyak <anthraxx@archlinux.org>
'F00B96D15228013FFC9C9D0393B11DAA4C197E3D' # Christian Heusel (gromit packager key) <gromit@archlinux.org>
)
sha256sums=('b2a12bb8b4b568110b055ccec903c9a0b0b979ab44f0cba574c026d243d5ce36'
'SKIP')
b2sums=('be9601a4fcbb576b9a8637abdaec70f8ec730cf5752793c2f8fdce20e489b74555f624d0a0b5f8bb58c0914413a29d51698c8474430010502ab80d6c18c4332e'
'SKIP')
package() {
:
}
# vim: ts=2 sw=2 et:

View File

@@ -0,0 +1,4 @@
[devtools]
source = "git"
git = "https://gitlab.archlinux.org/archlinux/devtools.git"
prefix = "v"

View File

@@ -0,0 +1,30 @@
pkgbase=kicad-library
pkgname=($pkgbase{,-3d})
pkgver=7.0.10
pkgrel=1
pkgdesc='Assorted libraries for KiCad'
arch=('any')
url='http://kicad.org/'
license=('GPL')
makedepends=('git' 'cmake')
options=('!strip')
source=(
'git+https://gitlab.com/kicad/libraries/kicad-packages3D.git#commit=f1af95360976e66472b13897a1f3f5c2a77c0461'
'git+https://gitlab.com/kicad/libraries/kicad-symbols.git#commit=5efa35abf67b4734a8e04cf83e31514be3329ce4'
'git+https://gitlab.com/kicad/libraries/kicad-templates.git#commit=ff6e3193e6ff6029f65e7cce8ab39fafeafecdd6'
'git+https://gitlab.com/kicad/libraries/kicad-footprints.git#commit=9fb460d078b55f2bb08c459cddd184833a853167'
)
sha512sums=('SKIP'
'SKIP'
'SKIP'
'SKIP')
package_kicad-library() {
:
}
package_kicad-library-3d() {
:
}
# vim:set ts=2 sw=2 et:

View File

@@ -0,0 +1,4 @@
[kicad-library]
source = "gitlab"
gitlab = "kicad/libraries/kicad-packages3D"
use_max_tag = true

View File

@@ -0,0 +1,30 @@
pkgbase=kicad-library
pkgname=($pkgbase{,-3d})
pkgver=7.0.10
pkgrel=1
pkgdesc='Assorted libraries for KiCad'
arch=('any')
url='http://kicad.org/'
license=('GPL')
makedepends=('git' 'cmake')
options=('!strip')
source=(
'git+https://gitlab.com/kicad/libraries/kicad-packages3D.git#commit=f1af95360976e66472b13897a1f3f5c2a77c0461'
'git+https://gitlab.com/kicad/libraries/kicad-symbols.git#commit=5efa35abf67b4734a8e04cf83e31514be3329ce4'
'git+https://gitlab.com/kicad/libraries/kicad-templates.git#commit=ff6e3193e6ff6029f65e7cce8ab39fafeafecdd6'
'git+https://gitlab.com/kicad/libraries/kicad-footprints.git#commit=9fb460d078b55f2bb08c459cddd184833a853167'
)
sha512sums=('SKIP'
'SKIP'
'SKIP'
'SKIP')
package_kicad-library() {
:
}
package_kicad-library-3d() {
:
}
# vim:set ts=2 sw=2 et:

View File

@@ -0,0 +1,3 @@
[kicad-library]
source = "git"
git = "https://gitlab.com/kicad/libraries/kicad-packages3D.git"

View File

@@ -0,0 +1,24 @@
pkgbase=kicad-library
pkgname=($pkgbase{,-3d})
pkgver=7.0.10
pkgrel=1
pkgdesc='Assorted libraries for KiCad'
arch=('any')
url='http://kicad.org/'
license=('GPL')
makedepends=('git' 'cmake')
options=('!strip')
source=(
https://gitlab.com/kicad/libraries/kicad-packages3D/-/archive/8.0.0/kicad-packages3D-8.0.0.tar.gz
)
sha512sums=('SKIP')
package_kicad-library() {
:
}
package_kicad-library-3d() {
:
}
# vim:set ts=2 sw=2 et:

View File

@@ -0,0 +1,4 @@
[kicad-library]
source = "gitlab"
gitlab = "kicad/libraries/kicad-packages3D"
use_max_tag = true

View File

@@ -0,0 +1,24 @@
pkgbase=kicad-library
pkgname=($pkgbase{,-3d})
pkgver=7.0.10
pkgrel=1
pkgdesc='Assorted libraries for KiCad'
arch=('any')
url='http://kicad.org/'
license=('GPL')
makedepends=('git' 'cmake')
options=('!strip')
source=(
https://gitlab.com/kicad/libraries/kicad-packages3D/-/archive/8.0.0/kicad-packages3D-8.0.0.tar.gz
)
sha512sums=('SKIP')
package_kicad-library() {
:
}
package_kicad-library-3d() {
:
}
# vim:set ts=2 sw=2 et:

Some files were not shown because too many files have changed in this diff Show More