Commit 7e427d4c authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm: use named variable instead of $1 in messages (3)

parent ae191b80
......@@ -105,9 +105,11 @@ get_url_to_etersoft_mirror()
# "comment" "file"
__add_to_contents_index_list()
{
[ -n "$verbose" ] && info "Put $1 -> $2"
[ -s "$2" ] || return
echo "$2" >>$ALT_CONTENTS_INDEX_LIST
local comment="$1"
local file="$2"
[ -n "$verbose" ] && info 'Put $comment -> $file'
[ -s "$file" ] || return
echo "$file" >>$ALT_CONTENTS_INDEX_LIST
}
# "comment" file file2
......
......@@ -839,8 +839,9 @@ eget()
fetch_url()
{
info "Fetching $1 ..."
eget -q -O- "$1"
local url="$1"
info 'Fetching $url ...'
eget -q -O- "$url"
}
# FIXME:
......@@ -917,13 +918,14 @@ parse_json_value()
# URL/file ["version"]
get_json_value()
{
if is_url "$1" ; then
local src="$1"
if is_url "$src" ; then
local toutput
toutput="$(fetch_url "$1")" || return
toutput="$(fetch_url "$src")" || return
echo "$toutput" | parse_json_value "$2"
else
[ -s "$1" ] || fatal "File $1 is missing, can't get JSON"
parse_json_value "$2" < "$1"
[ -s "$src" ] || fatal 'File $src is missing, can'\''t get JSON'
parse_json_value "$2" < "$src"
fi
}
......@@ -946,13 +948,14 @@ parse_json_object_keys()
# URL/file ["version"]
get_json_values()
{
if is_url "$1" ; then
local src="$1"
if is_url "$src" ; then
local toutput
toutput="$(fetch_url "$1")" || return
toutput="$(fetch_url "$src")" || return
echo "$toutput" | parse_json_values "$2"
else
[ -s "$1" ] || fatal "File $1 is missing, can't get JSON"
parse_json_values "$2" < "$1"
[ -s "$src" ] || fatal 'File $src is missing, can'\''t get JSON'
parse_json_values "$2" < "$src"
fi
}
......@@ -1199,9 +1202,10 @@ is_active_systemd()
assure_distr()
{
local distr="$1"
local TEXT="this option"
[ -n "$2" ] && TEXT="$2"
[ "$DISTRNAME" = "$1" ] || fatal "$TEXT supported only for $1 distro"
[ "$DISTRNAME" = "$distr" ] || fatal '$TEXT supported only for $distr distro'
}
# return delimiter sign in depend of package type
......
......@@ -114,10 +114,11 @@ get_pao_url()
query_altlinux_url()
{
local URL
local pkg="$1"
case $PMTYPE in
*-rpm)
local srpm=$(print_srcname "$1")
[ -n "$srpm" ] || fatal 'Can'\''t get source name for $1'
local srpm=$(print_srcname "$pkg")
[ -n "$srpm" ] || fatal 'Can'\''t get source name for $pkg'
echo "$(get_pao_url)/$srpm"
return
;;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment