pck-update (-a0): fix for the case where regexpr is ".*"

Signed-off-by: Davide Madrisan <davide.madrisan@gmail.com>
This commit is contained in:
Davide Madrisan 2012-04-14 22:08:51 +02:00
parent 2f6bd17716
commit 882c043dc4

View File

@ -51,15 +51,14 @@ function repository.get_srpm_pckname_from_HTML() {
local regexpr local regexpr
[[ "$pck_name" =~ ^[a-zA-Z0-9-]+$ ]] && \ [[ "$pck_name" =~ ^[a-zA-Z0-9-]+$ ]] && \
regexpr="^$pck_name-[^-]\+-[^-]\+$" || regexpr="$pck_name" regexpr="^$pck_name-[^-]\+-[^-]\+$" || regexpr="$pck_name"
notify.debug "$FUNCNAME: regexpr = \"$regexpr\""
local pckname_from_HTML=( $(sed -n "\ local pckname_from_HTML=( $(sed -n "\
# remove HTML tags --> get a better input # remove HTML tags --> get a better input
/<a href=\".*\.src\.rpm\"/{s|.*<a href=\"\([^\"]*\)\".*|\1|;bm;}; /<[aA] [hH][rR][eE][fF]=\".*\.src\.rpm\"/{
/<A HREF=\".*\.src\.rpm\"/{s|.*<A HREF=\"\([^\"]*\)\".*|\1|;bm;}; s|.*<[aA] [hH][rR][eE][fF]=\"\([^\"]*\)\".*|\1|
# exit loop (skip print) if the line do not match regexpr {/$regexpr/p}
/$regexpr/bm;be; }" $infile) )
:m;/$regexpr/p;:e" $infile) )
echo "${pckname_from_HTML[*]}" echo "${pckname_from_HTML[*]}"
} }