Commit 64fe7a98 authored by Vitaly Lipatov's avatar Vitaly Lipatov

commit packed 3.9.13

parent 6e7682dc
...@@ -551,34 +551,6 @@ has_space() ...@@ -551,34 +551,6 @@ has_space()
estrlist has_space "$@" estrlist has_space "$@"
} }
# File bin/epm-Install:
epm_Install()
{
# copied from epm_install
local names="$(echo $pkg_names | filter_out_installed_packages)"
local files="$(echo $pkg_files | filter_out_installed_packages)"
[ -z "$files$names" ] && info "Install: Skip empty install list." && return 22
(pkg_filenames='' epm_update) || { [ -n "$force" ] || return ; }
epm_install_names $names || return
epm_install_files $files
}
# File bin/epm-Upgrade:
epm_Upgrade()
{
(pkg_filenames='' epm_update)
epm_upgrade
}
# File bin/epm-addrepo: # File bin/epm-addrepo:
...@@ -884,6 +856,9 @@ epm_assure() ...@@ -884,6 +856,9 @@ epm_assure()
# TODO: HACK: DEBUG=1 for skip to_remove_pkg handling # TODO: HACK: DEBUG=1 for skip to_remove_pkg handling
(DEBUG=1 repack='' non_interactive=1 pkg_names="$PACKAGE" pkg_files='' pkg_urls='' epm_install ) || return (DEBUG=1 repack='' non_interactive=1 pkg_names="$PACKAGE" pkg_files='' pkg_urls='' epm_install ) || return
# no check if we don't need a version
[ -n "$PACKAGEVERSION" ] || return 0
# check if we couldn't update and still need update # check if we couldn't update and still need update
__epm_need_update $PACKAGE $PACKAGEVERSION && return 1 __epm_need_update $PACKAGE $PACKAGEVERSION && return 1
return 0 return 0
...@@ -1473,79 +1448,6 @@ esac ...@@ -1473,79 +1448,6 @@ esac
} }
# File bin/epm-check_updated_repo:
__is_repo_info_downloaded()
{
case $PMTYPE in
apt-*)
if [ -r /var/cache/apt ] ; then
$SUDO test -r /var/cache/apt/pkgcache.bin || return
fi
;;
*)
;;
esac
return 0
}
__is_repo_info_uptodate()
{
case $PMTYPE in
apt-*)
# apt-deb do not update lock file date
#if $SUDO test -r /var/lib/apt/lists ; then
local LOCKFILE=/var/lib/apt/lists
$SUDO test -r $LOCKFILE || return
# if repo older than 1 day, return false
# find print string if file is obsoleted
test -z "$(find $LOCKFILE -maxdepth 0 -mtime +1)" || return
#fi
;;
*)
;;
esac
return 0
}
update_repo_if_needed()
{
# check if we need skip update checking
if [ "$1" = "soft" ] && [ -n "$SUDO" ] ; then
# if sudo requires a password, skip autoupdate
sudo -n true 2>/dev/null || { info "sudo requires a password, skip repo status checking" ; return 0 ; }
fi
cd / || fatal
if ! __is_repo_info_downloaded || ! __is_repo_info_uptodate ; then
# FIXME: cleans!!!
(pkg_filenames='' epm_update)
fi
cd - >/dev/null || fatal
}
save_installed_packages()
{
[ -d /var/lib/rpm ] || return 0
estrlist list "$@" | $SUDO tee /var/lib/rpm/EPM-installed >/dev/null
}
check_manually_installed()
{
[ -r /var/lib/rpm/EPM-installed ] || return 1
grep -q -- "^$1\$" /var/lib/rpm/EPM-installed
}
skip_manually_installed()
{
local i
for i in "$@" ; do
check_manually_installed "$i" && continue
echo "$i"
done
}
# File bin/epm-checkpkg: # File bin/epm-checkpkg:
__rpm_allows_nosignature() __rpm_allows_nosignature()
...@@ -1691,6 +1593,79 @@ if [ "$1" = "--debug" ] ; then ...@@ -1691,6 +1593,79 @@ if [ "$1" = "--debug" ] ; then
epm_checksystem epm_checksystem
fi fi
# File bin/epm-check_updated_repo:
__is_repo_info_downloaded()
{
case $PMTYPE in
apt-*)
if [ -r /var/cache/apt ] ; then
$SUDO test -r /var/cache/apt/pkgcache.bin || return
fi
;;
*)
;;
esac
return 0
}
__is_repo_info_uptodate()
{
case $PMTYPE in
apt-*)
# apt-deb do not update lock file date
#if $SUDO test -r /var/lib/apt/lists ; then
local LOCKFILE=/var/lib/apt/lists
$SUDO test -r $LOCKFILE || return
# if repo older than 1 day, return false
# find print string if file is obsoleted
test -z "$(find $LOCKFILE -maxdepth 0 -mtime +1)" || return
#fi
;;
*)
;;
esac
return 0
}
update_repo_if_needed()
{
# check if we need skip update checking
if [ "$1" = "soft" ] && [ -n "$SUDO" ] ; then
# if sudo requires a password, skip autoupdate
sudo -n true 2>/dev/null || { info "sudo requires a password, skip repo status checking" ; return 0 ; }
fi
cd / || fatal
if ! __is_repo_info_downloaded || ! __is_repo_info_uptodate ; then
# FIXME: cleans!!!
(pkg_filenames='' epm_update)
fi
cd - >/dev/null || fatal
}
save_installed_packages()
{
[ -d /var/lib/rpm ] || return 0
estrlist list "$@" | $SUDO tee /var/lib/rpm/EPM-installed >/dev/null
}
check_manually_installed()
{
[ -r /var/lib/rpm/EPM-installed ] || return 1
grep -q -- "^$1\$" /var/lib/rpm/EPM-installed
}
skip_manually_installed()
{
local i
for i in "$@" ; do
check_manually_installed "$i" && continue
echo "$i"
done
}
# File bin/epm-clean: # File bin/epm-clean:
__remove_alt_apt_cache_file() __remove_alt_apt_cache_file()
...@@ -3157,6 +3132,24 @@ epm_install() ...@@ -3157,6 +3132,24 @@ epm_install()
return $RETVAL return $RETVAL
} }
# File bin/epm-Install:
epm_Install()
{
# copied from epm_install
local names="$(echo $pkg_names | filter_out_installed_packages)"
local files="$(echo $pkg_files | filter_out_installed_packages)"
[ -z "$files$names" ] && info "Install: Skip empty install list." && return 22
(pkg_filenames='' epm_update) || { [ -n "$force" ] || return ; }
epm_install_names $names || return
epm_install_files $files
}
# File bin/epm-install-emerge: # File bin/epm-install-emerge:
...@@ -7775,6 +7768,16 @@ epm_upgrade() ...@@ -7775,6 +7768,16 @@ epm_upgrade()
} }
# File bin/epm-Upgrade:
epm_Upgrade()
{
(pkg_filenames='' epm_update)
epm_upgrade
}
# File bin/epm-whatdepends: # File bin/epm-whatdepends:
...@@ -9480,7 +9483,7 @@ Examples: ...@@ -9480,7 +9483,7 @@ Examples:
print_version() print_version()
{ {
echo "EPM package manager version 3.9.12 https://wiki.etersoft.ru/Epm" echo "EPM package manager version 3.9.13 https://wiki.etersoft.ru/Epm"
echo "Running on $($DISTRVENDOR -e) ('$PMTYPE' package manager uses '$PKGFORMAT' package format)" echo "Running on $($DISTRVENDOR -e) ('$PMTYPE' package manager uses '$PKGFORMAT' package format)"
echo "Copyright (c) Etersoft 2012-2020" echo "Copyright (c) Etersoft 2012-2020"
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."
...@@ -9490,7 +9493,7 @@ print_version() ...@@ -9490,7 +9493,7 @@ print_version()
Usage="Usage: epm [options] <command> [package name(s), package files]..." Usage="Usage: epm [options] <command> [package name(s), package files]..."
Descr="epm - EPM package manager" Descr="epm - EPM package manager"
EPMVERSION=3.9.12 EPMVERSION=3.9.13
verbose= verbose=
quiet= quiet=
nodeps= nodeps=
......
...@@ -2827,7 +2827,7 @@ print_version() ...@@ -2827,7 +2827,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.9.12 https://wiki.etersoft.ru/Epm" echo "Service manager version 3.9.13 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-2019" echo "Copyright (c) Etersoft 2012-2019"
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