mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04:00
makepkg: revert bash4-ism
Commit 3d67d9b1
introduced multiple bash4 string manipulations.
Revert those in order retain compatibility with bash-3.2 which
is still widely used.
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
6c00ca8f23
commit
c2cf6a14cf
@ -265,11 +265,11 @@ check_buildenv() {
|
|||||||
# ? - not found
|
# ? - not found
|
||||||
##
|
##
|
||||||
in_opt_array() {
|
in_opt_array() {
|
||||||
local needle="${1,,}"; shift
|
local needle=$(tr '[:upper:]' '[:lower:]' <<< $1); shift
|
||||||
|
|
||||||
local opt
|
local opt
|
||||||
for opt in "$@"; do
|
for opt in "$@"; do
|
||||||
opt="${opt,,}"
|
opt=$(tr '[:upper:]' '[:lower:]' <<< $opt)
|
||||||
if [[ $opt = $needle ]]; then
|
if [[ $opt = $needle ]]; then
|
||||||
echo 'y' # Enabled
|
echo 'y' # Enabled
|
||||||
return
|
return
|
||||||
@ -554,7 +554,7 @@ generate_checksums() {
|
|||||||
|
|
||||||
local integ
|
local integ
|
||||||
for integ in ${integlist[@]}; do
|
for integ in ${integlist[@]}; do
|
||||||
integ="${integ,,}"
|
integ=$(tr '[:upper:]' '[:lower:]' <<< "$integ")
|
||||||
case "$integ" in
|
case "$integ" in
|
||||||
md5|sha1|sha256|sha384|sha512) : ;;
|
md5|sha1|sha256|sha384|sha512) : ;;
|
||||||
*)
|
*)
|
||||||
@ -617,7 +617,7 @@ check_checksums() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if (( $found )) ; then
|
if (( $found )) ; then
|
||||||
local expectedsum="${integrity_sums[$idx],,}"
|
local expectedsum=$(tr '[:upper:]' '[:lower:]' <<< "${integrity_sums[$idx]}")
|
||||||
local realsum="$(openssl dgst -${integ} "$file")"
|
local realsum="$(openssl dgst -${integ} "$file")"
|
||||||
realsum="${realsum##* }"
|
realsum="${realsum##* }"
|
||||||
if [[ $expectedsum = $realsum ]]; then
|
if [[ $expectedsum = $realsum ]]; then
|
||||||
@ -1669,7 +1669,7 @@ if (( CLEANCACHE )); then
|
|||||||
echo -n "$(gettext " Are you sure you wish to do this? ")"
|
echo -n "$(gettext " Are you sure you wish to do this? ")"
|
||||||
echo -n "$(gettext "[y/N]")"
|
echo -n "$(gettext "[y/N]")"
|
||||||
read answer
|
read answer
|
||||||
answer="${answer^^}"
|
answer=$(tr '[:lower:]' '[:upper:]' <<< "$answer")
|
||||||
if [[ $answer = $(gettext YES) || $answer = $(gettext Y) ]]; then
|
if [[ $answer = $(gettext YES) || $answer = $(gettext Y) ]]; then
|
||||||
rm "$SRCDEST"/*
|
rm "$SRCDEST"/*
|
||||||
if (( $? )); then
|
if (( $? )); then
|
||||||
|
Loading…
Reference in New Issue
Block a user