Commit ed6f325d authored by Boria138's avatar Boria138 Committed by Vitaly Lipatov

Replace all echo for translate to message

parent ba060ded
......@@ -939,7 +939,7 @@ local orig=''
[ -n "$BUILD_ID" ] && [ "$DISTRIB_FULL_RELEASE" != "$BUILD_ID" ] && orig=" (orig. $BUILD_ID)"
local EV=''
[ -n "$EPMVERSION" ] && EV="(EPM version $EPMVERSION) "
message '
cat <<EOF
distro_info v$PROGVERSION $EV: Copyright © 2007-2024 Etersoft
Pretty name (--pretty): $(print_pretty_name)
......@@ -956,7 +956,7 @@ distro_info v$PROGVERSION $EV: Copyright © 2007-2024 Etersoft
Bug report URL (--bug-report-url): $(print_bug_report_url)
(run with -h to get help)
'
EOF
}
print_help()
......@@ -995,7 +995,7 @@ print_help()
# print code for eval with names for eepm
print_eepm_env()
{
message '
cat <<EOF
# -d | --base-distro-name
DISTRNAME="$(echo $DISTRIB_ID)"
# -v | --base-version
......@@ -1022,7 +1022,7 @@ DISTRMEMORY="$(get_memory_size)"
PKGVENDOR=$(pkgvendor)
RPMVENDOR=$(pkgvendor)
'
EOF
}
......
......@@ -54,7 +54,7 @@ load_helper()
local CMD="$SHAREDIR/$1"
# do not use fatal() here, it can be initial state
[ -r "$CMD" ] || { echo "FATAL: Have no $CMD helper file" ; exit 1; }
[ -r "$CMD" ] || { message "FATAL: Have no $CMD helper file" ; exit 1; }
eval "$shieldname=1"
# shellcheck disable=SC1090
. $CMD
......@@ -88,34 +88,36 @@ check_tty
phelp()
{
echo "$Descr
$Usage
$Usage"
Options:
message "Options:"
$(get_help HELPOPT)
Short commands:
message "Short commands:"
$(get_help HELPSHORT)
$(get_help HELPCMD)
message "
Examples:
$ epmi etckeeper install etckeeper package
$ epmqp lib print out all installed packages with 'lib' in a name
$ epmqf ip print out a package the command 'ip' from is
"
}
print_version()
{
echo "EPM package manager version $EPMVERSION Telegram: https://t.me/useepm https://wiki.etersoft.ru/Epm"
echo "Running on $DISTRNAME/$DISTRVERSION ('$PMTYPE' package manager uses '$PKGFORMAT' package format)"
echo "Copyright (c) Etersoft 2012-2024"
echo "This program may be freely redistributed under the terms of the GNU AGPLv3."
message 'EPM package manager version $EPMVERSION Telegram: https://t.me/useepm https://wiki.etersoft.ru/Epm
Running on $DISTRNAME/$DISTRVERSION ($PMTYPE package manager uses $PKGFORMAT package format)
Copyright (c) Etersoft 2012-2024
This program may be freely redistributed under the terms of the GNU AGPLv3.'
}
Usage="Usage: epm [options] <command> [package name(s), package files]..."
Descr="epm - EPM package manager"
Usage=$(eval_gettext "Usage: epm [options] <command> [package name(s), package files]...")
Descr=$(eval_gettext "epm - EPM package manager")
debug=
verbose=$EPM_VERBOSE
......
......@@ -26,11 +26,11 @@ __epm_addrepo_rhel()
{
local repo="$*"
if [ -z "$repo" ] ; then
echo "Add repo."
echo "1. Use with repository URL, f.i. http://www.example.com/example.repo"
echo "2. Use with epel to add EPEL repository"
echo "3. Use with powertools to add PowerTools repository"
echo "4. Use with crb to add Rocky Linux CRB repository"
message 'Add repo.
1. Use with repository URL, f.i. http://www.example.com/example.repo
2. Use with epel to add EPEL repository
3. Use with powertools to add PowerTools repository
4. Use with crb to add Rocky Linux CRB repository'
return 1
fi
case "$1" in
......@@ -325,10 +325,10 @@ __epm_addrepo_astra()
local repo="$*"
if [ -z "$repo" ] || [ "$repo" = "--help" ]; then
info "Add repo. You can use follow params:"
echo " distribution component name"
echo " full sources list line"
echo " URL version component"
message 'Add repo. You can use follow params:
distribution component name
full sources list line
URL version component'
return
fi
......@@ -391,12 +391,12 @@ __epm_addrepo_deb()
local repo="$*"
if [ -z "$repo" ] || [ "$repo" = "--help" ]; then
info "Add repo. You can use follow params:"
echo " docker - add official docker repo"
echo " ppa:<user>/<ppa-name> - add PPA repo"
echo " distribution component name"
echo " full sources list line"
echo " URL version component"
message 'Add repo. You can use follow params:
docker - add official docker repo
ppa:<user>/<ppa-name> - add PPA repo
distribution component name
full sources list line
URL version component'
return
fi
......
......@@ -32,7 +32,7 @@ case $BASEDISTRNAME in
# ALT Linux only
assure_exists /usr/share/apt/scripts/list-extras.lua apt-scripts
if [ -z "$dryrun" ] ; then
echo "We will try remove all installed packages which are missed in repositories"
message "We will try remove all installed packages which are missed in repositories"
warning "Use with caution!"
fi
epm Upgrade || fatal
......@@ -47,14 +47,14 @@ case $BASEDISTRNAME in
info "Retrieving packages installed via epm play ..."
local play_installed="$(epm play --list-installed-packages)"
if [ -n "$play_installed" ] ; then
echo "Skip follow packages installed via epm play: $(echo $play_installed | xargs -n1000 echo)"
message "Skip follow packages installed via epm play: $(echo $play_installed | xargs -n1000 echo)"
PKGLIST="$(estrlist exclude "$play_installed" "$PKGLIST")"
fi
# TODO: implement for other PMTYPE
local hold_packages="$(epm mark --short showhold)"
if [ -n "$hold_packages" ] ; then
echo "Skip follow packages on hold: $(echo $hold_packages | xargs -n1000 echo)"
message "Skip follow packages on hold: $(echo $hold_packages | xargs -n1000 echo)"
PKGLIST="$(estrlist exclude "$hold_packages" "$PKGLIST")"
fi
......@@ -67,7 +67,7 @@ case $BASEDISTRNAME in
info
docmd epm remove $dryrun $force $(subst_option non_interactive --auto) $PKGLIST
else
echo "There are no orphan packages in the system."
message "There are no orphan packages in the system."
fi
return 0
;;
......
......@@ -26,7 +26,7 @@ __epm_print_excluded()
local excluded
excluded="$(estrlist exclude "$pkgs" "$fullpkgs")"
if [ -n "$excluded" ] ; then
echo "Skipped manually installed:"
message "Skipped manually installed:"
estrlist union $excluded
fi
}
......@@ -204,10 +204,10 @@ __epm_autoremove_altrpm()
epm_autoremove_print_help()
{
echo "epm autoremove removes unneeded packages from the system"
echo "run 'epm autoremove' to use apt-get autoremove"
echo "or run 'epm autoremove --direct [group1] [group2] ...' to use epm implementation"
echo "Default groups: $epm_autoremove_default_groups"
message 'epm autoremove removes unneeded packages from the system
run epm autoremove to use apt-get autoremove
or run epm autoremove --direct [group1] [group2] ... to use epm implementation
Default groups: $epm_autoremove_default_groups'
message '
Supported package groups:
libs - unused libraries
......
......@@ -42,7 +42,7 @@ __epm_check_apt_db_days()
# note: duplicate __is_repo_info_downloaded
pkglists=$(find $LISTS -name "*_$pkg*" 2>/dev/null)
[ -n "$pkglists" ] && return
echo "never downloaded"
message "never downloaded"
return 1
fi
......@@ -60,11 +60,11 @@ __epm_check_apt_db_days()
local now=$(date +%s)
local days="$(( (now - ts) / (60 * 60 * 24) ))"
[ "$days" = "0" ] && return 0
[ "$days" = "1" ] && echo "1 day old" && return 1
echo "$days days old"
[ "$days" = "1" ] && message "1 day old" && return 1
message '$days days old'
else
# no any pkglist
echo "stalled"
message "stalled"
fi
return 1
}
......
......@@ -27,12 +27,12 @@ __alt_fix_triggers()
assure_exists time
touch $TDIR/added
for ft in $(ls /usr/lib/rpm/*.filetrigger | sort) ; do
echo "Try run $ft ..."
message "Try run $ft ..."
echo $TDIR/added $TDIR/removed | a='' time $ft
done
rm -f $TDIR/added fatal
rmdir $TDIR || fatal
echo "Count lines:"
message "Count lines:"
wc -l /var/lib/rpm/files-awaiting-filetriggers
}
......
......@@ -36,7 +36,7 @@ try_fix_apt_rpm_dupls()
local todel="$(rpm -q $pkg | head -n1)"
local todel2="$(rpm -q $pkg | head -n2 | tail -n1)"
if [ "$todel" = "$todel2" ] ; then
echo "Fix the same name duplicates for $pkg..."
message "Fix the same name duplicates for $pkg..."
sudocmd rpm -e "$todel" --allmatches --nodeps --justdb && epm install $pkg && continue
fi
# first use older package
......
......@@ -188,13 +188,13 @@ __epm_print_url_alt_check()
quiet=1
local buildtime=$(paoapi packages/$pkg | get_pao_var buildtime)
echo
echo "Latest release: $(paoapi packages/$pkg | get_pao_var sourcepackage) $buildtime"
message 'Latest release:' $(paoapi packages/$pkg | get_pao_var sourcepackage) $buildtime
__epm_print_url_alt "$1" | while read url ; do
eget --get-response $url >$tm || { echo "$url: missed" ; continue ; }
local http=$(cat $tm | grep "^HTTP" | sed -e "s|\r||g")
local lastdate=$(cat $tm | grep "^Last-Modified:" | sed -e "s|\r||g")
local size=$(cat $tm | grep "^Content-Length:" | sed -e "s|^Content-Length: ||g" | sed -e "s|\r||g")
echo "$url ($http $lastdate) Size: $size"
echo "$url ($http $lastdate) $(message "Size:") $size"
done
rm -f $tm
}
......
......@@ -103,7 +103,7 @@ __epm_korinf_install_eepm()
epm_epm_install_help()
{
echo "epm ei [URL] [packages] - install packages from EPM based Korinf repository"
message "epm ei [URL] [packages] - install packages from EPM based Korinf repository"
get_help HELPCMD $SHAREDIR/epm-epm_install
message '
......
......@@ -64,7 +64,7 @@ _alt_epm_history_print_group()
__alt_epm_history_removed()
{
echo "Removed packages history:"
message "Removed packages history:"
__alt_epm_history_uniq | while read pid ; do
date="$(_alt_epm_history_date $pid)"
removed="$(epm print shortname for $(__alt_epm_history_select $pid "removed") )"
......@@ -75,7 +75,7 @@ __alt_epm_history_removed()
__alt_epm_history_installed()
{
echo "Installed packages history:"
message "Installed packages history:"
__alt_epm_history_uniq | while read pid ; do
date="$(_alt_epm_history_date $pid)"
#epm print shortname for $(__alt_epm_history_select $pid "installed") | sed -e "s|^| |"
......@@ -87,7 +87,7 @@ __alt_epm_history_installed()
__alt_epm_history_updated()
{
echo "Updated packages history:"
message "Updated packages history:"
__alt_epm_history_uniq | while read pid ; do
date="$(_alt_epm_history_date $pid)"
#epm print shortname for $(__alt_epm_history_select $pid "installed") | sed -e "s|^| |"
......@@ -99,7 +99,7 @@ __alt_epm_history_updated()
epm_history_help()
{
echo "package management history"
message "package management history"
get_help HELPCMD $SHAREDIR/epm-history
message '
Examples:
......
......@@ -46,7 +46,7 @@ epm_kernel_update()
docmd epm install kernel
;;
apt-*)
echo "Skipping: kernel package will update during dist-upgrade"
message "Skipping: kernel package will update during dist-upgrade"
;;
*)
fatal "Have no suitable command for $PMTYPE"
......
......@@ -319,7 +319,7 @@ esac
epm_mark_help()
{
echo "mark is the interface for marking packages"
message "mark is the interface for marking packages"
get_help HELPCMD $SHAREDIR/epm-mark
message '
Examples:
......
......@@ -21,7 +21,7 @@ load_helper epm-sh-warmup
__epm_packages_help()
{
echo "package management list"
message "package management list"
get_help HELPCMD $SHAREDIR/epm-packages
message '
Examples:
......
......@@ -34,7 +34,7 @@ Options:
fi
if [ "$1" = "--list-all" ] || [ -z "$*" ] ; then
[ -n "$short" ] || [ -n "$quiet" ] || echo "Run with a name of a prescription to run:"
[ -n "$short" ] || [ -n "$quiet" ] || message "Run with a name of a prescription to run:"
__epm_play_list $psdir
exit
fi
......
......@@ -24,12 +24,12 @@ load_helper epm-reposave
assure_safe_run()
{
if [ "$TERM" = "linux" ] ; then
echo "You have the best choise to run the '# epm release-upgrade' from text console."
message "You have the best choise to run the '# epm release-upgrade' from text console."
return
fi
if [ "$TERM" != "screen" ] ; then
if [ -n "$force" ] ; then
echo "You force me running not under screen (TERM=$TERM now)! You can lost your system!"
message "You force me running not under screen (TERM=$TERM now)! You can lost your system!"
return
else
warning "It is very dangerous to upgrade to next release from a GUI (your TERM=$TERM)."
......@@ -50,7 +50,7 @@ assure_safe_run()
res="$(busctl get-property org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager KillUserProcesses)"
if [ "$res" = "b false" ] ; then
echo "Good news: systemd-logind will not kill your screen processes (KillUserProcesses=false)"
message "Good news: systemd-logind will not kill your screen processes (KillUserProcesses=false)"
return
else
if [ -n "$force" ] ; then
......
......@@ -236,7 +236,7 @@ epm_repack()
cp $repacked_pkgs "$EPMCURDIR"
if [ -z "$quiet" ] ; then
echo
echo "Adapted packages:"
message "Adapted packages:"
for i in $repacked_pkgs ; do
echo " $EPMCURDIR/$(basename "$i")"
done
......
......@@ -176,7 +176,7 @@ epm_addkey()
{
if [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ -z "$1" ] ; then
echo "Usage: $ epm repo addkey [name] [url] [fingerprint/gpgkey] [comment/name]"
message "Usage: $ epm repo addkey [name] [url] [fingerprint/gpgkey] [comment/name]"
return
fi
......
......@@ -19,7 +19,7 @@
epm_tool_help()
{
echo "Tools embedded in epm:"
message "Tools embedded in epm:"
get_help HELPCMD $SHAREDIR/epm-tool
message '
......
......@@ -50,10 +50,10 @@ load_helper epm-sh-functions
esu_print_help()
{
message '
cat <<EOF
esu - get root shell or run a command in root shell
Usage: esu [-c] [<command>]
'
EOF
}
......
......@@ -112,6 +112,7 @@ is_anyservice()
}
phelp()
{
echo "$Descr
......@@ -140,6 +141,7 @@ progname="${0##*/}"
Usage="Usage: $progname [options] [<service>] [<command>] [params]..."
Descr="serv - Service manager"
set_service_type
verbose=
......
......@@ -359,7 +359,7 @@ set_quiet()
eget_help()
{
message '
cat <<EOF
eget - wget like downloader wrapper with wildcard support in filename part of URL
Usage: eget [options] http://somesite.ru/dir/na*.log
......@@ -407,11 +407,11 @@ Examples:
$ eget -O myname ipfs://QmVRUjnsnxHWkjq91KreCpUk4D9oZEbMwNQ3rzdjwND5dR
$ eget --list http://ftp.somesite.ru/package-*.tar
$ eget --check-url http://ftp.somesite.ru/test
$ eget --list http://download.somesite.ru "package-*.tar.xz"
$ eget --list --latest https://github.com/telegramdesktop/tdesktop/releases "tsetup.*.tar.xz"
'
}
$ eget --list http://download.somesite.ru 'package-*.tar.xz'
$ eget --list --latest https://github.com/telegramdesktop/tdesktop/releases 'tsetup.*.tar.xz'
EOF
}
if [ -z "$1" ] ; then
echo "eget - wget like downloader wrapper with wildcard support, uses wget or curl as backend" >&2
......@@ -1206,7 +1206,6 @@ url_get_filename()
fi
if [ -n "$ipfs_mode" ] && [ -n "$EGET_IPFS_DB" ] && ! is_ipfsurl "$1" ; then
download_to_ipfs()
......
......@@ -393,4 +393,3 @@ case $cmd in
fatal "Unknown command $1"
;;
esac
......@@ -27,6 +27,7 @@ usage() {
echo
}
parse_options() {
set -- "$@"
local ARGN=$#
......
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