Commit da7f80c6 authored by Vitaly Lipatov's avatar Vitaly Lipatov

commit packed 3.53.0

parent 688d2769
...@@ -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.52.7" EPMVERSION="3.53.0"
# package, single (file), pipe, git # package, single (file), pipe, git
EPMMODE="package" EPMMODE="package"
...@@ -334,7 +334,7 @@ fatal() ...@@ -334,7 +334,7 @@ fatal()
{ {
if [ -z "$TEXTDOMAIN" ] ; then if [ -z "$TEXTDOMAIN" ] ; then
set_color $RED set_color $RED
echo "Error: $* (you can discuss the problem in Telegram: https://t.me/useepm)" >&2 echo "Error: $* (you can discuss the epm $EPMVERSION problem in Telegram: https://t.me/useepm)" >&2
restore_color restore_color
fi fi
exit 1 exit 1
...@@ -752,33 +752,6 @@ __epm_remove_tmp_files() ...@@ -752,33 +752,6 @@ __epm_remove_tmp_files()
} }
__epm_check_if_package_from_repo()
{
local pkg="$1"
# only ALT
[ "$BASEDISTRNAME" = "alt" ] || return 0
local vendor
# TODO: check only for rpm
#vendor="$(epm print field Vendor for "$pkg" 2>/dev/null))"
#[ "$vendor" = "ALT Linux Team" ] || return
local distribution
distribution="$(epm print field Distribution for "$pkg" 2>/dev/null )"
echo "$distribution" | grep -q "^ALT" || return
local sig
sig="$(epm print field sigpgp for "$pkg" 2>/dev/null )"
[ "$sig" = "(none)" ] && return 1
# FIXME: how to check if the package is from ALT repo (verified)?
local release="$(epm print release from package "$pkg" 2>/dev/null )"
echo "$release" | grep -q "^alt" || return
return 0
}
has_space() has_space()
{ {
estrlist -- has_space "$@" estrlist -- has_space "$@"
...@@ -1454,9 +1427,8 @@ epm_autoorphans() ...@@ -1454,9 +1427,8 @@ epm_autoorphans()
[ -z "$*" ] || fatal "No arguments are allowed here" [ -z "$*" ] || fatal "No arguments are allowed here"
case $BASEDISTRNAME in
case $PMTYPE in alt)
apt-rpm)
# ALT Linux only # ALT Linux only
assure_exists /usr/share/apt/scripts/list-extras.lua apt-scripts assure_exists /usr/share/apt/scripts/list-extras.lua apt-scripts
if [ -z "$dryrun" ] ; then if [ -z "$dryrun" ] ; then
...@@ -1476,13 +1448,20 @@ case $PMTYPE in ...@@ -1476,13 +1448,20 @@ case $PMTYPE in
fi fi
PKGLIST="$(estrlist exclude "$play_installed" "$PKGLIST")" PKGLIST="$(estrlist exclude "$play_installed" "$PKGLIST")"
if [ -z "$dryrun" ] && [ -n "$PKGLIST" ] ; then if [ -n "$PKGLIST" ] ; then
if [ -z "$dryrun" ] ; then
showcmd epm remove $dryrun $force $PKGLIST showcmd epm remove $dryrun $force $PKGLIST
confirm_info "We will remove packages above." confirm_info "We will remove packages above."
fi fi
docmd epm remove $dryrun $force $(subst_option non_interactive --auto) $PKGLIST docmd epm remove $dryrun $force $(subst_option non_interactive --auto) $PKGLIST
else
echo "There are no orphan packages in the system."
fi
return 0
;; ;;
esac
case $PMTYPE in
apt-dpkg|aptitude-dpkg) apt-dpkg|aptitude-dpkg)
assure_exists deborphan assure_exists deborphan
showcmd deborphan showcmd deborphan
...@@ -3012,7 +2991,7 @@ epm_epm_install() ...@@ -3012,7 +2991,7 @@ epm_epm_install()
{ {
if [ "$BASEDISTRNAME" = "alt" ] && [ "$DISTRVERSION" != "Sisyphus" ] && [ "$EPMMODE" = "package" ] ; then if [ "$BASEDISTRNAME" = "alt" ] && [ "$DISTRVERSION" != "Sisyphus" ] && [ "$EPMMODE" = "package" ] ; then
if __epm_check_if_package_from_repo eepm ; then if epm status --original eepm ; then
warning "Using external (Korinf) repo is forbidden for stable ALT branch $DISTRVERSION." warning "Using external (Korinf) repo is forbidden for stable ALT branch $DISTRVERSION."
info "Check https://bugzilla.altlinux.org/44314 for reasons." info "Check https://bugzilla.altlinux.org/44314 for reasons."
info "You can install eepm package from Korinf manually, check instruction at https://eepm.ru" info "You can install eepm package from Korinf manually, check instruction at https://eepm.ru"
...@@ -4506,6 +4485,9 @@ epm_kernel_update() ...@@ -4506,6 +4485,9 @@ epm_kernel_update()
dnf-rpm) dnf-rpm)
docmd epm install kernel docmd epm install kernel
;; ;;
apt-*)
echo "Skipping: kernel package will update during dist-upgrade"
;;
*) *)
fatal "Have no suitable command for $PMTYPE" fatal "Have no suitable command for $PMTYPE"
;; ;;
...@@ -5701,16 +5683,26 @@ __epm_play_install() ...@@ -5701,16 +5683,26 @@ __epm_play_install()
__epm_play_initialize_ipfs() __epm_play_initialize_ipfs()
{ {
if [ -d "$(dirname "$epm_ipfs_db")" ] ; then if [ -d "$(dirname "$epm_ipfs_db")" ] ; then
export EGET_IPFS_DB="$eget_ipfs_db" local URL="https://eepm.ru/app-versions"
if [ ! -r "$EGET_IPFS_DB" ] ; then if [ ! -r "$eget_ipfs_db" ] ; then
sudorun touch "$EGET_IPFS_DB" >&2 sudorun touch "$eget_ipfs_db" >&2
sudorun chmod -v a+rw "$EGET_IPFS_DB" >&2 sudorun chmod -v a+rw "$eget_ipfs_db" >&2
# TODO: update this DB every time when changed (and get from IPFS as sign it works.) # TODO: update this DB every time when changed (and get from IPFS as sign it works.)
# get initial db from server # get initial db from server
local URL="https://eepm.ru/app-versions" info "Initialize local IPFS DB in $eget_ipfs_db file and fill it with data from $URL/eget-ipfs-db.txt"
info "Initialize IPFS DB in $EGET_IPFS_DB file and fill it with data from $URL/eget-ipfs-db.txt" docmd eget -q -O $eget_ipfs_db "$URL/eget-ipfs-db.txt"
docmd eget -q -O $EGET_IPFS_DB "$URL/eget-ipfs-db.txt" else
# update
local t=$(mktemp) || fatal
info "Updating local IPFS DB in $eget_ipfs_db file from $URL/eget-ipfs-db.txt"
docmd eget -q -O $t "$URL/eget-ipfs-db.txt" || warning "Can't update IPFS DB"
if [ -s "$t" ] ; then
echo >>$t
cat $eget_ipfs_db >>$t
sort -u < $t | grep -v "^$" > $eget_ipfs_db
fi fi
fi
export EGET_IPFS_DB="$eget_ipfs_db"
else else
warning "ipfs db dir $eget_ipfs_db is not exists, skipping --ipfs" warning "ipfs db dir $eget_ipfs_db is not exists, skipping --ipfs"
fi fi
...@@ -5750,7 +5742,8 @@ case "$1" in ...@@ -5750,7 +5742,8 @@ case "$1" in
--update) --update)
shift shift
local CMDUPDATE="--update" local CMDUPDATE="--update"
[ -n "$force" ] && CMDUPDATE="--run" # check --force on common.sh side
#[ -n "$force" ] && CMDUPDATE="--run"
if [ -z "$1" ] ; then if [ -z "$1" ] ; then
fatal "run --update with 'all' or a project name" fatal "run --update with 'all' or a project name"
...@@ -7272,10 +7265,6 @@ get_fix_release_pkg() ...@@ -7272,10 +7265,6 @@ get_fix_release_pkg()
echo "apt-conf-$TO" echo "apt-conf-$TO"
# apt-conf-sisyphus and apt-conf-branch conflicts # apt-conf-sisyphus and apt-conf-branch conflicts
epm installed apt-conf-branch && echo "apt-conf-branch-" epm installed apt-conf-branch && echo "apt-conf-branch-"
#for i in apt apt-rsync libapt libpackagekit-glib librpm7 packagekit rpm synaptic realmd libldap2 ; do
# epm installed $i && echo "$i"
#done
else else
epm installed apt-conf-branch && echo "apt-conf-branch" && epm installed apt-conf-sisyphus && echo "apt-conf-sisyphus-" epm installed apt-conf-branch && echo "apt-conf-branch" && epm installed apt-conf-sisyphus && echo "apt-conf-sisyphus-"
fi fi
...@@ -8331,7 +8320,6 @@ __epm_have_repack_rule() ...@@ -8331,7 +8320,6 @@ __epm_have_repack_rule()
# skip repacking on non ALT systems # skip repacking on non ALT systems
[ "$BASEDISTRNAME" = "alt" ] || return 1 [ "$BASEDISTRNAME" = "alt" ] || return 1
# skip for packages built with repack
local packager="$(epm print field Packager for "$1" 2>/dev/null)" local packager="$(epm print field Packager for "$1" 2>/dev/null)"
[ "$packager" = "EPM <support@etersoft.ru>" ] && return 1 [ "$packager" = "EPM <support@etersoft.ru>" ] && return 1
[ "$packager" = "EPM <support@eepm.ru>" ] && return 1 [ "$packager" = "EPM <support@eepm.ru>" ] && return 1
...@@ -10967,34 +10955,28 @@ __epm_vendor_ok_scripts() ...@@ -10967,34 +10955,28 @@ __epm_vendor_ok_scripts()
return $res return $res
} }
__epm_get_rpm_pkgvendor()
{
local pkg="$1"
# skip checking if the package is unaccessible
local rpmversion="$(epm print field Version for "$pkg" 2>/dev/null)"
[ -n "$rpmversion" ] || return
epm print field Vendor for "$pkg" 2>/dev/null
}
__epm_print_warning_for_nonalt_packages() __epm_print_warning_for_nonalt_packages()
{ {
# only ALT # only ALT
[ "$BASEDISTRNAME" = "alt" ] || return 0 [ "$BASEDISTRNAME" = "alt" ] || return 0
local i local i
for i in $* ; do for i in $* ; do
local vendor if epm_status_repacked "$i" ; then
# TODO: check only for rpm warning "%%% You are trying install package $i repacked from third-party software source. Use it at your own discretion. %%%"
vendor="$(__epm_get_rpm_pkgvendor "$i")" continue
fi
local packager="$(epm print field Packager for "$i" 2>/dev/null)"
# TODO: check GPG or some other mark
echo "$packager" | grep -q "@altlinux" && [ "$vendor" = "ALT Linux Team" ] && return 0
if epm_status_thirdparty "$i" ; then
warning "%%% You are trying install package $i from third-party software source. Use it at your own discretion. %%%" warning "%%% You are trying install package $i from third-party software source. Use it at your own discretion. %%%"
continue
fi
if ! epm_status_original "$i" ; then
warning "%%% You are trying install package $i not from official $DISTRNAME/$DISTRVERSION repository. Use it at your own discretion. %%%"
continue
fi
done done
} }
...@@ -11006,10 +10988,20 @@ __epm_check_vendor() ...@@ -11006,10 +10988,20 @@ __epm_check_vendor()
# only ALT # only ALT
[ "$BASEDISTRNAME" = "alt" ] || return 0 [ "$BASEDISTRNAME" = "alt" ] || return 0
local i local i
for i in $* ; do for i in $* ; do
if ! epm_status_validate "$i" ; then
# it is missed package probably (package remove case)
if is_installed "$i" ; then
warning "Can't get any info for $i package. Scripts are DISABLED for package $i. Use --scripts if you need run scripts from such packages."
fi
noscripts="--noscripts"
continue
fi
local vendor local vendor
vendor="$(__epm_get_rpm_pkgvendor "$i")" vendor="$(epm print field Vendor for "$i")"
if [ -z "$vendor" ] ; then if [ -z "$vendor" ] ; then
warning "Can't get info about vendor for $i package. Scripts are DISABLED for package $i. Use --scripts if you need run scripts from such packages." warning "Can't get info about vendor for $i package. Scripts are DISABLED for package $i. Use --scripts if you need run scripts from such packages."
...@@ -11017,9 +11009,8 @@ __epm_check_vendor() ...@@ -11017,9 +11009,8 @@ __epm_check_vendor()
continue continue
fi fi
# TODO: check GPG epm_status_original "$i" && continue
# check separately to be quiet epm_status_repacked "$i" && continue
[ "$vendor" = "ALT Linux Team" ] && continue
if __epm_vendor_ok_scripts "$vendor" ; then if __epm_vendor_ok_scripts "$vendor" ; then
warning "Scripts are ENABLED for package $i from outside vendor '$vendor' (this vendor is listed in $CONFIGDIR/vendorallowscripts.list). Use --noscripts if you need disable scripts in such packages." warning "Scripts are ENABLED for package $i from outside vendor '$vendor' (this vendor is listed in $CONFIGDIR/vendorallowscripts.list). Use --noscripts if you need disable scripts in such packages."
...@@ -11400,6 +11391,12 @@ epm_stats() ...@@ -11400,6 +11391,12 @@ epm_stats()
# File bin/epm-status: # File bin/epm-status:
epm_status_validate()
{
local pkg="$1"
local rpmversion="$(epm print field Version for "$pkg" 2>/dev/null)"
[ -n "$rpmversion" ]
}
epm_status_original() epm_status_original()
{ {
...@@ -11409,9 +11406,25 @@ epm_status_original() ...@@ -11409,9 +11406,25 @@ epm_status_original()
case $DISTRNAME in case $DISTRNAME in
ALTLinux|ALTServer) ALTLinux|ALTServer)
#[ "$(epm print field Vendor for package $pkg)" = "ALT Linux Team" ] && return epm_status_validate $pkg || return 1
epm_status_repacked $pkg && return 1 epm_status_repacked $pkg && return 1
__epm_check_if_package_from_repo $pkg && return
# not for all packages
#[ "$(epm print field Vendor for package $pkg)" = "ALT Linux Team" ] || return
local distribution
distribution="$(epm print field Distribution for "$pkg" 2>/dev/null )"
echo "$distribution" | grep -q "^ALT" || return 1
# mc in Sisyphus has not a signature
#local sig
#sig="$(epm print field sigpgp for "$pkg" 2>/dev/null )"
#[ "$sig" = "(none)" ] && return 1
# FIXME: how to check if the package is from ALT repo (verified)?
local release="$(epm print release from package "$pkg" 2>/dev/null )"
echo "$release" | grep -q "^alt" || return 1
return 0
;; ;;
*) *)
fatal "Unsupported $DISTRNAME" fatal "Unsupported $DISTRNAME"
...@@ -11428,6 +11441,7 @@ epm_status_repacked() ...@@ -11428,6 +11441,7 @@ epm_status_repacked()
case $BASEDISTRNAME in case $BASEDISTRNAME in
alt) alt)
epm_status_validate $pkg || return
local packager="$(epm print field Packager for "$1" 2>/dev/null)" local packager="$(epm print field Packager for "$1" 2>/dev/null)"
[ "$packager" = "EPM <support@etersoft.ru>" ] && return 0 [ "$packager" = "EPM <support@etersoft.ru>" ] && return 0
[ "$packager" = "EPM <support@eepm.ru>" ] && return 0 [ "$packager" = "EPM <support@eepm.ru>" ] && return 0
...@@ -11440,7 +11454,7 @@ epm_status_repacked() ...@@ -11440,7 +11454,7 @@ epm_status_repacked()
} }
epm_status_thirdpart() epm_status_thirdparty()
{ {
local pkg="$1" local pkg="$1"
...@@ -11452,6 +11466,7 @@ epm_status_thirdpart() ...@@ -11452,6 +11466,7 @@ epm_status_thirdpart()
#local packager="$(epm print field Packager for "$1" 2>/dev/null)" #local packager="$(epm print field Packager for "$1" 2>/dev/null)"
#echo "$packager" && grep -q "altlinux" && return 0 #echo "$packager" && grep -q "altlinux" && return 0
#echo "$packager" && grep -q "basealt" && return 0 #echo "$packager" && grep -q "basealt" && return 0
epm_status_validate $pkg || return 1
local distribution local distribution
distribution="$(epm print field Distribution for "$pkg" 2>/dev/null )" distribution="$(epm print field Distribution for "$pkg" 2>/dev/null )"
...@@ -11475,8 +11490,9 @@ Usage: epm status [options] <package> ...@@ -11475,8 +11490,9 @@ Usage: epm status [options] <package>
Options: Options:
--installed check if <package> is installed --installed check if <package> is installed
--original check if <package> is from distro repo --original check if <package> is from distro repo
--thirdpart check if <package> from a third part source (didn't packed for this distro) --thirdparty check if <package> from a third-party source (didn't packed for this distro)
--repacked check if <package> was repacked with epm repack --repacked check if <package> was repacked with epm repack
--validate check if <package> is accessible (we can get a fields from it)
EOF EOF
} }
...@@ -11506,14 +11522,18 @@ epm_status() ...@@ -11506,14 +11522,18 @@ epm_status()
epm_status_original "$@" epm_status_original "$@"
return return
;; ;;
--thirdpart) --third-party|--thirdparty|--thirdpart)
epm_status_thirdpart "$@" epm_status_thirdparty "$@"
return return
;; ;;
--repacked) --repacked)
epm_status_repacked "$@" epm_status_repacked "$@"
return return
;; ;;
--validate)
epm_status_validate "$@"
return
;;
*) *)
fatal "Unknown option $option, use epm status --help to get info" fatal "Unknown option $option, use epm status --help to get info"
;; ;;
...@@ -11593,7 +11613,7 @@ get_latest_version() ...@@ -11593,7 +11613,7 @@ get_latest_version()
__check_for_epm_version() __check_for_epm_version()
{ {
# skip update checking for eepm from repo (ALT bug #44314) # skip update checking for eepm from repo (ALT bug #44314)
[ "$BASEDISTRNAME" = "alt" ] && [ "$DISTRVERSION" != "Sisyphus" ] && __epm_check_if_package_from_repo eepm && return [ "$BASEDISTRNAME" = "alt" ] && [ "$DISTRVERSION" != "Sisyphus" ] && epm status --original eepm && return
local latest="$(get_latest_version eepm)" local latest="$(get_latest_version eepm)"
#[ -z "$latest" ] && return #[ -z "$latest" ] && return
...@@ -13544,7 +13564,11 @@ get_ipfs_brave() ...@@ -13544,7 +13564,11 @@ get_ipfs_brave()
ipfs_api_access() ipfs_api_access()
{ {
[ -n "$IPFS_CMD" ] || fatal "IPFS is disabled" [ -n "$IPFS_CMD" ] || fatal "IPFS is disabled"
if [ -n "$verbose" ] ; then
verdocmd $IPFS_CMD --api $IPFS_API $ipfs_diag_timeout diag sys >/dev/null verdocmd $IPFS_CMD --api $IPFS_API $ipfs_diag_timeout diag sys >/dev/null
else
verdocmd $IPFS_CMD --api $IPFS_API $ipfs_diag_timeout diag sys >/dev/null 2>/dev/null
fi
} }
ipfs_check() ipfs_check()
......
...@@ -309,7 +309,7 @@ fatal() ...@@ -309,7 +309,7 @@ fatal()
{ {
if [ -z "$TEXTDOMAIN" ] ; then if [ -z "$TEXTDOMAIN" ] ; then
set_color $RED set_color $RED
echo "Error: $* (you can discuss the problem in Telegram: https://t.me/useepm)" >&2 echo "Error: $* (you can discuss the epm $EPMVERSION problem in Telegram: https://t.me/useepm)" >&2
restore_color restore_color
fi fi
exit 1 exit 1
...@@ -727,33 +727,6 @@ __epm_remove_tmp_files() ...@@ -727,33 +727,6 @@ __epm_remove_tmp_files()
} }
__epm_check_if_package_from_repo()
{
local pkg="$1"
# only ALT
[ "$BASEDISTRNAME" = "alt" ] || return 0
local vendor
# TODO: check only for rpm
#vendor="$(epm print field Vendor for "$pkg" 2>/dev/null))"
#[ "$vendor" = "ALT Linux Team" ] || return
local distribution
distribution="$(epm print field Distribution for "$pkg" 2>/dev/null )"
echo "$distribution" | grep -q "^ALT" || return
local sig
sig="$(epm print field sigpgp for "$pkg" 2>/dev/null )"
[ "$sig" = "(none)" ] && return 1
# FIXME: how to check if the package is from ALT repo (verified)?
local release="$(epm print release from package "$pkg" 2>/dev/null )"
echo "$release" | grep -q "^alt" || return
return 0
}
has_space() has_space()
{ {
estrlist -- has_space "$@" estrlist -- has_space "$@"
...@@ -2622,7 +2595,7 @@ print_version() ...@@ -2622,7 +2595,7 @@ print_version()
local on_text="(host system)" local on_text="(host system)"
local virt="$($DISTRVENDOR -i)" local virt="$($DISTRVENDOR -i)"
[ "$virt" = "(unknown)" ] || [ "$virt" = "(host system)" ] || on_text="(under $virt)" [ "$virt" = "(unknown)" ] || [ "$virt" = "(host system)" ] || on_text="(under $virt)"
echo "Service manager version 3.52.7 https://wiki.etersoft.ru/Epm" echo "Service manager version 3.53.0 https://wiki.etersoft.ru/Epm"
echo "Running on $($DISTRVENDOR -e) $on_text with $SERVICETYPE" echo "Running on $($DISTRVENDOR -e) $on_text with $SERVICETYPE"
echo "Copyright (c) Etersoft 2012-2021" echo "Copyright (c) Etersoft 2012-2021"
echo "This program may be freely redistributed under the terms of the GNU AGPLv3." echo "This program may be freely redistributed under the terms of the GNU AGPLv3."
......
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