Compare commits

..

4 Commits

Author SHA1 Message Date
Levente Polyak
248cdf7ff2 Version 20221012 2022-10-12 21:40:39 +02:00
Levente Polyak
04a821dddf common: prevent globbing and word splitting in find_cached_package
We changed the glob in 5d02c6df7f
but we forgot to quote the newly introduced variables.
2022-10-12 21:29:30 +02:00
Mike Yuan
d82bc69716 makechrootpkg: fix short option handling for makepkg_args
Currently, when multiple short options are passed as a single argument,
only the one that matches the first case statement will be parsed. This
shall be fixed by using switch-case resume.
2022-10-13 00:10:17 +08:00
Felix Yan
5d02c6df7f common: improve performance of find_cached_package
find_cached_package was unnecessarily looping over all packages which
uses a lot of CPU and could be exceptionally slow when PKGDEST contains
a lot of packages.

Fix this by adding the target pkgname, pkgver and arch to the glob and
only process potential candidates.
2022-10-11 20:25:08 +02:00
3 changed files with 5 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
V=20221002
V=20221012
BUILDTOOLVER ?= $(V)
PREFIX = /usr/local

View File

@@ -146,7 +146,7 @@ find_cached_package() {
[[ -d $dir ]] || continue
shopt -s extglob nullglob
mapfile -t packages < <(printf "%s\n" "$dir"/*.pkg.tar?(.!(sig|*.*)))
mapfile -t packages < <(printf "%s\n" "$dir"/"${targetname}"-"${targetver}"-*"${targetarch}".pkg.tar?(.!(sig|*.*)))
shopt -u extglob nullglob
for pkg in "${packages[@]}"; do

View File

@@ -311,14 +311,14 @@ fi
# Pass all arguments after -- right to makepkg
makepkg_args+=("${@:$OPTIND}")
# See if -R or -e was passed to makepkg
# See if -R, -e or -A was passed to makepkg
for arg in "${@:$OPTIND}"; do
case ${arg%%=*} in
--skip*|--holdver|--ignorearch) verifysource_args+=("$arg") ;;
--repackage|--noextract) keepbuilddir=1 ;;
--*) ;;
-*A*) verifysource_args+=(-A) ;;
-*R*|-*e*) keepbuilddir=1 ;;
-*A*) verifysource_args+=(-A) ;;&
-*R*|-*e*) keepbuilddir=1 ;;&
esac
done