libspec.lib: Correctly parse lines containing more complex 'obsoletes' directives
Signed-off-by: Davide Madrisan <davide.madrisan@gmail.com>
This commit is contained in:
parent
9cc2f35855
commit
f086d23cce
@ -36,8 +36,9 @@ Changes in version 1.9.1
|
||||
|
||||
+ bugfix
|
||||
* lib/libspec.lib - Davide Madrisan:
|
||||
Workaround the problem of lines containing an 'Obsoletes' followed by a '<='
|
||||
(or similar) operator.
|
||||
Correctly parse lines containing more complex 'obsoletes' directives, like
|
||||
the following one:
|
||||
Obsoletes: pck1 <= <v1>[,] pck2 > <v2>
|
||||
(Bug discovered by Silvan Calarco)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
@ -1087,16 +1087,26 @@ rpmvars.solve "$filesname" "$specfile")" )
|
||||
continue
|
||||
fi
|
||||
|
||||
case ${tok[0]} in
|
||||
local currtok skiptok=0
|
||||
case "${tok[0]}" in
|
||||
Obsoletes|Obsoletes:)
|
||||
unset tok[0]
|
||||
notify.debug "\
|
||||
$FUNCNAME: * entry found at line $linenum: \"${tok[*]}\""
|
||||
SPEC_OBSOLETES[${#SPEC_OBSOLETES[*]}]="\"\
|
||||
$(rpmvars.solve "${tok[*]}" "$specfile")\""
|
||||
|
||||
notify.debug "\
|
||||
# NOTE: accept lines like: Obsoletes: pck1 <= 1, pck2 > 2
|
||||
for currtok in ${tok[*]}; do
|
||||
[ $skiptok -gt 0 ] &&
|
||||
{ skiptok="$(($skiptok-1))"; continue; }
|
||||
case "$currtok" in
|
||||
"<"|">"|"<="|">=")
|
||||
skiptok="1"; continue ;;
|
||||
",") skiptok="0"; continue ;;
|
||||
esac
|
||||
tok_pck="$(rpmvars.solve "$currtok" "$specfile")"
|
||||
SPEC_OBSOLETES[${#SPEC_OBSOLETES[*]}]="\"$currtok\""
|
||||
notify.debug "\
|
||||
$FUNCNAME: SPEC_OBSOLETES = ( ${SPEC_OBSOLETES[*]} )"
|
||||
done
|
||||
;;
|
||||
esac
|
||||
done < $specfile
|
||||
|
Loading…
Reference in New Issue
Block a user