Commit 25b43a4f authored by Vitaly Lipatov's avatar Vitaly Lipatov

commit packed 3.61.5

parent 6f89be92
...@@ -34,7 +34,7 @@ SHAREDIR=$PROGDIR ...@@ -34,7 +34,7 @@ SHAREDIR=$PROGDIR
# will replaced with /etc/eepm during install # will replaced with /etc/eepm during install
CONFIGDIR=$PROGDIR/../etc CONFIGDIR=$PROGDIR/../etc
EPMVERSION="3.61.4" EPMVERSION="3.61.5"
# package, single (file), pipe, git # package, single (file), pipe, git
EPMMODE="package" EPMMODE="package"
...@@ -138,7 +138,7 @@ restore_color() ...@@ -138,7 +138,7 @@ restore_color()
echover() echover()
{ {
[ -z "$verbose" ] && return [ -z "$verbose" ] && return
echo "$*" >&2 echog "$*" >&2
} }
echon() echon()
...@@ -346,39 +346,46 @@ sudoepm() ...@@ -346,39 +346,46 @@ sudoepm()
sudorun $CMDSHELL $bashopt $PROGDIR/$PROGNAME --inscript "$@" sudorun $CMDSHELL $bashopt $PROGDIR/$PROGNAME --inscript "$@"
} }
echog()
{
if [ "$1" = "-n" ] ; then
shift
eval_gettext "$*"
else
eval_gettext "$*"; echo
fi
}
fatal() fatal()
{ {
local PROMOMESSAGE="$EPMPROMOMESSAGE" local PROMOMESSAGE="$EPMPROMOMESSAGE"
[ -n "$PROMOMESSAGE" ] || PROMOMESSAGE=" (you can discuss the epm $EPMVERSION problem in Telegram: https://t.me/useepm)" [ -n "$PROMOMESSAGE" ] || PROMOMESSAGE=" (you can discuss the epm $EPMVERSION problem in Telegram: https://t.me/useepm)"
if [ -z "$TEXTDOMAIN" ] ; then
set_color $RED >&2 set_color $RED >&2
echo -n "ERROR: " >&2 echog -n "ERROR: " >&2
restore_color >&2 restore_color >&2
echo "$* $PROMOMESSAGE" >&2 echog "$* $PROMOMESSAGE" >&2
fi
exit 1 exit 1
} }
debug() debug()
{ {
[ -n "$debug" ] || return [ -n "$debug" ] || return
if [ -z "$TEXTDOMAIN" ] ; then
set_color $YELLOW >&2 set_color $YELLOW >&2
echo -n "WARNING: " >&2 echog -n "WARNING: " >&2
restore_color >&2 restore_color >&2
echo "$*" >&2 echog "$*" >&2
fi
} }
warning() warning()
{ {
if [ -z "$TEXTDOMAIN" ] ; then set_color $YELLOW >&2
set_color $YELLOW >&2 echog -n "WARNING: " >&2
echo -n "WARNING: " >&2 restore_color >&2
restore_color >&2 echog "$*" >&2
echo "$*" >&2
fi
} }
info() info()
...@@ -388,9 +395,9 @@ info() ...@@ -388,9 +395,9 @@ info()
# print message to stderr if stderr forwarded to (a file) # print message to stderr if stderr forwarded to (a file)
if isatty2 ; then if isatty2 ; then
isatty || return 0 isatty || return 0
echo "$*" echog "$*"
else else
echo "$*" >&2 echog "$*" >&2
fi fi
} }
...@@ -1030,6 +1037,23 @@ check_core_commands() ...@@ -1030,6 +1037,23 @@ check_core_commands()
is_command sed || fatal "Can't find sed command (sed package is missed?)" is_command sed || fatal "Can't find sed command (sed package is missed?)"
} }
export TEXTDOMAIN=eepm
if [ "$EPMMODE" = "git" ] ; then
TEXTDOMAINDIR=$PROGDIR/../po
else
TEXTDOMAINDIR='/usr/share/locale'
fi
export TEXTDOMAINDIR
if [ -d "$TEXTDOMAINDIR" ] && is_command gettext.sh ; then
. gettext.sh
else
eval_gettext()
{
echo -n $@
}
fi
# File bin/epm-addrepo: # File bin/epm-addrepo:
...@@ -1186,24 +1210,24 @@ __epm_addrepo_altlinux_help() ...@@ -1186,24 +1210,24 @@ __epm_addrepo_altlinux_help()
cat <<EOF cat <<EOF
epm repo add - add branch repo. Use follow params: epm repo add - add branch repo. Use follow params:
basealt - for BaseALT repo" basealt - for BaseALT repo
altsp - add ALT SP repo" altsp - add ALT SP repo
yandex - for BaseALT repo mirror hosted by Yandex (recommended)" yandex - for BaseALT repo mirror hosted by Yandex (recommended)
autoimports - for BaseALT autoimports repo" autoimports - for BaseALT autoimports repo
autoports - for Autoports repo (with packages from Sisyphus rebuilt to the branch) autoports - for Autoports repo (with packages from Sisyphus rebuilt to the branch)
altlinuxclub - for altlinuxclub repo (http://altlinuxclub.ru/)" altlinuxclub - for altlinuxclub repo (http://altlinuxclub.ru/)
deferred - for Etersoft Sisyphus Deferred repo" deferred - for Etersoft Sisyphus Deferred repo
deferred.org - for Etersoft Sisyphus Deferred repo (at mirror.eterfund.org)" deferred.org - for Etersoft Sisyphus Deferred repo (at mirror.eterfund.org)
etersoft - for LINUX@Etersoft repo" etersoft - for LINUX@Etersoft repo
korinf - for Korinf repo" korinf - for Korinf repo
<task number> - add task repo" <task number> - add task repo
archive 2018/02/09 - add archive of the repo from that date" archive 2018/02/09 - add archive of the repo from that date
/dir/to/repo [component] - add repo dir generated with epm repo index --init" /dir/to/repo [component] - add repo dir generated with epm repo index --init
URL [arch] [component] - add repo by URL" URL [arch] [component] - add repo by URL
Examples: Examples:
# epm repo add yandex # epm repo add yandex
# epm repo add "rpm http://somesite/pub/product x86_64 addon" # epm repo add "rpm http://somesite/pub/product x86_64 addon
# epm repo add /var/ftp/pub/altlinux/p10 # epm repo add /var/ftp/pub/altlinux/p10
EOF EOF
...@@ -5661,13 +5685,13 @@ epm_mark() ...@@ -5661,13 +5685,13 @@ epm_mark()
showhold) # HELPCMD: print the list of packages on hold showhold) # HELPCMD: print the list of packages on hold
epm_mark_showhold "$@" epm_mark_showhold "$@"
;; ;;
checkhold) # HELPCMD: return true if the package is on hold checkhold) # HELPCMD: return true if the package is on hold
epm_mark_checkhold "$@" epm_mark_checkhold "$@"
;; ;;
auto) # HELPCMD: mark the given package(s) as automatically installed auto|remove) # HELPCMD: mark the given package(s) as automatically installed
epm_mark_auto "$@" epm_mark_auto "$@"
;; ;;
manual) # HELPCMD: mark the given package(s) as manually installed manual|install) # HELPCMD: mark the given package(s) as manually installed
epm_mark_manual "$@" epm_mark_manual "$@"
;; ;;
showauto) # HELPCMD: print the list of automatically installed packages showauto) # HELPCMD: print the list of automatically installed packages
...@@ -8477,6 +8501,7 @@ epm_release_upgrade() ...@@ -8477,6 +8501,7 @@ epm_release_upgrade()
sudocmd dnf clean all sudocmd dnf clean all
sudocmd dnf --allowerasing distro-sync sudocmd dnf --allowerasing distro-sync
return return
;;
"ROSA") "ROSA")
# TODO: move to distro related upgrade # TODO: move to distro related upgrade
#epm repo remove all #epm repo remove all
...@@ -12952,8 +12977,6 @@ esac ...@@ -12952,8 +12977,6 @@ esac
__epm_update() __epm_update()
{ {
[ -z "$*" ] || fatal "No arguments are allowed for epm update command"
info "Running update the package index files from remote package repository database ..." info "Running update the package index files from remote package repository database ..."
local ret=0 local ret=0
...@@ -13068,6 +13091,12 @@ epm_update() ...@@ -13068,6 +13091,12 @@ epm_update()
return return
fi fi
# update with args is the alias for upgrade
if [ -n "$*" ] ; then
epm upgrade "$@"
return
fi
__epm_update "$@" || return __epm_update "$@" || return
__epm_touch_pkg __epm_touch_pkg
...@@ -15083,6 +15112,19 @@ check_ipfs_gateway() ...@@ -15083,6 +15112,19 @@ check_ipfs_gateway()
return 1 return 1
} }
select_ipfs_gateway()
{
# check public http gateways
for ipfs_gateway in $ipfs_gateways ; do
check_ipfs_gateway $ipfs_gateway || continue
IPFS_GATEWAY="$ipfs_gateway"
return
done
ipfs_mode="disabled"
return 1
}
select_ipfs_mode() select_ipfs_mode()
{ {
...@@ -15121,15 +15163,7 @@ select_ipfs_mode() ...@@ -15121,15 +15163,7 @@ select_ipfs_mode()
return return
fi fi
# check public http gateways select_ipfs_gateway
for ipfs_gateway in $ipfs_gateways ; do
check_ipfs_gateway $ipfs_gateway || continue
IPFS_GATEWAY="$ipfs_gateway"
return
done
ipfs_mode="disabled"
} }
...@@ -15199,7 +15233,9 @@ if is_ipfsurl "$1" && [ -z "$ipfs_mode" ] || [ "$ipfs_mode" = "auto" ] ; then ...@@ -15199,7 +15233,9 @@ if is_ipfsurl "$1" && [ -z "$ipfs_mode" ] || [ "$ipfs_mode" = "auto" ] ; then
info "Autodetecting available IPFS relay..." info "Autodetecting available IPFS relay..."
select_ipfs_mode select_ipfs_mode
info "Auto selected IPFS mode: $ipfs_mode" info "Auto selected IPFS mode: $ipfs_mode"
[ "$ipfs_mode" = "gateway" ] && info "Since the ipfs command is missed, the http gateway will be used."
else else
[ "$ipfs_mode" = "gateway" ] && select_ipfs_gateway
[ -n "$ipfs_mode" ] && info "IPFS mode: $ipfs_mode" [ -n "$ipfs_mode" ] && info "IPFS mode: $ipfs_mode"
fi fi
...@@ -16830,7 +16866,7 @@ reg_include() ...@@ -16830,7 +16866,7 @@ reg_include()
contains() contains()
{ {
#estrlist has "$1" "$2" #estrlist has "$1" "$2"
local res="$(estrlist reg_wordexclude "$1" "$2")" local res="$(reg_wordexclude "$1" "$2")"
[ "$res" != "$2" ] [ "$res" != "$2" ]
} }
...@@ -17404,9 +17440,9 @@ check_command() ...@@ -17404,9 +17440,9 @@ check_command()
;; ;;
# HELPCMD: PART: Repository control: # HELPCMD: PART: Repository control:
update|update-repo|ur) # HELPCMD: update remote package repository databases update|update-repo|ur) # HELPCMD: update remote package repository databases (with args, run upgrade)
epm_cmd=update epm_cmd=update
direct_args=1 #direct_args=1
;; ;;
addrepo|ar|--add-repo) # HELPCMD: add package repo (etersoft, autoimports, archive 2017/01/31); run with param to get list addrepo|ar|--add-repo) # HELPCMD: add package repo (etersoft, autoimports, archive 2017/01/31); run with param to get list
epm_cmd=addrepo epm_cmd=addrepo
...@@ -17496,7 +17532,7 @@ check_command() ...@@ -17496,7 +17532,7 @@ check_command()
Downgrade) # HELPCMD: force update package base, then run downgrade [all] packages to the repo state Downgrade) # HELPCMD: force update package base, then run downgrade [all] packages to the repo state
epm_cmd=Downgrade epm_cmd=Downgrade
;; ;;
downgrade) # HELPCMD: downgrade [all] packages to the repo state downgrade|distro-sync) # HELPCMD: downgrade [all] packages to the repo state
epm_cmd=downgrade epm_cmd=downgrade
;; ;;
download|fetch|fc) # HELPCMD: download package(s) file to the current dir download|fetch|fc) # HELPCMD: download package(s) file to the current dir
......
...@@ -33,7 +33,7 @@ SHAREDIR=$PROGDIR ...@@ -33,7 +33,7 @@ SHAREDIR=$PROGDIR
# will replaced with /etc/eepm during install # will replaced with /etc/eepm during install
CONFIGDIR=$PROGDIR/../etc CONFIGDIR=$PROGDIR/../etc
EPMVERSION="3.61.4" EPMVERSION="3.61.5"
# package, single (file), pipe, git # package, single (file), pipe, git
EPMMODE="package" EPMMODE="package"
...@@ -138,7 +138,7 @@ restore_color() ...@@ -138,7 +138,7 @@ restore_color()
echover() echover()
{ {
[ -z "$verbose" ] && return [ -z "$verbose" ] && return
echo "$*" >&2 echog "$*" >&2
} }
echon() echon()
...@@ -346,39 +346,46 @@ sudoepm() ...@@ -346,39 +346,46 @@ sudoepm()
sudorun $CMDSHELL $bashopt $PROGDIR/$PROGNAME --inscript "$@" sudorun $CMDSHELL $bashopt $PROGDIR/$PROGNAME --inscript "$@"
} }
echog()
{
if [ "$1" = "-n" ] ; then
shift
eval_gettext "$*"
else
eval_gettext "$*"; echo
fi
}
fatal() fatal()
{ {
local PROMOMESSAGE="$EPMPROMOMESSAGE" local PROMOMESSAGE="$EPMPROMOMESSAGE"
[ -n "$PROMOMESSAGE" ] || PROMOMESSAGE=" (you can discuss the epm $EPMVERSION problem in Telegram: https://t.me/useepm)" [ -n "$PROMOMESSAGE" ] || PROMOMESSAGE=" (you can discuss the epm $EPMVERSION problem in Telegram: https://t.me/useepm)"
if [ -z "$TEXTDOMAIN" ] ; then
set_color $RED >&2 set_color $RED >&2
echo -n "ERROR: " >&2 echog -n "ERROR: " >&2
restore_color >&2 restore_color >&2
echo "$* $PROMOMESSAGE" >&2 echog "$* $PROMOMESSAGE" >&2
fi
exit 1 exit 1
} }
debug() debug()
{ {
[ -n "$debug" ] || return [ -n "$debug" ] || return
if [ -z "$TEXTDOMAIN" ] ; then
set_color $YELLOW >&2 set_color $YELLOW >&2
echo -n "WARNING: " >&2 echog -n "WARNING: " >&2
restore_color >&2 restore_color >&2
echo "$*" >&2 echog "$*" >&2
fi
} }
warning() warning()
{ {
if [ -z "$TEXTDOMAIN" ] ; then set_color $YELLOW >&2
set_color $YELLOW >&2 echog -n "WARNING: " >&2
echo -n "WARNING: " >&2 restore_color >&2
restore_color >&2 echog "$*" >&2
echo "$*" >&2
fi
} }
info() info()
...@@ -388,9 +395,9 @@ info() ...@@ -388,9 +395,9 @@ info()
# print message to stderr if stderr forwarded to (a file) # print message to stderr if stderr forwarded to (a file)
if isatty2 ; then if isatty2 ; then
isatty || return 0 isatty || return 0
echo "$*" echog "$*"
else else
echo "$*" >&2 echog "$*" >&2
fi fi
} }
...@@ -1030,6 +1037,23 @@ check_core_commands() ...@@ -1030,6 +1037,23 @@ check_core_commands()
is_command sed || fatal "Can't find sed command (sed package is missed?)" is_command sed || fatal "Can't find sed command (sed package is missed?)"
} }
export TEXTDOMAIN=eepm
if [ "$EPMMODE" = "git" ] ; then
TEXTDOMAINDIR=$PROGDIR/../po
else
TEXTDOMAINDIR='/usr/share/locale'
fi
export TEXTDOMAINDIR
if [ -d "$TEXTDOMAINDIR" ] && is_command gettext.sh ; then
. gettext.sh
else
eval_gettext()
{
echo -n $@
}
fi
# File bin/serv-cat: # File bin/serv-cat:
......
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