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