libnetwork.lib: make search case insensitive

Signed-off-by: Davide Madrisan <davide.madrisan@gmail.com>
This commit is contained in:
Davide Madrisan 2012-04-14 23:06:05 +02:00
parent a01ecd4950
commit 2461f2ef9b
2 changed files with 9 additions and 7 deletions

View File

@ -23,6 +23,9 @@ Changes in version 1.9.4 -
* i18n - Davide Madrisan:
Updated.
* lib/libnetwork.lib - Davide Madrisan:
repository.get_pckname_from_HTML: make package search case insensitive.
--------------------------------------------------------------------------------
Changes in version 1.9.3 - April Fools' Day Release

View File

@ -34,7 +34,7 @@ function repository.is_reachable() {
# function repository.get_srpm_pckname_from_HTML()
# ... ADDME ...
function repository.get_srpm_pckname_from_HTML() {
local pck_name="$1"
local pck_name="$(echo "$1" | tr A-Z a-z)"
local infile="$2"
[ "$pck_name" ] || notify.error $"\
@ -53,12 +53,11 @@ function repository.get_srpm_pckname_from_HTML() {
regexpr="^$pck_name-[^-]\+-[^-]\+$" || regexpr="$pck_name"
notify.debug "$FUNCNAME: regexpr = \"$regexpr\""
local pckname_from_HTML=( $(sed -n "\
# remove HTML tags --> get a better input
local pckname_from_HTML=($(tr A-Z a-z < $infile | \
sed -n "# remove HTML tags --> get a better input
/<[aA] [hH][rR][eE][fF]=\".*\.src\.rpm\"/{
s|.*<[aA] [hH][rR][eE][fF]=\"\([^\"]*\)\".*|\1|
{/$regexpr/p}
}" $infile) )
{/$regexpr/p}}"))
echo "${pckname_from_HTML[*]}"
}