Commit ae191b80 authored by Vitaly Lipatov's avatar Vitaly Lipatov

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

parent e429ac5a
...@@ -430,6 +430,7 @@ __epm_addrepo_altlinux() ...@@ -430,6 +430,7 @@ __epm_addrepo_altlinux()
__epm_addrepo_astra() __epm_addrepo_astra()
{ {
local repo="$*" local repo="$*"
local distrname="$1"
if [ -z "$repo" ] || [ "$repo" = "--help" ]; then if [ -z "$repo" ] || [ "$repo" = "--help" ]; then
message 'Add repo. You can use follow params: message 'Add repo. You can use follow params:
...@@ -443,7 +444,7 @@ __epm_addrepo_astra() ...@@ -443,7 +444,7 @@ __epm_addrepo_astra()
# keywords # keywords
# https://wiki.astralinux.ru/pages/viewpage.action?pageId=3276859 # https://wiki.astralinux.ru/pages/viewpage.action?pageId=3276859
case "$1-$reponame" in case "$distrname-$reponame" in
astra-1.7_x86-64) astra-1.7_x86-64)
# TODO epm repo change http / https # TODO epm repo change http / https
epm install --skip-installed apt-transport-https ca-certificates || fatal epm install --skip-installed apt-transport-https ca-certificates || fatal
...@@ -477,7 +478,7 @@ __epm_addrepo_astra() ...@@ -477,7 +478,7 @@ __epm_addrepo_astra()
return return
;; ;;
astra-*) astra-*)
fatal 'Unsupported distro version $1-$reponame, see # epm print info output.' fatal 'Unsupported distro version $distrname-$reponame, see # epm print info output.'
;; ;;
esac esac
......
...@@ -44,8 +44,9 @@ __epm_changelog_files() ...@@ -44,8 +44,9 @@ __epm_changelog_files()
{ {
[ -z "$*" ] && return [ -z "$*" ] && return
local pkg="$1"
# TODO: detect every file # TODO: detect every file
case $(get_package_type $1) in case $(get_package_type $pkg) in
rpm) rpm)
assure_exists rpm assure_exists rpm
docmd_foreach "rpm -q -p --changelog" $@ docmd_foreach "rpm -q -p --changelog" $@
...@@ -54,7 +55,7 @@ __epm_changelog_files() ...@@ -54,7 +55,7 @@ __epm_changelog_files()
__epm_changelog_dpkg "$@" __epm_changelog_dpkg "$@"
;; ;;
*) *)
fatal 'Have no suitable command for $1 in epm_changelog()' fatal 'Have no suitable command for $pkg in epm_changelog()'
;; ;;
esac esac
} }
......
...@@ -30,6 +30,7 @@ __alt_local_content_filelist() ...@@ -30,6 +30,7 @@ __alt_local_content_filelist()
load_helper epm-sh-altlinux-contents-index load_helper epm-sh-altlinux-contents-index
load_helper epm-check_updated_repo load_helper epm-check_updated_repo
local pkg="$1"
check_alt_contents_index || init_alt_contents_index check_alt_contents_index || init_alt_contents_index
update_repo_if_needed update_repo_if_needed
local CI="$(cat $ALT_CONTENTS_INDEX_LIST)" local CI="$(cat $ALT_CONTENTS_INDEX_LIST)"
...@@ -40,8 +41,8 @@ __alt_local_content_filelist() ...@@ -40,8 +41,8 @@ __alt_local_content_filelist()
OUTCMD="cat" OUTCMD="cat"
{ {
[ -n "$USETTY" ] && info "Search in $CI for $1..." [ -n "$USETTY" ] && info 'Search in $CI for $pkg...'
ercat $CI | grep -h -P -- ".*\t$1$" | sed -e "s|\(.*\)\t\(.*\)|\1|g" ercat $CI | grep -h -P -- ".*\t$pkg$" | sed -e "s|\(.*\)\t\(.*\)|\1|g"
} | $OUTCMD } | $OUTCMD
} }
......
...@@ -36,14 +36,15 @@ __abs_filename() ...@@ -36,14 +36,15 @@ __abs_filename()
__do_query_real_file() __do_query_real_file()
{ {
local TOFILE local TOFILE
local file="$1"
# get canonical path # get canonical path
if [ -e "$1" ] ; then if [ -e "$file" ] ; then
TOFILE="$(__abs_filename "$1")" TOFILE="$(__abs_filename "$file")"
else else
TOFILE="$(print_command_path "$1" || echo "$1")" TOFILE="$(print_command_path "$file" || echo "$file")"
if [ "$TOFILE" = "$1" ] ; then if [ "$TOFILE" = "$file" ] ; then
fatal 'File '$TOFILE' is missing in '$PATH fatal 'File $TOFILE is missing in $PATH'
else else
# work against usrmerge # work against usrmerge
local t="$(realpath "$(dirname "$TOFILE")")/$(basename "$TOFILE")" #" local t="$(realpath "$(dirname "$TOFILE")")/$(basename "$TOFILE")" #"
...@@ -51,7 +52,7 @@ __do_query_real_file() ...@@ -51,7 +52,7 @@ __do_query_real_file()
#info " > $TOFILE is placed as $t" #info " > $TOFILE is placed as $t"
TOFILE="$t" TOFILE="$t"
fi fi
info " > $1 is placed as $TOFILE" info ' > $file is placed as $TOFILE'
fi fi
fi fi
......
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