Compare commits

..

28 Commits

Author SHA1 Message Date
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
95 changed files with 2475 additions and 354 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

@@ -12,10 +12,33 @@ build:
- make PREFIX=/usr - make PREFIX=/usr
- make PREFIX=/usr DESTDIR=build install - make PREFIX=/usr DESTDIR=build install
check: lint:
stage: test stage: test
needs: [] needs: []
script: script:
- pacman -Syu --noconfirm m4 make openssh subversion rsync arch-install-scripts git bzr mercurial diffutils asciidoctor shellcheck - pacman -Syu --noconfirm m4 make openssh subversion rsync arch-install-scripts git bzr mercurial diffutils asciidoctor shellcheck
- make check || true - make check || true
- SHELLCHECK_OPTS="-S error" make check - 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) BUILDTOOLVER ?= $(V)
PREFIX = /usr/local PREFIX = /usr/local
@@ -52,6 +52,13 @@ ARCHBUILD_LINKS = \
COMPLETIONS = $(addprefix $(BUILDDIR)/,$(patsubst %.in,%,$(wildcard contrib/completion/*/*))) 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 all: binprogs library conf completion man
binprogs: $(BINPROGS) binprogs: $(BINPROGS)
library: $(LIBRARY) library: $(LIBRARY)
@@ -168,8 +175,17 @@ dist:
git archive --format=tar --prefix=devtools-$(V)/ v$(V) | gzip > devtools-$(V).tar.gz git archive --format=tar --prefix=devtools-$(V)/ v$(V) | gzip > devtools-$(V).tar.gz
gpg --detach-sign --use-agent 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
check: $(BINPROGS_SRC) $(LIBRARY_SRC) contrib/completion/bash/devtools.in config/makepkg/x86_64.conf contrib/makepkg/PKGBUILD.proto check: $(BINPROGS_SRC) $(LIBRARY_SRC) contrib/completion/bash/devtools.in config/makepkg/x86_64.conf contrib/makepkg/PKGBUILD.proto
shellcheck $^ 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: .DELETE_ON_ERROR:

View File

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

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 # shellcheck source=src/lib/valid-search.sh
source "${_DEVTOOLS_LIBRARY_DIR}"/lib/valid-search.sh source "${_DEVTOOLS_LIBRARY_DIR}"/lib/valid-search.sh
_binary_arch=${DEVTOOLS_VALID_ARCHES[*]:0:-1}
_colors=(never always auto) _colors=(never always auto)
@@ -28,6 +27,7 @@ _makechrootpkg_args=(
-I -I
-l -l
-n -n
-t
-T -T
-U -U
-x -x
@@ -37,6 +37,7 @@ _makechrootpkg_args_D_opts() { _filedir -d; }
_makechrootpkg_args_r_opts() { _filedir -d; } _makechrootpkg_args_r_opts() { _filedir -d; }
_makechrootpkg_args_I_opts() { _filedir '*.pkg.tar.*'; } _makechrootpkg_args_I_opts() { _filedir '*.pkg.tar.*'; }
_makechrootpkg_args_l_opts() { _filedir -d; } _makechrootpkg_args_l_opts() { _filedir -d; }
_makechrootpkg_args_t_opts() { _filedir -d; }
_makechrootpkg_args_U_opts() { :; } _makechrootpkg_args_U_opts() { :; }
_makechrootpkg_args_x_opts() { _devtools_completions_inspect; } _makechrootpkg_args_x_opts() { _devtools_completions_inspect; }
_makechrootpkg() { __devtools_complete _makechrootpkg; } _makechrootpkg() { __devtools_complete _makechrootpkg; }
@@ -62,12 +63,14 @@ _mkarchroot_args=(
-C -C
-M -M
-c -c
-f
-h -h
) )
_mkarchroot_args_U_opts() { _filedir '*.pkg.tar.*'; } _mkarchroot_args_U_opts() { _filedir '*.pkg.tar.*'; }
_mkarchroot_args_C_opts() { _filedir '*.conf'; } _mkarchroot_args_C_opts() { _filedir '*.conf'; }
_mkarchroot_args_M_opts() { _filedir '*.conf'; } _mkarchroot_args_M_opts() { _filedir '*.conf'; }
_mkarchroot_args_c_opts() { _filedir -d; } _mkarchroot_args_c_opts() { _filedir -d; }
_mkarchroot_args_f_opts() { _filedir -d; }
_mkarchroot_opts() { _mkarchroot_opts() {
local args local args
args=$(__pkgctl_word_count_after_subcommand) 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__repo_opts() { _devtools_completions_build_repo; }
_offload_build_args_r_opts() { _offload_build_args__repo_opts; } _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_a_opts() { _offload_build_args__arch_opts; }
_offload_build_args__server_opts() { :; } _offload_build_args__server_opts() { :; }
_offload_build_args_s_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 -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__repo_opts() { _devtools_completions_repo; }
_pkgctl_build_args__worker_opts() { :; } _pkgctl_build_args__worker_opts() { :; }
_pkgctl_build_args_w_opts() { _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=( _pkgctl_db_remove_args=(
--partial
--noconfirm
-a --arch -a --arch
-h --help -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() { _pkgctl_db_remove_opts() {
local subcommand args local subcommand args
subcommand=(db remove) subcommand=(db remove)
@@ -289,6 +296,7 @@ _pkgctl_aur_drop_from_repo_opts() { _filedir -d; }
_pkgctl_repo_cmds=( _pkgctl_repo_cmds=(
clean
clone clone
configure configure
create 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_args_j_opts() { _pkgctl_repo_clone_args__jobs_opts; }
_pkgctl_repo_clone_opts() { _devtools_completions_all_packages; } _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=( _pkgctl_repo_configure_args=(
--protocol --protocol
@@ -350,6 +364,7 @@ _pkgctl_repo_switch_opts() {
_pkgctl_version_cmds=( _pkgctl_version_cmds=(
check check
setup
upgrade upgrade
) )
@@ -360,7 +375,19 @@ _pkgctl_version_check_args=(
_pkgctl_version_check_opts() { _filedir -d; } _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=( _pkgctl_version_upgrade_args=(
--no-update-checksums
-v --verbose -v --verbose
-h --help -h --help
) )
@@ -421,6 +448,9 @@ _devtools_completions_color() {
_devtools_completions_arch() { _devtools_completions_arch() {
mapfile -t COMPREPLY < <(compgen -W "${DEVTOOLS_VALID_ARCHES[*]}" -- "$cur") 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() { _devtools_completions_repo() {
local optional=${1:-} local optional=${1:-}
mapfile -t COMPREPLY < <(compgen -W "${optional} ${DEVTOOLS_VALID_REPOS[*]}" -- "$cur") 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 # shellcheck source=src/lib/valid-search.sh
source "${_DEVTOOLS_LIBRARY_DIR}"/lib/valid-search.sh source "${_DEVTOOLS_LIBRARY_DIR}"/lib/valid-search.sh
_binary_arch=${DEVTOOLS_VALID_ARCHES[*]:0:-1}
_colors=(never always auto) _colors=(never always auto)
_archbuild_args=( _archbuild_args=(
@@ -41,8 +40,8 @@ _pkgctl_auth_status_args=(
) )
_pkgctl_build_args=( _pkgctl_build_args=(
"--arch=[Specify architectures to build for (disables auto-detection)]:arch:($_arch[*])" "--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[*])" "--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]' '(-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]' '(-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]' '(-o --offload)'{-o,--offload}'[Build on a remote server and transfer artifacts afterwards]'
@@ -79,7 +78,9 @@ _pkgctl_db_move_args=(
) )
_pkgctl_db_remove_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]' '(-h --help)'{-h,--help}'[Display usage]'
"1:repo:($DEVTOOLS_VALID_REPOS[*])" "1:repo:($DEVTOOLS_VALID_REPOS[*])"
'*:pkgbase:_devtools_completions_all_packages' '*:pkgbase:_devtools_completions_all_packages'
@@ -113,6 +114,7 @@ _pkgctl_aur_drop_from_repo_args=(
_pkgctl_repo_cmds=( _pkgctl_repo_cmds=(
"pkgctl repo command" "pkgctl repo command"
"clean[Remove untracked files from the working tree]"
"clone[Clone a package repository]" "clone[Clone a package repository]"
"configure[Configure a clone according to distro specs]" "configure[Configure a clone according to distro specs]"
"create[Create a new GitLab package repository]" "create[Create a new GitLab package repository]"
@@ -127,6 +129,13 @@ _pkgctl_repo_switch_args=(
'*:git_dir:_files -/' '*: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=( _pkgctl_repo_clone_args=(
'(-m --maintainer=)'{-m,--maintainer=}'[Clone all packages of the named maintainer]:maintainer:' '(-m --maintainer=)'{-m,--maintainer=}'[Clone all packages of the named maintainer]:maintainer:'
'--protocol[Clone the repository over https]:proto:(https)' '--protocol[Clone the repository over https]:proto:(https)'
@@ -213,6 +222,7 @@ _makechrootpkg_args=(
'-c[Clean the chroot before building]' '-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-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-only]:bind_dir_ro:_files -/'
'*-t[Mount a tmpfs at directory]:tmpfs_dir:_files -/'
'-u[Update the working copy of the chroot before building]' '-u[Update the working copy of the chroot before building]'
'-r[The chroot dir to use]:chroot_dir:_files -/' '-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.*(.)"'
@@ -228,6 +238,7 @@ _mkarchroot_args=(
'-C[Location of a pacman config file]:pacman_config:_files -g "*.conf(.)"' '-C[Location of a pacman config file]:pacman_config:_files -g "*.conf(.)"'
'-M[Location of a makepkg config file]:makepkg_config:_files -g "*.conf(.)"' '-M[Location of a makepkg config file]:makepkg_config:_files -g "*.conf(.)"'
'-c[Set pacman cache]:pacman_cache:_files -/' '-c[Set pacman cache]:pacman_cache:_files -/'
'-f[Copy src file from the host to the chroot]:target:_files -/'
'-h[Display usage]' '-h[Display usage]'
'1:working_dir:_files -/' '1:working_dir:_files -/'
'*:packages:_devtools_completions_all_packages' '*:packages:_devtools_completions_all_packages'
@@ -250,7 +261,7 @@ _sogrep_args=(
_offload_build_args=( _offload_build_args=(
'(-r --repo)'{-r,--repo}'[Build against a specific repository]:repo:($DEVTOOLS_VALID_BUILDREPOS[*])' '(-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:' '(-s --server)'{-s,--server}'[Offload to a specific Build server]:server:'
'(-h --help)'{-h,--help}'[Display usage]' '(-h --help)'{-h,--help}'[Display usage]'
) )
@@ -291,6 +302,7 @@ _pkgctl_args=(
_pkgctl_version_cmds=( _pkgctl_version_cmds=(
"pkgctl version command" "pkgctl version command"
"check[Compares local package versions against upstream versions]" "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]" "upgrade[Adjust the PKGBUILD to match the latest upstream version]"
) )
@@ -300,7 +312,17 @@ _pkgctl_version_check_args=(
'*:git_dir:_files -/' '*: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=( _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]' '(-v --verbose)'{-v,--verbose}'[Display results including up-to-date versions]'
'(-h --help)'{-h,--help}'[Display usage]' '(-h --help)'{-h,--help}'[Display usage]'
'*:git_dir:_files -/' '*:git_dir:_files -/'

View File

@@ -28,8 +28,9 @@ Options
*-c* <dir>:: *-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' 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>:: *-f* <src>[:<dst>]::
Copy file from the host to the chroot Copy file from the host to the chroot.
If 'dst' is not provided, it defaults to 'src' inside of the chroot.
*-s*:: *-s*::
Do not run setarch Do not run setarch

View File

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

View File

@@ -32,8 +32,9 @@ Options
*-c* <dir>:: *-c* <dir>::
Set pacman cache. Set pacman cache.
*-f* <file>:: *-f* <src>[:<dst>]::
Copy file from the host to the chroot. Copy file from the host to the chroot.
If 'dst' is not provided, it defaults to 'src' inside of the chroot.
*-s*:: *-s*::
Do not run setarch. Do not run setarch.

View File

@@ -12,7 +12,8 @@ pkgctl build [OPTIONS] [PATH...]
Description Description
----------- -----------
TODO Build packages in clean chroot environment, offering various options
and functionalities to customize the package building process.
Build Options Build Options
------------- -------------

View File

@@ -12,13 +12,27 @@ pkgctl db remove [OPTIONS] [REPO] [PKGBASE]...
Description 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 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':: *-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*:: *-h, --help*::
Show a help text Show a help text

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

@@ -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

@@ -32,6 +32,9 @@ Options
Subcommands Subcommands
----------- -----------
pkgctl repo clean::
Remove untracked files from the working tree
pkgctl repo clone:: pkgctl repo clone::
Clone a package repository Clone a package repository
@@ -50,6 +53,7 @@ pkgctl repo web::
See Also See Also
-------- --------
pkgctl-repo-clean(1)
pkgctl-repo-clone(1) pkgctl-repo-clone(1)
pkgctl-repo-configure(1) pkgctl-repo-configure(1)
pkgctl-repo-create(1) pkgctl-repo-create(1)

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 Upon execution, it automatically adjusts the PKGBUILD file, ensuring that the
pkgver field is set to match the latest version available from the upstream 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 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 Outputs a summary of upgraded packages, up-to-date packages, and any check
failures. failures.
@@ -35,6 +35,9 @@ PKGBUILD. Refer to the configuration section in pkgctl-version(1).
Options Options
------- -------
*--no-update-checksums*::
Disable computation and update of the checksums
*-v, --verbose*:: *-v, --verbose*::
Display results including up-to-date versions Display results including up-to-date versions

View File

@@ -26,6 +26,9 @@ package's pkgbase. The pkgbase section within the `.nvchecker.toml` file
specifies the source and method for checking the latest version of the specifies the source and method for checking the latest version of the
corresponding package. 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 For detailed information on the various configuration options available for the
`.nvchecker.toml` file, refer to the configuration files section in `.nvchecker.toml` file, refer to the configuration files section in
nvchecker(1). This documentation provides insights into the possible nvchecker(1). This documentation provides insights into the possible
@@ -48,6 +51,9 @@ Subcommands
pkgctl version check:: pkgctl version check::
Compares local package versions against upstream Compares local package versions against upstream
pkgctl version setup::
Automatically detect and setup a basic nvchecker config
pkgctl version upgrade:: pkgctl version upgrade::
Adjust the PKGBUILD to match the latest upstream version Adjust the PKGBUILD to match the latest upstream version
@@ -55,6 +61,7 @@ See Also
-------- --------
pkgctl-version-check(1) pkgctl-version-check(1)
pkgctl-version-setup(1)
pkgctl-version-upgrade(1) pkgctl-version-upgrade(1)
include::include/footer.asciidoc[] include::include/footer.asciidoc[]

View File

@@ -12,7 +12,12 @@ pkgctl [SUBCOMMAND] [OPTIONS]
Description 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 Options
------- -------

View File

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

View File

@@ -151,7 +151,7 @@ fi
server=${PACKAGING_REPO_RELEASE_HOST} 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=() archreleaseopts=()
while getopts ':l:a:s:f' flag; do while getopts ':l:a:s:f' flag; do
case $flag in case $flag in

View File

@@ -312,7 +312,7 @@ pkgctl_build() {
# Update pacman cache for auto-detection # Update pacman cache for auto-detection
if [[ -z ${REPO} ]]; then if [[ -z ${REPO} ]]; then
update_pacman_repo_cache update_pacman_repo_cache multilib
# Check valid repos if not resolved dynamically # Check valid repos if not resolved dynamically
elif ! in_array "${REPO}" "${DEVTOOLS_VALID_REPOS[@]}"; then elif ! in_array "${REPO}" "${DEVTOOLS_VALID_REPOS[@]}"; then
die "Invalid repository target: %s" "${REPO}" die "Invalid repository target: %s" "${REPO}"
@@ -437,10 +437,11 @@ pkgctl_build() {
stat_done stat_done
fi fi
# update checksums if any sources are declared # update checksums if any sources are declared
if (( UPDATE_CHECKSUMS )) && (( ${#source[@]} >= 1 )); then if (( UPDATE_CHECKSUMS )) && (( ${#source[@]} >= 1 )); then
updpkgsums if ! result=$(pkgbuild_update_checksums /dev/stderr); then
die "${result}"
fi
fi fi
# re-source the PKGBUILD if it changed # re-source the PKGBUILD if it changed

View File

@@ -15,6 +15,9 @@ $DEVTOOLS_INCLUDE_COMMON_SH
# Avoid any encoding problems # Avoid any encoding problems
export LANG=C.UTF-8 export LANG=C.UTF-8
# Avoid systemd trying to color the terminal on systemd-nspawn
export SYSTEMD_TINT_BACKGROUND=no
# Set buildtool properties # Set buildtool properties
export BUILDTOOL=devtools export BUILDTOOL=devtools
export BUILDTOOLVER=@buildtoolver@ 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 PKGBASE_MAINTAINER_URL=https://archlinux.org/packages/pkgbase-maintainer
export AUR_URL_SSH=aur@aur.archlinux.org 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 # ensure TERM is set with a fallback to dumb
export TERM=${TERM:-dumb} export TERM=${TERM:-dumb}
@@ -106,6 +120,8 @@ print_workdir_error() {
} }
_setup_workdir=false _setup_workdir=false
# Ensure that there is no outside value for WORKDIR leaking in
unset WORKDIR
setup_workdir() { setup_workdir() {
[[ -z ${WORKDIR:-} ]] && WORKDIR=$(mktemp -d --tmpdir "${0##*/}.XXXXXXXXXX") [[ -z ${WORKDIR:-} ]] && WORKDIR=$(mktemp -d --tmpdir "${0##*/}.XXXXXXXXXX")
_setup_workdir=true _setup_workdir=true
@@ -342,3 +358,17 @@ is_debug_package() {
pkgdesc="$(getpkgdesc "${pkgfile}")" pkgdesc="$(getpkgdesc "${pkgfile}")"
[[ ${pkgdesc} == "Detached debugging symbols for "* && ${pkgbase}-debug = "${pkgname}" ]] [[ ${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@} _DEVTOOLS_LIBRARY_DIR=${_DEVTOOLS_LIBRARY_DIR:-@pkgdatadir@}
# shellcheck source=src/lib/common.sh # shellcheck source=src/lib/common.sh
source "${_DEVTOOLS_LIBRARY_DIR}"/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 set -e
@@ -17,10 +23,19 @@ pkgctl_db_remove_usage() {
cat <<- _EOF_ cat <<- _EOF_
Usage: ${COMMAND} [OPTIONS] [REPO] [PKGBASE]... 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 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 -h, --help Show this help text
EXAMPLES EXAMPLES
@@ -31,8 +46,13 @@ _EOF_
pkgctl_db_remove() { pkgctl_db_remove() {
local REPO="" local REPO=""
local ARCH=any
local PKGBASES=() local PKGBASES=()
local pkgnames=()
local partial=0
local confirm=1
local dbscripts_options=()
local lookup_repo=multilib
local pkgname
# option checking # option checking
while (( $# )); do while (( $# )); do
@@ -41,11 +61,20 @@ pkgctl_db_remove() {
pkgctl_db_remove_usage pkgctl_db_remove_usage
exit 0 exit 0
;; ;;
--partial)
partial=1
dbscripts_options+=(--partial)
shift
;;
-a|--arch) -a|--arch)
(( $# <= 1 )) && die "missing argument for %s" "$1" (( $# <= 1 )) && die "missing argument for %s" "$1"
ARCH=$2 dbscripts_options+=(--arch "$2")
shift 2 shift 2
;; ;;
--noconfirm)
confirm=0
shift
;;
-*) -*)
die "invalid argument: %s" "$1" die "invalid argument: %s" "$1"
;; ;;
@@ -63,7 +92,62 @@ pkgctl_db_remove() {
REPO=$1 REPO=$1
shift shift
PKGBASES+=("$@") 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 # 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

@@ -1,234 +0,0 @@
#!/hint/bash
#
# SPDX-License-Identifier: GPL-3.0-or-later
[[ -z ${DEVTOOLS_INCLUDE_REBUILD_TODO_SH:-} ]] || return 0
DEVTOOLS_INCLUDE_REBUILD_TODO_SH=1
_DEVTOOLS_LIBRARY_DIR=${_DEVTOOLS_LIBRARY_DIR:-@pkgdatadir@}
source /usr/share/makepkg/util/util.sh
# shellcheck source=src/lib/repo/clone.sh
source "${_DEVTOOLS_LIBRARY_DIR}"/lib/repo/clone.sh
# shellcheck source=src/lib/build/build.sh
source "${_DEVTOOLS_LIBRARY_DIR}"/lib/build/build.sh
# shellcheck source=src/lib/release.sh
source "${_DEVTOOLS_LIBRARY_DIR}"/lib/release.sh
set -e
pkgctl_rebuild_todo_usage() {
local -r COMMAND=${_DEVTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
cat <<- _EOF_
Usage: ${COMMAND} [OPTIONS] URL
Rebuilds packages from a todo list.
OPTIONS
-h, --help Show this help text
-m, --message MSG Use the given <msg> as the commit message
-i, --ignore Give one or more pkgbases to ignore
-f, --maintainer Filter for one or more maintainers (orphan for orphan packages)
-o, --offload Build on a remote server and transfer artifacts afterwards
-e, --edit Edit PKGBUILD before building. Default when todo type is "Task"
-r, --repo REPO Specify a target repository (disables auto-detection)
-s, --staging Release to the staging counterpart of the auto-detected repo
-t, --testing Release to the testing counterpart of the auto-detected repo
-u, --db-update Automatically update the pacman database after uploading
--no-build Don't build PKGBUILD
--no-release Don't run commitpkg after building
EXAMPLES
TODO
_EOF_
}
pkgctl_rebuild_todo() {
if (( $# < 1 )); then
pkgctl_rebuild_todo_usage
exit 1
fi
local URL=""
local REPO=""
local MAINTAINERS=()
local IGNORE_PKGBASES=()
local FILTER_REPOSITORY=("extra")
local DRY_RUN=0
local MESSAGE_SET=0
local NO_RELEASE=0
local NO_BUILD=0
local RELEASE_OPTIONS=("--staging")
local BUILD_OPTIONS=("--staging" "--rebuild")
local packages
# option checking
while (( $# )); do
case $1 in
-h|--help)
pkgctl_rebuild_todo_usage
exit 0
;;
--dry-run)
DRY_RUN=1
shift 1
;;
-f|--maintainer)
(( $# <= 1 )) && die "missing argument for %s" "$1"
MAINTAINERS+=("$2")
shift 2
;;
-i|--ignore)
(( $# <= 1 )) && die "missing argument for %s" "$1"
IGNORE_PKGBASES+=("$2")
shift 2
;;
-o|--offload)
BUILD_OPTIONS+=("--offload")
shift
;;
-e|--edit)
BUILD_OPTIONS+=("--edit")
shift
;;
-m|--message)
(( $# <= 1 )) && die "missing argument for %s" "$1"
MESSAGE_SET=1
RELEASE_OPTIONS+=("--message" "$2")
shift 2
;;
-s|--staging)
RELEASE_OPTIONS+=("--staging")
shift
;;
-t|--testing)
RELEASE_OPTIONS+=("--testing")
shift
;;
--no-release)
NO_RELEASE=1
shift
;;
--no-build)
NO_BUILD=1
shift
;;
-*)
die "invalid option: %s" "$1"
;;
*)
if [[ ! "$1" == https* ]]; then
die "Missing url!"
fi
URL="$1"
if [[ ! "$URL" == */ ]]; then
URL+="/"
fi
if [[ ! "$URL" == *json ]]; then
URL+="json"
fi
break
;;
esac
done
# TODO: setup default values for options
while read -r json; do
readarray -t packages < <(jq --slurpfile repo <(printf '"%s" ' "${FILTER_REPOSITORY[@]}") \
--slurpfile maint <(printf '"%s" ' "${MAINTAINERS[@]}") \
-r '.created as $created
| .packages[]
| select(.status_str == "Incomplete" )
| select([.repo] | inside($repo))
| select(($maint[0] == "") or (($maint[0] == "orphan") and .maintainers == []) or (select(.maintainers | any([.] | inside($maint)))))
| "\(.pkgbase)"' \
- <<< "$json" | sort -u)
# This removes any elements we have ignored.... it's not pretty
readarray -t packages < <(comm -1 -3 <(printf "%s\n" "${IGNORE_PKGBASES[@]}" | sort) <(printf "%s\n" "${packages[@]}"| sort))
# Default to include the list name in the commit message
if (( ! MESSAGE_SET )); then
RELEASE_OPTIONS+=("--message" "$(jq -r '.name' - <<< "$json")")
fi
# If we are doing a Task we probably want to edit the PKGBUILD
if [[ "$(jq -r '.kind' - <<< "$json")" == "Task" ]]; then
BUILD_OPTIONS+=("--edit")
fi
done <<< "$(curl -s "$URL")"
if (( DRY_RUN )); then
msg "Would rebuild the following packages:"
msg2 '%s' "${packages[@]}"
msg "by running the following for each:"
if ! ((NO_BUILD)); then
msg2 "pkgctl build ${BUILD_OPTIONS[*]}"
fi
if ! ((NO_RELEASE)); then
msg2 "pkgctl release ${RELEASE_OPTIONS[*]}"
fi
exit 0
fi
if (( 0 == ${#packages[@]} )); then
die "No packages to rebuild!"
fi
msg "Rebuilding the following packages:"
msg2 '%s' "${packages[@]}"
msg "Press [Enter] to continue..."
read <&1
[[ -z ${WORKDIR:-} ]] && setup_workdir
pushd "$WORKDIR" &>/dev/null
# TODO set -j 1 to circumvent bug in repo clone
msg "Clone the pacakges"
if ! pkgctl_repo_clone -j 1 "${packages[@]}"; then
die "error while cloning packages"
fi
for pkg in "${packages[@]}"; do
pushd "$pkg" &>/dev/null
# This should help us figure out if the package is already built
readarray -t pkgs < <(makepkg --packagelist)
if [[ -f ${pkgs[0]} ]]; then
msg "${pkg[0]} has already been rebuilt!"
continue
fi
if ! ((NO_BUILD)); then
SKIP_BUILD=0
while true; do
# TODO: it seems like pkgctl build does not set the exit code correctly if (offload?) build fails
if pkgctl_build "${BUILD_OPTIONS[@]}"; then
break
fi
error "We failed to build! You are in a subshell to fix the build. Exit the shell to build again."
$SHELL || true
read -p "Skip build? [N/y] " -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]; then
SKIP_BUILD=1
break
fi
done
if ((SKIP_BUILD)); then
popd &>/dev/null
continue
fi
fi
if ! ((NO_RELEASE)); then
pkgctl_release "${RELEASE_OPTIONS[@]}"
fi
popd &>/dev/null
done
}

View File

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

View File

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

@@ -22,9 +22,11 @@ makepkg_source_package() {
return return
fi fi
( (
# shellcheck disable=SC2030 disable=SC2031
export LIBMAKEPKG_LINT_PKGBUILD_SH=1 export LIBMAKEPKG_LINT_PKGBUILD_SH=1
lint_pkgbuild() { :; } lint_pkgbuild() { :; }
# shellcheck disable=SC2030 disable=SC2031
export LIBMAKEPKG_SRCINFO_SH=1 export LIBMAKEPKG_SRCINFO_SH=1
write_srcinfo() { print_srcinfo; } write_srcinfo() { print_srcinfo; }
@@ -35,3 +37,21 @@ makepkg_source_package() {
source "$(command -v makepkg)" 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() { update_pacman_repo_cache() {
local repo=${1:-multilib}
mkdir -p "${_DEVTOOLS_PACMAN_CACHE_DIR}" mkdir -p "${_DEVTOOLS_PACMAN_CACHE_DIR}"
msg "Updating pacman database cache" msg "Updating pacman database cache"
lock 10 "${_DEVTOOLS_PACMAN_CACHE_DIR}.lock" "Locking 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}" \ --dbpath "${_DEVTOOLS_PACMAN_CACHE_DIR}" \
-Sy -Sy
lock_close 10 lock_close 10
@@ -29,6 +31,7 @@ update_pacman_repo_cache() {
get_pacman_repo_from_pkgbuild() { get_pacman_repo_from_pkgbuild() {
local path=${1:-PKGBUILD} local path=${1:-PKGBUILD}
local repo=${2:-multilib}
# shellcheck source=contrib/makepkg/PKGBUILD.proto # shellcheck source=contrib/makepkg/PKGBUILD.proto
mapfile -t pkgnames < <(source "${path}"; printf "%s\n" "${pkgname[@]}") 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 # update the pacman repo cache if it doesn't exist yet
if [[ ! -d "${_DEVTOOLS_PACMAN_CACHE_DIR}" ]]; then if [[ ! -d "${_DEVTOOLS_PACMAN_CACHE_DIR}" ]]; then
update_pacman_repo_cache update_pacman_repo_cache "${repo}"
fi fi
slock 10 "${_DEVTOOLS_PACMAN_CACHE_DIR}.lock" "Locking pacman database cache" slock 10 "${_DEVTOOLS_PACMAN_CACHE_DIR}.lock" "Locking pacman database cache"
# query repo of passed pkgname, specify --nodeps twice to skip all dependency checks # 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}" \ --dbpath "${_DEVTOOLS_PACMAN_CACHE_DIR}" \
--sync \ --sync \
--nodeps \ --nodeps \
@@ -58,3 +61,30 @@ get_pacman_repo_from_pkgbuild() {
printf "%s" "${repos[0]}" 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_INCLUDE_UTIL_PKGBUILD_SH=1
_DEVTOOLS_LIBRARY_DIR=${_DEVTOOLS_LIBRARY_DIR:-@pkgdatadir@} _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/message.sh
source /usr/share/makepkg/util/schema.sh
set -e set -eo pipefail
# set the pkgver variable in a PKGBUILD # 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 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 # show the cursor after stopping the spinner
term_cursor_show 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 # shellcheck disable=2034
DEVTOOLS_VALID_ARCHES=( DEVTOOLS_VALID_BINARY_ARCHES=(
x86_64 x86_64
)
# shellcheck disable=2034
DEVTOOLS_VALID_ARCHES=(
"${DEVTOOLS_VALID_BINARY_ARCHES[@]}"
any any
) )

View File

@@ -19,6 +19,7 @@ pkgctl_version_usage() {
COMMANDS COMMANDS
check Compares local package versions against upstream 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 upgrade Adjust the PKGBUILD to match the latest upstream version
OPTIONS OPTIONS
@@ -26,6 +27,7 @@ pkgctl_version_usage() {
EXAMPLES EXAMPLES
$ ${COMMAND} check libfoo linux libbar $ ${COMMAND} check libfoo linux libbar
$ ${COMMAND} setup libfoo
_EOF_ _EOF_
} }
@@ -57,6 +59,14 @@ pkgctl_version() {
pkgctl_version_upgrade "$@" pkgctl_version_upgrade "$@"
exit $? 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" die "invalid argument: %s" "$1"
;; ;;

View File

@@ -114,10 +114,6 @@ pkgctl_version_check() {
fi fi
pushd "${path}" >/dev/null pushd "${path}" >/dev/null
if [[ ! -f "PKGBUILD" ]]; then
die "No PKGBUILD found for ${path}"
fi
# update the current terminal spinner status # update the current terminal spinner status
(( ++current_item )) (( ++current_item ))
pkgctl_version_check_spinner \ pkgctl_version_check_spinner \
@@ -128,6 +124,13 @@ pkgctl_version_check() {
"${current_item}" \ "${current_item}" \
"${#pkgbases[@]}" "${#pkgbases[@]}"
if [[ ! -f "PKGBUILD" ]]; then
result="${BOLD}${path}${ALL_OFF}: no PKGBUILD found"
failure+=("${result}")
popd >/dev/null
continue
fi
# reset common PKGBUILD variables # reset common PKGBUILD variables
unset pkgbase pkgname arch source pkgver pkgrel validpgpkeys unset pkgbase pkgname arch source pkgver pkgrel validpgpkeys
# shellcheck source=contrib/makepkg/PKGBUILD.proto # shellcheck source=contrib/makepkg/PKGBUILD.proto
@@ -223,8 +226,8 @@ get_upstream_version() {
opts+=(--keyfile "${keyfile}") opts+=(--keyfile "${keyfile}")
fi fi
if ! output=$(nvchecker --file "${config}" --logger json "${opts[@]}" 2>&1 | \ if ! output=$(GIT_TERMINAL_PROMPT=0 nvchecker --file "${config}" --logger json "${opts[@]}" 2>&1 | \
jq --raw-output 'select(.level != "debug")'); then jq --raw-output 'select((.level != "debug") and (.event != "ignoring invalid version"))'); then
printf "failed to run nvchecker: %s" "${output}" printf "failed to run nvchecker: %s" "${output}"
return 1 return 1
fi fi
@@ -264,13 +267,13 @@ nvchecker_check_config() {
done done
# check if the config contains a pkgbase section # 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}" printf "missing pkgbase section in %s: %s" "${config}" "${pkgbase}"
return 1 return 1
fi fi
# check if the config contains any section other than pkgbase # 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}" printf "non-pkgbase section not supported in %s: %s" "${config}" "${property}"
return 1 return 1
fi 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 Upon execution, it automatically adjusts the PKGBUILD file, ensuring that the
pkgver field is set to match the latest version available from the upstream 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 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 Outputs a summary of upgraded packages, up-to-date packages, and any check
failures. failures.
OPTIONS OPTIONS
-v, --verbose Display results including up-to-date versions --no-update-checksums Disable computation and update of the checksums
-h, --help Show this help text -v, --verbose Display results including up-to-date versions
-h, --help Show this help text
EXAMPLES EXAMPLES
$ ${COMMAND} neovim vim $ ${COMMAND} neovim vim
@@ -50,6 +51,7 @@ pkgctl_version_upgrade() {
local verbose=0 local verbose=0
local exit_code=0 local exit_code=0
local current_item=0 local current_item=0
local update_checksums=1
while (( $# )); do while (( $# )); do
case $1 in case $1 in
@@ -57,6 +59,10 @@ pkgctl_version_upgrade() {
pkgctl_version_upgrade_usage pkgctl_version_upgrade_usage
exit 0 exit 0
;; ;;
--no-update-checksums)
update_checksums=0
shift
;;
-v|--verbose) -v|--verbose)
verbose=1 verbose=1
shift shift
@@ -105,19 +111,14 @@ pkgctl_version_upgrade() {
fi fi
pushd "${path}" >/dev/null pushd "${path}" >/dev/null
if [[ ! -f "PKGBUILD" ]]; then
die "No PKGBUILD found for ${path}"
fi
# update the current terminal spinner status
(( ++current_item )) (( ++current_item ))
pkgctl_version_upgrade_spinner \
"${status_dir}" \ if [[ ! -f "PKGBUILD" ]]; then
"${#up_to_date[@]}" \ result="${BOLD}${path}${ALL_OFF}: no PKGBUILD found"
"${#out_of_date[@]}" \ failure+=("${result}")
"${#failure[@]}" \ popd >/dev/null
"${current_item}" \ continue
"${#pkgbases[@]}" fi
# reset common PKGBUILD variables # reset common PKGBUILD variables
unset pkgbase pkgname arch source pkgver pkgrel validpgpkeys unset pkgbase pkgname arch source pkgver pkgrel validpgpkeys
@@ -125,6 +126,17 @@ pkgctl_version_upgrade() {
. ./PKGBUILD . ./PKGBUILD
pkgbase=${pkgbase:-$pkgname} 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 if ! result=$(get_upstream_version); then
result="${BOLD}${pkgbase}${ALL_OFF}: ${result}" result="${BOLD}${pkgbase}${ALL_OFF}: ${result}"
failure+=("${result}") failure+=("${result}")
@@ -153,6 +165,24 @@ pkgctl_version_upgrade() {
# change the PKGBUILD # change the PKGBUILD
pkgbuild_set_pkgver "${upstream_version}" pkgbuild_set_pkgver "${upstream_version}"
pkgbuild_set_pkgrel 1 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 fi
popd >/dev/null popd >/dev/null
@@ -231,6 +261,8 @@ pkgctl_version_upgrade_spinner() {
local failure_count=$4 local failure_count=$4
local current=$5 local current=$5
local total=$6 local total=$6
local pkgbase=$7
local message=$8
local percentage=$(( 100 * current / total )) local percentage=$(( 100 * current / total ))
local tmp_file="${status_dir}/tmp" local tmp_file="${status_dir}/tmp"
@@ -243,8 +275,10 @@ pkgctl_version_upgrade_spinner() {
"${failure_count}" > "${tmp_file}" "${failure_count}" > "${tmp_file}"
# print the progress status # print the progress status
printf "📡 Upgrading: %s/%s [%s] %%spinner%%" \ printf "📡 %s: %s\n" \
"${BOLD}${current}" "${total}" "${percentage}%${ALL_OFF}" \ "${pkgbase}" "${BOLD}${message}${ALL_OFF}" >> "${tmp_file}"
printf "⌛ Upgrading: %s/%s [%s] %%spinner%%" \
"${BOLD}${current}" "${total}" "${percentage}%${ALL_OFF}" \
>> "${tmp_file}" >> "${tmp_file}"
# swap the status file # swap the status file

View File

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

View File

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

View File

@@ -23,7 +23,7 @@ fi
repo=extra repo=extra
arch=x86_64 arch=x86_64
server=build.archlinux.org server=build.archlinux.org
rsyncopts=(-e ssh -c -h -L --progress --partial -y) rsyncopts=("${RSYNC_OPTS[@]}")
usage() { usage() {
cat <<- _EOF_ cat <<- _EOF_
@@ -107,6 +107,7 @@ mapfile -t files < <(
cd "$temp" && cd "$temp" &&
{ {
bsdtar --strip-components 1 -xvf - && bsdtar --strip-components 1 -xvf - &&
export LOGDEST="" &&
script -qefc "'"${archbuild_cmd[@]@Q}"'" /dev/null && script -qefc "'"${archbuild_cmd[@]@Q}"'" /dev/null &&
printf "%s\n" "" "-> build complete" && printf "%s\n" "" "-> build complete" &&
printf "\t%s\n" "$temp"/* printf "\t%s\n" "$temp"/*
@@ -120,14 +121,25 @@ mapfile -t files < <(
[[ -f "${file}" ]] && printf "%s\n" "${file}" ||: [[ -f "${file}" ]] && printf "%s\n" "${file}" ||:
done < <(makepkg --config <(cat "${makepkg_user_config}" "${makepkg_config}" 2>/dev/null) --packagelist) && done < <(makepkg --config <(cat "${makepkg_user_config}" "${makepkg_config}" 2>/dev/null) --packagelist) &&
printf "%s\n" "${temp}/PKGBUILD" printf "%s\n" "${temp}/PKGBUILD"
find "${temp}" -name "*.log"
') ')
if (( ${#files[@]} )); then if (( ${#files[@]} )); then
printf '%s\n' '' '-> copying files...' msg 'Downloading files...'
rsync "${rsyncopts[@]}" "${files[@]/#/$server:}" "${TEMPDIR}/" || die rsync "${rsyncopts[@]}" "${files[@]/#/$server:}" "${TEMPDIR}/" || die
mv "${TEMPDIR}"/*.pkg.tar* "${PKGDEST:-${PWD}}/"
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}/PKGBUILD" "${PWD}/"
mv "${TEMPDIR}"/*.pkg.tar* "${PKGDEST:-${PWD}}/"
else else
exit 1 exit 1
fi fi

View File

@@ -19,16 +19,15 @@ usage() {
Unified command-line frontend for devtools. Unified command-line frontend for devtools.
COMMANDS COMMANDS
aur Interact with the Arch User Repository aur Interact with the Arch User Repository
auth Authenticate with services like GitLab auth Authenticate with services like GitLab
build Build packages inside a clean chroot build Build packages inside a clean chroot
db Pacman database modification for package update, move etc db Pacman database modification for package update, move etc
diff Compare package files using different modes diff Compare package files using different modes
release Release step to commit, tag and upload build artifacts release Release step to commit, tag and upload build artifacts
repo Manage Git packaging repositories and their configuration repo Manage Git packaging repositories and their configuration
search Search for an expression across the GitLab packaging group search Search for an expression across the GitLab packaging group
rebuild-todo Rebuilds packages from a todo list. version Check and manage package versions against upstream
version Check and manage package versions against upstream
OPTIONS OPTIONS
-h, --help Show this help text -h, --help Show this help text
@@ -113,14 +112,6 @@ while (( $# )); do
pkgctl_release "$@" pkgctl_release "$@"
exit 0 exit 0
;; ;;
rebuild-todo)
_DEVTOOLS_COMMAND+=" $1"
shift
# shellcheck source=src/lib/rebuild-todo.sh
source "${_DEVTOOLS_LIBRARY_DIR}"/lib/rebuild-todo.sh
pkgctl_rebuild_todo "$@"
exit 0
;;
search) search)
_DEVTOOLS_COMMAND+=" $1" _DEVTOOLS_COMMAND+=" $1"
shift shift

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:

View File

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

View File

@@ -0,0 +1,16 @@
_hkgname=implicit-hie
pkgname=haskell-implicit-hie
pkgver=0.1.2.7
pkgrel=114
pkgdesc="Auto generate hie-bios cradles & hie.yaml"
url="https://github.com/Avi-D-coder/implicit-hie#readme"
license=("custom:BSD3")
arch=('x86_64')
depends=('ghc-libs' 'haskell-attoparsec' 'haskell-filepattern' 'haskell-yaml')
makedepends=('ghc' 'haskell-hspec' 'haskell-hspec-attoparsec')
source=("https://hackage.haskell.org/packages/archive/$_hkgname/$pkgver/$_hkgname-$pkgver.tar.gz")
sha512sums=('b0746867352b29dd2d4c4535ce6f4d61c3cc61ed31f3f18d49e3f657b12d470a9a53a7ef8a785a9e19b8ff12fb8d8b1cfa80c5c22c90af65bf4b39ab62bbd768')
package() {
:
}

View File

@@ -0,0 +1,3 @@
[haskell-implicit-hie]
source = "hackage"
hackage = "implicit-hie"

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,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,3 @@
[git-smash]
source = "cratesio"
cratesio = "shotgun"

View File

@@ -0,0 +1,27 @@
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() {
:
}

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,17 @@
pkgname=python-pyaml
pkgver=23.9.0
pkgrel=1
pkgdesc="PyYAML-based module to produce pretty and readable YAML-serialized data"
url="https://pypi.python.org/pypi/pyaml"
license=('BSD')
arch=('any')
depends=('python-yaml')
makedepends=('python-setuptools')
checkdepends=('python-unidecode')
optdepends=('python-unidecode: Needed if same-id objects or recursion is used within serialized data')
source=("https://pypi.io/packages/source/p/pyaml/pyaml-$pkgver.tar.gz")
sha512sums=('1ff23e07e45d6530b6666a26947362a6bb2125b731dd03501aafe9096766a38fec7906a36666c7974e49cedf9a91f5af0973827151c746933e7b969aeec56ab8')
package() {
:
}

View File

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

View File

@@ -0,0 +1,23 @@
pkgname=python-bleach
pkgver=6.1.0
pkgrel=1
pkgdesc="An easy whitelist-based HTML-sanitizing tool"
url="https://pypi.org/project/bleach/"
arch=('any')
license=('Apache')
depends=('python-packaging'
'python-six'
'python-webencodings')
makedepends=('python'
'python-setuptools')
checkdepends=('python-pytest')
optdepends=('python-tinycss2: for CSS sanitisation')
source=(https://pypi.org/packages/source/b/bleach/bleach-$pkgver.tar.gz)
sha256sums=('0a31f1837963c41d46bbf1331b8778e1308ea0791db03cc4e7357b97cf42a8fe')
package() {
:
}

View File

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

View File

@@ -0,0 +1,16 @@
pkgname=node-gyp
pkgver=10.0.1
pkgrel=1
pkgdesc='Node.js native addon build tool'
arch=('any')
url='https://github.com/nodejs/node-gyp'
license=('MIT')
depends=('nodejs' 'nodejs-nopt' 'python' 'semver')
makedepends=('npm')
source=("https://registry.npmjs.org/$pkgname/-/$pkgname-$pkgver.tgz")
noextract=("$pkgname-$pkgver.tgz")
sha512sums=('820dff6c77a141f662bd055fa88cb2f304dd4b2985f724f23f808989f2bbde29b234c53c008190136a546bb74d59f98c786f5c0d517679e86244cbf42c2d6202')
package() {
:
}

View File

@@ -0,0 +1,3 @@
[node-gyp]
source = "npm"
npm = "node-gyp"

View File

@@ -0,0 +1,16 @@
pkgname=ruby-diff-lcs
pkgver=0.3.5
pkgrel=8
pkgdesc='Allows custom language loaders to be hooked into require'
arch=('any')
url='http://polyglot.rubyforge.org/'
license=('MIT')
depends=('ruby')
options=('!emptydirs')
source=("https://rubygems.org/downloads/${pkgname#*-}-${pkgver}.gem")
noextract=("${pkgname#*-}-${pkgver}.gem")
sha256sums=('59d66ef5e3c166431c39cb8b7c1d02af419051352f27912f6a43981b3def16af')
package() {
:
}

View File

@@ -0,0 +1,3 @@
[ruby-diff-lcs]
source = "gems"
gems = "diff-lcs"

View File

@@ -0,0 +1,16 @@
pkgname=shotgun
pkgver=0.3.5
pkgrel=8
pkgdesc='Allows custom language loaders to be hooked into require'
arch=('any')
url='http://polyglot.rubyforge.org/'
license=('MIT')
depends=('ruby')
options=('!emptydirs')
source=("https://static.crates.io/crates/shotgun/shotgun-$pkgver.crate")
noextract=("${pkgname#*-}-${pkgver}.gem")
sha256sums=('59d66ef5e3c166431c39cb8b7c1d02af419051352f27912f6a43981b3def16af')
package() {
:
}

View File

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