Commit 2e3f0321 authored by Vitaly Lipatov's avatar Vitaly Lipatov

commit packed 3.52.3

parent ebefc7bb
...@@ -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.2" EPMVERSION="3.52.3"
# package, single (file), pipe, git # package, single (file), pipe, git
EPMMODE="package" EPMMODE="package"
...@@ -624,9 +624,8 @@ get_package_type() ...@@ -624,9 +624,8 @@ get_package_type()
return return
;; ;;
*) *)
#fatal "Don't know type of $1" # print extension by default
# return package name for info echo "$1" | sed -e 's|.*\.||'
echo "$1"
return 1 return 1
;; ;;
esac esac
...@@ -737,6 +736,28 @@ __epm_remove_tmp_files() ...@@ -737,6 +736,28 @@ __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="$(epm print field Distribution for "$pkg" 2>/dev/null))"
echo "$distribution" | grep -q "^ALT" || return
# 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 "$@"
...@@ -2942,7 +2963,7 @@ __epm_korinf_install_eepm() { ...@@ -2942,7 +2963,7 @@ __epm_korinf_install_eepm() {
epm_epm_install_help() epm_epm_install_help()
{ {
echo "epm ei [packages] - install packages from EPM based Korinf repository" echo "epm ei [URL] [packages] - install packages from EPM based Korinf repository"
get_help HELPCMD $SHAREDIR/epm-epm_install get_help HELPCMD $SHAREDIR/epm-epm_install
cat <<EOF cat <<EOF
...@@ -2950,14 +2971,24 @@ Default Korinf repository: $EPM_KORINF_REPO_URL ...@@ -2950,14 +2971,24 @@ Default Korinf repository: $EPM_KORINF_REPO_URL
Examples: Examples:
epm ei [epm|eepm] - install latest eepm (default action) epm ei [epm|eepm] - install latest eepm (default action)
epm <package1> [<package2>...] - install package(s) from default Korinf repo epm ei <package1> [<package2>...] - install package(s) from default Korinf repo
epm http://someurl.ru <package> - install package(s) from the URL epm http://someurl.ru <package> - install package(s) from a repo defined by URL
epm --list <package mask> - list available packages by mask epm --list <package mask> - list available packages by mask
EOF EOF
} }
epm_epm_install() { epm_epm_install()
{
if [ "$BASEDISTRNAME" = "alt" ] && [ "$DISTRVERSION" != "Sisyphus" ] && [ "$EPMMODE" = "package" ] ; then
if __epm_check_if_package_from_repo eepm ; then
warning "Using external (Korinf) repo is forbidden for stable ALT branch $DISTRVERSION."
info "Check https://bugzilla.altlinux.org/44314 for reasons."
info "You can install eepm package from Korinf manually, check instruction at https://eepm.ru"
fatal "Do nothing."
fi
fi
if is_url "$1" ; then if is_url "$1" ; then
EPM_KORINF_REPO_URL="$1" EPM_KORINF_REPO_URL="$1"
...@@ -4246,7 +4277,7 @@ epm_install() ...@@ -4246,7 +4277,7 @@ epm_install()
fi fi
if [ -n "$interactive" ] ; then if [ -n "$interactive" ] ; then
confirm_info "You are about to install $pkg_names $pkg_files $pkg_urls package(s)." confirm_info "You are about to install $(echo $pkg_names $pkg_files $pkg_urls) package(s)."
# TODO: for some packages with dependencies apt will ask later again # TODO: for some packages with dependencies apt will ask later again
fi fi
...@@ -5644,7 +5675,6 @@ __epm_play_initialize_ipfs() ...@@ -5644,7 +5675,6 @@ __epm_play_initialize_ipfs()
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.)
# get initial db from server # get initial db from server
local URL="https://eepm.ru/app-versions" local URL="https://eepm.ru/app-versions"
info "Initialize 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"
...@@ -5824,14 +5854,21 @@ __epm_play_run "$prescription" --run "$@" || fatal "There was some error during ...@@ -5824,14 +5854,21 @@ __epm_play_run "$prescription" --run "$@" || fatal "There was some error during
# File bin/epm-print: # File bin/epm-print:
is_pkgfile()
{
[ -f "$1" ] || return
echo "$1" | grep -q "\.rpm$" && return
echo "$1" | grep -q "\.deb$" && return
return 1
}
rpm_query_package_format_field() rpm_query_package_format_field()
{ {
local FORMAT="$1\n" local FORMAT="$1\n"
shift shift
local INSTALLED="" local INSTALLED=""
# if a file, ad -p for get from rpm base # if a file, add -p for get from rpm base
if [ -f "$1" ] ; then if is_pkgfile "$1" ; then
INSTALLED="-p" INSTALLED="-p"
fi fi
a= rpmquery $INSTALLED --queryformat "$FORMAT" "$@" a= rpmquery $INSTALLED --queryformat "$FORMAT" "$@"
...@@ -5848,7 +5885,7 @@ dpkg_query_package_format_field() ...@@ -5848,7 +5885,7 @@ dpkg_query_package_format_field()
{ {
local field="$1" local field="$1"
shift shift
if [ -f "$1" ] ; then if is_pkgfile "$1" ; then
a= dpkg-deb --show --showformat="$field\n" "$@" a= dpkg-deb --show --showformat="$field\n" "$@"
else else
#a= dpkg -s "$1" | grep "^$field: " | sed -e "s|^$field: ||" #a= dpkg -s "$1" | grep "^$field: " | sed -e "s|^$field: ||"
...@@ -7204,10 +7241,6 @@ get_fix_release_pkg() ...@@ -7204,10 +7241,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 apt-conf-sisyphus-" epm installed apt-conf-branch && echo "apt-conf-branch apt-conf-sisyphus-"
fi fi
...@@ -10842,7 +10875,7 @@ __epm_vendor_ok_scripts() ...@@ -10842,7 +10875,7 @@ __epm_vendor_ok_scripts()
return $res return $res
} }
__epm_get_pkgvendor() __epm_get_rpm_pkgvendor()
{ {
local pkg="$1" local pkg="$1"
...@@ -10862,7 +10895,7 @@ __epm_print_warning_for_nonalt_packages() ...@@ -10862,7 +10895,7 @@ __epm_print_warning_for_nonalt_packages()
for i in $* ; do for i in $* ; do
local vendor local vendor
# TODO: check only for rpm # TODO: check only for rpm
vendor="$(__epm_get_pkgvendor "$i")" vendor="$(__epm_get_rpm_pkgvendor "$i")"
local packager="$(epm print field Packager for "$i" 2>/dev/null)" local packager="$(epm print field Packager for "$i" 2>/dev/null)"
...@@ -10884,7 +10917,7 @@ __epm_check_vendor() ...@@ -10884,7 +10917,7 @@ __epm_check_vendor()
local i local i
for i in $* ; do for i in $* ; do
local vendor local vendor
vendor="$(__epm_get_pkgvendor "$i")" vendor="$(__epm_get_rpm_pkgvendor "$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."
...@@ -11341,10 +11374,13 @@ get_latest_version() ...@@ -11341,10 +11374,13 @@ get_latest_version()
__check_for_epm_version() __check_for_epm_version()
{ {
# skip update checking for eepm from repo (ALT bug #44314)
[ "$BASEDISTRNAME" = "alt" ] && [ "$DISTRVERSION" != "Sisyphus" ] && __epm_check_if_package_from_repo eepm && return
local latest="$(get_latest_version eepm)" local latest="$(get_latest_version eepm)"
#[ -z "$latest" ] && return #[ -z "$latest" ] && return
local res="$(epm print compare "$EPMVERSION" "$latest")" local res="$(epm print compare "$EPMVERSION" "$latest")"
[ "$res" = "-1" ] && info "Latest EPM version in Korinf repository is $latest. You have version $EPMVERSION running." [ "$res" = "-1" ] && info "Latest EPM version in Korinf repository is $latest. You have version $EPMVERSION running." && info "You can update eepm with \$ epm ei command."
} }
epm_update() epm_update()
......
...@@ -599,9 +599,8 @@ get_package_type() ...@@ -599,9 +599,8 @@ get_package_type()
return return
;; ;;
*) *)
#fatal "Don't know type of $1" # print extension by default
# return package name for info echo "$1" | sed -e 's|.*\.||'
echo "$1"
return 1 return 1
;; ;;
esac esac
...@@ -712,6 +711,28 @@ __epm_remove_tmp_files() ...@@ -712,6 +711,28 @@ __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="$(epm print field Distribution for "$pkg" 2>/dev/null))"
echo "$distribution" | grep -q "^ALT" || return
# 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 "$@"
...@@ -2577,7 +2598,7 @@ print_version() ...@@ -2577,7 +2598,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.2 https://wiki.etersoft.ru/Epm" echo "Service manager version 3.52.3 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