From 2f6bd1771670406d186ab48ace2ad4092170c738 Mon Sep 17 00:00:00 2001 From: Davide Madrisan Date: Sat, 14 Apr 2012 19:59:19 +0200 Subject: [PATCH] pck-update (-a0): fully support generic regexpr Signed-off-by: Davide Madrisan --- lib/libnetwork.lib.in | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/lib/libnetwork.lib.in b/lib/libnetwork.lib.in index b014be2..97f1d7b 100644 --- a/lib/libnetwork.lib.in +++ b/lib/libnetwork.lib.in @@ -31,9 +31,9 @@ function repository.is_reachable() { return $? } -# function repository.get_pckname_from_HTML() +# function repository.get_srpm_pckname_from_HTML() # ... ADDME ... -function repository.get_pckname_from_HTML() { +function repository.get_srpm_pckname_from_HTML() { local pck_name="$1" local infile="$2" @@ -48,13 +48,17 @@ function repository.get_pckname_from_HTML() { notify.debug "$FUNCNAME: infile = \"$infile\"" + local regexpr + [[ "$pck_name" =~ ^[a-zA-Z0-9-]+$ ]] && \ + regexpr="^$pck_name-[^-]\+-[^-]\+$" || regexpr="$pck_name" + local pckname_from_HTML=( $(sed -n "\ - # remove HTML tags --> get a better input - / get a better input + /