Skip to content

Commit 95b627b

Browse files
committed
Handle regexp special characters in package name
1 parent 2298567 commit 95b627b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

configure

+5-3
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ XSC=
1414
_append=""
1515
RCV=`command -v xbps-checkvers 2>/dev/null`
1616
RCV_F="repo-checkvers.txt"
17-
RCV_FPV="repo-checkvers-pkgver.txt"
1817
RCV_FR="repo-checkvers-remove.txt"
1918
TOBUILD=
2019
_TOBUILD=
2120
USAGE="Usage: $0 [-a cross-arch] [-CN] [-R repo] [-d|-m|-h dir]"
21+
declare -A PKGVER_ASSOC
2222

2323
[ -f $RCV ] || {
2424
printf "ERROR: The 'xbps-checkvers' was not found in the PATH.\n"
@@ -128,7 +128,9 @@ case "$?" in
128128
grep pkgname "$RCV_F" | awk '{ print $2 }' >pkgs.txt ;;
129129
1) # version >= 0.54
130130
cut -d' ' -f1 "$RCV_F" >pkgs.txt
131-
cut -d' ' -f1-2 "$RCV_F" > "$RCV_FPV"
131+
while read -r pkgname version remainder; do
132+
PKGVER_ASSOC[$pkgname]=$version
133+
done < "$RCV_F"
132134
;;
133135
*)
134136
echo "ERROR: couldn't determine xbps-checkvers version"
@@ -155,7 +157,7 @@ for p in `cat pkgs.txt`; do
155157
touch tobuild/$p
156158
;;
157159
2)
158-
version="$(grep "^$p " < $RCV_FPV | tail -n 1 | cut -d' ' -f2)"
160+
version=${PKGVER_ASSOC[$p]}
159161
TOREMOVE+="$p-$version "
160162
TOREMOVE+="$p-dbg-$version "
161163
[ "$XBPS_ARCH" = i686 ] && TOREMOVE32BIT+="$p-32bit-$version "

0 commit comments

Comments
 (0)