fix: do not set extglob globally to avoid side-effects
Instead only enable it for whatever operation requires them. Example sides effects: commitpkg can accidently execute PKGBUILD functions when sourcing the PKGBUILD that has function names like package_libsigc++() Fixes #87
This commit is contained in:
parent
280ef10d37
commit
fcaf3ecec0
|
@ -19,8 +19,6 @@ export LANG=C
|
||||||
export BUILDTOOL=devtools
|
export BUILDTOOL=devtools
|
||||||
export BUILDTOOLVER=m4_devtools_version
|
export BUILDTOOLVER=m4_devtools_version
|
||||||
|
|
||||||
shopt -s extglob
|
|
||||||
|
|
||||||
# check if messages are to be printed using color
|
# check if messages are to be printed using color
|
||||||
if [[ -t 2 && "$TERM" != dumb ]]; then
|
if [[ -t 2 && "$TERM" != dumb ]]; then
|
||||||
colorize
|
colorize
|
||||||
|
@ -142,12 +140,16 @@ pkgver_equal() {
|
||||||
find_cached_package() {
|
find_cached_package() {
|
||||||
local searchdirs=("$PWD" "$PKGDEST") results=()
|
local searchdirs=("$PWD" "$PKGDEST") results=()
|
||||||
local targetname=$1 targetver=$2 targetarch=$3
|
local targetname=$1 targetver=$2 targetarch=$3
|
||||||
local dir pkg pkgbasename name ver rel arch r results
|
local dir pkg packages pkgbasename name ver rel arch r results
|
||||||
|
|
||||||
for dir in "${searchdirs[@]}"; do
|
for dir in "${searchdirs[@]}"; do
|
||||||
[[ -d $dir ]] || continue
|
[[ -d $dir ]] || continue
|
||||||
|
|
||||||
for pkg in "$dir"/*.pkg.tar?(.!(sig|*.*)); do
|
shopt -s extglob nullglob
|
||||||
|
mapfile -t packages < <(printf "%s\n" "$dir"/*.pkg.tar?(.!(sig|*.*)))
|
||||||
|
shopt -u extglob nullglob
|
||||||
|
|
||||||
|
for pkg in "${packages[@]}"; do
|
||||||
[[ -f $pkg ]] || continue
|
[[ -f $pkg ]] || continue
|
||||||
|
|
||||||
# avoid adding duplicates of the same inode
|
# avoid adding duplicates of the same inode
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
shopt -s extglob
|
|
||||||
|
|
||||||
m4_include(lib/common.sh)
|
m4_include(lib/common.sh)
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
shopt -s extglob
|
|
||||||
|
|
||||||
m4_include(lib/common.sh)
|
m4_include(lib/common.sh)
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
m4_include(lib/common.sh)
|
m4_include(lib/common.sh)
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
shopt -s extglob
|
|
||||||
|
|
||||||
IGNORE_INTERNAL=0
|
IGNORE_INTERNAL=0
|
||||||
|
|
||||||
|
@ -43,7 +42,9 @@ fi
|
||||||
|
|
||||||
process_sofile() {
|
process_sofile() {
|
||||||
# extract the library name: libfoo.so
|
# extract the library name: libfoo.so
|
||||||
|
shopt -s extglob nullglob
|
||||||
soname="${sofile%.so?(+(.+([0-9])))}".so
|
soname="${sofile%.so?(+(.+([0-9])))}".so
|
||||||
|
shopt -u extglob nullglob
|
||||||
# extract the major version: 1
|
# extract the major version: 1
|
||||||
soversion="${sofile##*\.so\.}"
|
soversion="${sofile##*\.so\.}"
|
||||||
if [[ "$soversion" = "$sofile" ]] && ((IGNORE_INTERNAL)); then
|
if [[ "$soversion" = "$sofile" ]] && ((IGNORE_INTERNAL)); then
|
||||||
|
|
Loading…
Reference in New Issue