Commit 34e99ce3 authored by Vitaly Lipatov's avatar Vitaly Lipatov

commit packed 3.32.0

parent 376a6b52
...@@ -31,7 +31,7 @@ SHAREDIR=$PROGDIR ...@@ -31,7 +31,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.31.1" EPMVERSION="3.32.0"
load_helper() load_helper()
{ {
...@@ -605,6 +605,7 @@ set_distro_info() ...@@ -605,6 +605,7 @@ set_distro_info()
DISTRARCH=$($DISTRVENDOR --distro-arch) DISTRARCH=$($DISTRVENDOR --distro-arch)
fi fi
DISTRCONTROL="$($DISTRVENDOR -y)" DISTRCONTROL="$($DISTRVENDOR -y)"
[ -n "$BASEDISTRNAME" ] || BASEDISTRNAME=$($DISTRVENDOR -s)
# TODO: improve BIGTMPDIR conception # TODO: improve BIGTMPDIR conception
# https://bugzilla.mozilla.org/show_bug.cgi?id=69938 # https://bugzilla.mozilla.org/show_bug.cgi?id=69938
...@@ -841,8 +842,8 @@ __epm_addkey_deb() ...@@ -841,8 +842,8 @@ __epm_addkey_deb()
epm_addkey() epm_addkey()
{ {
case $DISTRNAME in case $BASEDISTRNAME in
ALTLinux|ALTServer) "alt")
__epm_addkey_altlinux "$@" __epm_addkey_altlinux "$@"
return return
;; ;;
...@@ -911,8 +912,8 @@ epm_addrepo() ...@@ -911,8 +912,8 @@ epm_addrepo()
{ {
local repo="$*" local repo="$*"
case $DISTRNAME in case $BASEDISTRNAME in
ALTLinux|ALTServer) "alt")
# Note! Don't use quotes here # Note! Don't use quotes here
__epm_addrepo_altlinux $repo __epm_addrepo_altlinux $repo
return return
...@@ -1404,8 +1405,8 @@ EOF ...@@ -1404,8 +1405,8 @@ EOF
epm_autoremove() epm_autoremove()
{ {
case $DISTRNAME in case $BASEDISTRNAME in
ALTLinux|ALTServer) "alt")
if [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" = "help" ] ; then if [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" = "help" ] ; then
epm_autoremove_print_help epm_autoremove_print_help
return 0 return 0
...@@ -1859,8 +1860,8 @@ case $PMTYPE in ...@@ -1859,8 +1860,8 @@ case $PMTYPE in
;; ;;
esac esac
case $DISTRNAME in case $BASEDISTRNAME in
ALTLinux|ALTServer) "alt")
epm_checksystem_$DISTRNAME epm_checksystem_$DISTRNAME
;; ;;
*) *)
...@@ -2105,8 +2106,8 @@ __epm_commentrepo_alt() ...@@ -2105,8 +2106,8 @@ __epm_commentrepo_alt()
epm_commentrepo() epm_commentrepo()
{ {
case $DISTRNAME in case $BASEDISTRNAME in
ALTLinux|ALTServer) "alt")
__epm_commentrepo_alt "$@" __epm_commentrepo_alt "$@"
return return
;; ;;
...@@ -2236,8 +2237,8 @@ try_fix_apt_rpm_dupls() ...@@ -2236,8 +2237,8 @@ try_fix_apt_rpm_dupls()
epm_dedup() epm_dedup()
{ {
case "$DISTRNAME" in case "$BASEDISTRNAME" in
ALTLinux|ALTServer) "alt")
assure_exists /usr/share/apt/scripts/dedup.lua apt-scripts assure_exists /usr/share/apt/scripts/dedup.lua apt-scripts
if [ -z "$direct" ] && [ -f /usr/share/apt/scripts/dedup.lua ] ; then if [ -z "$direct" ] && [ -f /usr/share/apt/scripts/dedup.lua ] ; then
info "Check for duplicates via apt-get dedup from apt-scripts (also you can use internal EPM dedup implementation with --direct option)" info "Check for duplicates via apt-get dedup from apt-scripts (also you can use internal EPM dedup implementation with --direct option)"
...@@ -2524,8 +2525,8 @@ epm_download() ...@@ -2524,8 +2525,8 @@ epm_download()
{ {
local CMD local CMD
case $DISTRNAME-$PMTYPE in case "$BASEDISTRNAME" in
ALTLinux-apt-rpm|ALTServer-apt-rpm) "alt")
__epm_download_alt $* __epm_download_alt $*
return return
;; ;;
...@@ -2844,17 +2845,23 @@ epm_full_upgrade() ...@@ -2844,17 +2845,23 @@ epm_full_upgrade()
[ -n "$quiet" ] || echo [ -n "$quiet" ] || echo
docmd epm update-kernel || fatal "updating of the kernel is failed." docmd epm update-kernel || fatal "updating of the kernel is failed."
[ -n "$quiet" ] || echo if [ -z "$full_upgrade_no_epm_play" ] ; then
docmd epm play --update all || fatal "updating of applications installed via epm play is failed."
if which flatpak 2>/dev/null >/dev/null ; then
[ -n "$quiet" ] || echo [ -n "$quiet" ] || echo
docmd flatpak update docmd epm play --update all || fatal "updating of applications installed via epm play is failed."
fi fi
if which snap 2>/dev/null >/dev/null ; then if [ -z "$full_upgrade_no_flatpack" ] ; then
[ -n "$quiet" ] || echo if which flatpak 2>/dev/null >/dev/null ; then
sudocmd snap refresh [ -n "$quiet" ] || echo
docmd flatpak update
fi
fi
if [ -z "$full_upgrade_no_snap" ] ; then
if which snap 2>/dev/null >/dev/null ; then
[ -n "$quiet" ] || echo
sudocmd snap refresh
fi
fi fi
[ -n "$quiet" ] || echo [ -n "$quiet" ] || echo
...@@ -2863,9 +2870,103 @@ epm_full_upgrade() ...@@ -2863,9 +2870,103 @@ epm_full_upgrade()
# File bin/epm-history: # File bin/epm-history:
__alt_epm_history_uniq()
{
a= journalctl -t apt-get | grep "apt-get\[[0-9][0-9]*\]:" | sed -e "s|.*apt-get\[\([0-9][0-9]*\)\]: .*|\1|" | uniq | tac
}
__alt_epm_history_select()
{
local pid="$1"
local verb="$2"
a= journalctl -t apt-get | grep "apt-get\[$pid\]: .*$verb" | sed -e "s|.*apt-get\[[0-9][0-9]*\]: ||" | cut -d" " -f 1
}
_alt_epm_history_date()
{
local pid="$1"
a= journalctl -t apt-get | grep "apt-get\[$pid\]: " | head -n1 | cut -d" " -f 1-3
}
__alt_epm_history_removed()
{
echo "Removed packages history:"
__alt_epm_history_uniq | while read pid ; do
date="$(_alt_epm_history_date $pid)"
echo
echo "$date apt-get session $pid:"
removed="$(epm print shortname for $(__alt_epm_history_select $pid "removed") )"
installed="$(epm print shortname for $(__alt_epm_history_select $pid "installed") )"
epm tool --quiet estrlist exclude "$installed" "$removed" | xargs -n1 echo | sed -e "s|^| |"
done
}
__alt_epm_history_installed()
{
echo "Installed packages history:"
__alt_epm_history_uniq | while read pid ; do
echo
date="$(_alt_epm_history_date $pid)"
echo "$date apt-get session $pid:"
#epm print shortname for $(__alt_epm_history_select $pid "installed") | sed -e "s|^| |"
removed="$(epm print shortname for $(__alt_epm_history_select $pid "removed") )"
installed="$(epm print shortname for $(__alt_epm_history_select $pid "installed") )"
epm tool --quiet estrlist exclude "$removed" "$installed" | xargs -n1 echo | sed -e "s|^| |"
done
}
__alt_epm_history_updated()
{
echo "Updated packages history:"
__alt_epm_history_uniq | while read pid ; do
echo
date="$(_alt_epm_history_date $pid)"
echo "$date apt-get session $pid:"
#epm print shortname for $(__alt_epm_history_select $pid "installed") | sed -e "s|^| |"
removed="$(epm print shortname for $(__alt_epm_history_select $pid "removed") )"
installed="$(epm print shortname for $(__alt_epm_history_select $pid "installed") )"
epm tool --quiet estrlist intersection "$removed" "$installed" | xargs -n1 echo | sed -e "s|^| |"
done
}
epm_history_help()
{
echo "package management history"
get_help HELPCMD $SHAREDIR/epm-history
cat <<EOF
Examples:
epm history
epm history --removed
EOF
}
epm_history() epm_history()
{ {
if [ $PMTYPE = "apt-rpm" ] ; then
case "$1" in
"-h"|"--help"|"help") # HELPCMD: help
epm_history_help
return
;;
--installed) # HELPCMD: print only new installed packages
__alt_epm_history_installed | less
return
;;
--removed) # HELPCMD: print only removed packages
__alt_epm_history_removed #| less
return
;;
--updated) # HELPCMD: print only updated packages
__alt_epm_history_updated | less
return
;;
*)
fatal "Unknown option $1"
esac
fi
[ -z "$*" ] || fatal "No arguments are allowed here" [ -z "$*" ] || fatal "No arguments are allowed here"
case $PMTYPE in case $PMTYPE in
...@@ -3296,8 +3397,8 @@ __epm_check_if_rpm_already_installed() ...@@ -3296,8 +3397,8 @@ __epm_check_if_rpm_already_installed()
__handle_direct_install() __handle_direct_install()
{ {
case "$DISTRNAME" in case "$BASEDISTRNAME" in
ALTLinux|ALTServer) "alt")
local pkg url local pkg url
for pkg in $pkg_names ; do for pkg in $pkg_names ; do
url=$(__epm_get_altpkg_url $pkg) url=$(__epm_get_altpkg_url $pkg)
...@@ -3332,8 +3433,8 @@ epm_install_files() ...@@ -3332,8 +3433,8 @@ epm_install_files()
# TODO: check read permissions # TODO: check read permissions
# sudo test -r FILE # sudo test -r FILE
# do not fallback to install_names if we have no permissions # do not fallback to install_names if we have no permissions
case "$DISTRNAME" in case "$BASEDISTRNAME" in
ALTLinux|ALTServer) "alt")
# do not use low-level for install by file path (f.i. epm install /usr/bin/git) # do not use low-level for install by file path (f.i. epm install /usr/bin/git)
if __epm_if_command_path $files ; then if __epm_if_command_path $files ; then
...@@ -3630,7 +3731,7 @@ epm_print_install_names_command() ...@@ -3630,7 +3731,7 @@ epm_print_install_names_command()
epm_install() epm_install()
{ {
if [ "$DISTRNAME" = "ALTLinux" ] || [ "$DISTRNAME" = "ALTServer" ] ; then if [ "$BASEDISTRNAME" = "alt" ] ; then
if tasknumber "$pkg_names" >/dev/null ; then if tasknumber "$pkg_names" >/dev/null ; then
assure_exists apt-repo assure_exists apt-repo
# TODO: add --auto support # TODO: add --auto support
...@@ -3822,8 +3923,8 @@ epm_kernel_update() ...@@ -3822,8 +3923,8 @@ epm_kernel_update()
info "Updating system kernel to the latest version..." info "Updating system kernel to the latest version..."
case $DISTRNAME in case $BASEDISTRNAME in
ALTLinux|ALTServer) "alt")
if ! __epm_query_package kernel-image >/dev/null ; then if ! __epm_query_package kernel-image >/dev/null ; then
info "No installed kernel packages, skipping update" info "No installed kernel packages, skipping update"
return return
...@@ -3910,8 +4011,8 @@ __dnf_assure_versionlock() ...@@ -3910,8 +4011,8 @@ __dnf_assure_versionlock()
epm_mark_hold() epm_mark_hold()
{ {
case $DISTRNAME in case $BASEDISTRNAME in
ALTLinux|ALTServer) "alt")
__alt_mark_hold "$@" __alt_mark_hold "$@"
exit exit
;; ;;
...@@ -3945,8 +4046,8 @@ esac ...@@ -3945,8 +4046,8 @@ esac
epm_mark_unhold() epm_mark_unhold()
{ {
case $DISTRNAME in case $BASEDISTRNAME in
ALTLinux|ALTServer) "alt")
__alt_mark_unhold "$@" __alt_mark_unhold "$@"
exit exit
;; ;;
...@@ -3980,8 +4081,8 @@ esac ...@@ -3980,8 +4081,8 @@ esac
epm_mark_showhold() epm_mark_showhold()
{ {
case $DISTRNAME in case $BASEDISTRNAME in
ALTLinux|ALTServer) "alt")
__alt_mark_showhold "$@" __alt_mark_showhold "$@"
exit exit
;; ;;
...@@ -4015,8 +4116,8 @@ esac ...@@ -4015,8 +4116,8 @@ esac
epm_mark_auto() epm_mark_auto()
{ {
case $DISTRNAME in case $BASEDISTRNAME in
ALTLinux|ALTServer) "alt")
sudocmd apt-mark auto "$@" sudocmd apt-mark auto "$@"
exit exit
;; ;;
...@@ -4046,8 +4147,8 @@ esac ...@@ -4046,8 +4147,8 @@ esac
epm_mark_manual() epm_mark_manual()
{ {
case $DISTRNAME in case $BASEDISTRNAME in
ALTLinux|ALTServer) "alt")
sudocmd apt-mark manual "$@" sudocmd apt-mark manual "$@"
exit exit
;; ;;
...@@ -4077,8 +4178,8 @@ esac ...@@ -4077,8 +4178,8 @@ esac
epm_mark_showauto() epm_mark_showauto()
{ {
case $DISTRNAME in case $BASEDISTRNAME in
ALTLinux|ALTServer) "alt")
sudocmd apt-mark showauto "$@" sudocmd apt-mark showauto "$@"
exit exit
;; ;;
...@@ -4101,8 +4202,8 @@ esac ...@@ -4101,8 +4202,8 @@ esac
epm_mark_showmanual() epm_mark_showmanual()
{ {
case $DISTRNAME in case $BASEDISTRNAME in
ALTLinux|ALTServer) "alt")
sudocmd apt-mark showmanual "$@" sudocmd apt-mark showmanual "$@"
exit exit
;; ;;
...@@ -4122,6 +4223,16 @@ esac ...@@ -4122,6 +4223,16 @@ esac
} }
epm_mark_help()
{
echo "mark is the interface for marking packages"
get_help HELPCMD $SHAREDIR/epm-mark
cat <<EOF
Examples:
epm mark hold mc
epm manual mc
EOF
}
epm_mark() epm_mark()
{ {
...@@ -4129,13 +4240,7 @@ epm_mark() ...@@ -4129,13 +4240,7 @@ epm_mark()
[ -n "$CMD" ] && shift [ -n "$CMD" ] && shift
case "$CMD" in case "$CMD" in
""|"-h"|"--help"|help) # HELPCMD: help ""|"-h"|"--help"|help) # HELPCMD: help
echo "mark is the interface for marking packages" epm_mark_help
get_help HELPCMD $SHAREDIR/epm-mark
cat <<EOF
Examples:
epm mark hold mc
epm manual mc
EOF
;; ;;
hold) # HELPCMD: mark the given package(s) as held back hold) # HELPCMD: mark the given package(s) as held back
epm_mark_hold "$@" epm_mark_hold "$@"
...@@ -4567,7 +4672,7 @@ __epm_play_list() ...@@ -4567,7 +4672,7 @@ __epm_play_list()
} }
__epm_play_help() epm_play_help()
{ {
cat <<EOF cat <<EOF
Usage: epm play [options] [<app>] Usage: epm play [options] [<app>]
...@@ -4589,7 +4694,7 @@ local psdir="$(realpath $CONFIGDIR/play.d)" ...@@ -4589,7 +4694,7 @@ local psdir="$(realpath $CONFIGDIR/play.d)"
local prsdir="$(realpath $CONFIGDIR/prescription.d)" local prsdir="$(realpath $CONFIGDIR/prescription.d)"
if [ "$1" = "-h" ] || [ "$1" = "--help" ] ; then if [ "$1" = "-h" ] || [ "$1" = "--help" ] ; then
__epm_play_help epm_play_help
exit exit
fi fi
...@@ -4892,11 +4997,19 @@ PKGNAMEMASK="\(.*\)-\([0-9].*\)-\(.*[0-9].*\)\.\(.*\)\.\(.*\)" ...@@ -4892,11 +4997,19 @@ PKGNAMEMASK="\(.*\)-\([0-9].*\)-\(.*[0-9].*\)\.\(.*\)\.\(.*\)"
print_name() print_name()
{ {
# FIXME:
# don't change name (false cases) # don't change name (false cases)
#echo "$@" | xargs -n1 echo | sed -e "s|$PKGNAMEMASK4|\1-\2-\3|" -e "s|$PKGNAMEMASK3|\1|" #echo "$@" | xargs -n1 echo | sed -e "s|$PKGNAMEMASK4|\1-\2-\3|" -e "s|$PKGNAMEMASK3|\1|"
echo "$@" | xargs -n1 echo echo "$@" | xargs -n1 echo
} }
print_shortname()
{
#if [ "$
#echo "$@" | xargs -n1 echo | sed -e "s|$PKGNAMEMASK4|\1-\2-\3|" -e "s|$PKGNAMEMASK3|\1|"
echo "$@" | xargs -n1 echo | sed -e "s|$PKGNAMEMASK3|\1|"
}
print_version() print_version()
{ {
echo "$1" | xargs -n1 echo | sed -e "s|$PKGNAMEMASK4|\1-\2-\3|" -e "s|$PKGNAMEMASK3|\2|" echo "$1" | xargs -n1 echo | sed -e "s|$PKGNAMEMASK4|\1-\2-\3|" -e "s|$PKGNAMEMASK3|\2|"
...@@ -4962,8 +5075,20 @@ print_srcpkgname() ...@@ -4962,8 +5075,20 @@ print_srcpkgname()
compare_version() compare_version()
{ {
which rpmevrcmp 2>/dev/null >/dev/null || fatal "rpmevrcmp exists in ALT Linux only" case $PMTYPE in
a= rpmevrcmp "$@" *-rpm)
which rpmevrcmp 2>/dev/null >/dev/null || fatal "rpmevrcmp exists in ALT Linux only"
a= rpmevrcmp "$@"
;;
*-dpkg)
a= dpkg --compare-versions "$1" lt "$2" && echo "-1" && return
a= dpkg --compare-versions "$1" eq "$2" && echo "0" && return
echo "1"
;;
*)
fatal "Not implemented for $PMTYPE"
;;
esac
} }
construct_name() construct_name()
...@@ -4984,6 +5109,27 @@ construct_name() ...@@ -4984,6 +5109,27 @@ construct_name()
echo "${name}${version}${pds}$arch.$pkgtype" echo "${name}${version}${pds}$arch.$pkgtype"
} }
epm_print_help()
{
cat <<EOF
Examples:
epm print info [args] print system and distro info (via distro_info command)
epm print name [from filename|for package] NN print only name of package name or package file
epm print shortname [for package] NN print only short name of package name
epm print version [from filename|for package] NN print only version of package name or package file
epm print release [from filename|for package] NN print only release of package name or package file
epm print version-release [from filename|for package] NN print only release-release of package name or package file
epm print field FF for package NN print field of the package
epm print pkgname from filename NN print package name for the package file
epm print srcname from filename NN print source name for the package file
epm print srcpkgname from [filename|package] NN print source package name for the binary package file
epm print specname from filename NN print spec filename for the source package file
epm print binpkgfilelist in DIR for NN list binary package(s) filename(s) from DIR for the source package file
epm print compare [package] version N1 N2 compare (package) versions and print -1 (N1 < N2), 0 (N1 == N2), 1 (N1 > N2)
epm print constructname <name> <version> [arch] [ pkgtype] print distro dependend package filename from args name version arch pkgtype
EOF
}
epm_print() epm_print()
{ {
local WHAT="$1" local WHAT="$1"
...@@ -5009,22 +5155,7 @@ epm_print() ...@@ -5009,22 +5155,7 @@ epm_print()
fatal "Use epm print help to get help." fatal "Use epm print help to get help."
;; ;;
"-h"|"--help"|"help") "-h"|"--help"|"help")
cat <<EOF epm_print_help
Examples:
epm print info [args] print system and distro info (via distro_info command)
epm print name [from filename|for package] NN print only name of package name or package file
epm print version [from filename|for package] NN print only version of package name or package file
epm print release [from filename|for package] NN print only release of package name or package file
epm print version-release [from filename|for package] NN print only release-release of package name or package file
epm print field FF for package NN print field of the package
epm print pkgname from filename NN print package name for the package file
epm print srcname from filename NN print source name for the package file
epm print srcpkgname from [filename|package] NN print source package name for the binary package file
epm print specname from filename NN print spec filename for the source package file
epm print binpkgfilelist in DIR for NN list binary package(s) filename(s) from DIR for the source package file
epm print compare [package] version N1 N2 compare (package) versions and print -1, 0, 1
epm print constructname <name> <version> [arch] [ pkgtype] print distro dependend package filename from args name version arch pkgtype
EOF
;; ;;
"name") "name")
[ -n "$1" ] || fatal "Arg is missed" [ -n "$1" ] || fatal "Arg is missed"
...@@ -5056,6 +5187,10 @@ EOF ...@@ -5056,6 +5187,10 @@ EOF
print_release "$@" print_release "$@"
fi fi
;; ;;
"shortname")
[ -n "$1" ] || exit 0 #fatal "Arg is missed"
print_shortname "$@"
;;
"version-release") "version-release")
[ -n "$1" ] || fatal "Arg is missed" [ -n "$1" ] || fatal "Arg is missed"
if [ -n "$FNFLAG" ] ; then if [ -n "$FNFLAG" ] ; then
...@@ -5876,8 +6011,8 @@ epm_release_downgrade() ...@@ -5876,8 +6011,8 @@ epm_release_downgrade()
# TODO: it is possible eatmydata does not do his work # TODO: it is possible eatmydata does not do his work
export EPMNOEATMYDATA=1 export EPMNOEATMYDATA=1
case $DISTRNAME in case $BASEDISTRNAME in
ALTLinux|ALTServer) "alt")
__epm_ru_update || fatal __epm_ru_update || fatal
# try to detect current release by repo # try to detect current release by repo
...@@ -6406,8 +6541,8 @@ epm_release_upgrade() ...@@ -6406,8 +6541,8 @@ epm_release_upgrade()
# TODO: it is possible eatmydata does not do his work # TODO: it is possible eatmydata does not do his work
export EPMNOEATMYDATA=1 export EPMNOEATMYDATA=1
case $DISTRNAME in case $BASEDISTRNAME in
ALTLinux|ALTServer) "alt")
__epm_ru_update || fatal __epm_ru_update || fatal
# TODO: remove this hack (or move it to distro_info) # TODO: remove this hack (or move it to distro_info)
...@@ -6848,7 +6983,7 @@ epm_remove() ...@@ -6848,7 +6983,7 @@ epm_remove()
return return
fi fi
if [ "$DISTRNAME" = "ALTLinux" ] || [ "$DISTRNAME" = "ALTServer" ] ; then if [ "$BASEDISTRNAME" = "alt" ] ; then
if tasknumber "$pkg_names" >/dev/null ; then if tasknumber "$pkg_names" >/dev/null ; then
assure_exists apt-repo assure_exists apt-repo
pkg_names="$(get_task_packages $pkg_names)" pkg_names="$(get_task_packages $pkg_names)"
...@@ -6917,8 +7052,8 @@ epm_remove_old_kernels() ...@@ -6917,8 +7052,8 @@ epm_remove_old_kernels()
warmup_bases warmup_bases
case $DISTRNAME in case $BASEDISTRNAME in
ALTLinux|ALTServer) "alt")
if ! __epm_query_package kernel-image >/dev/null ; then if ! __epm_query_package kernel-image >/dev/null ; then
info "No installed kernel packages, skipping cleaning" info "No installed kernel packages, skipping cleaning"
return return
...@@ -6936,6 +7071,9 @@ epm_remove_old_kernels() ...@@ -6936,6 +7071,9 @@ epm_remove_old_kernels()
fi fi
return ;; return ;;
esac
case $DISTRNAME in
Ubuntu) Ubuntu)
if ! __epm_query_package linux-image >/dev/null ; then if ! __epm_query_package linux-image >/dev/null ; then
info "No installed kernel packages, skipping cleaning" info "No installed kernel packages, skipping cleaning"
...@@ -7044,8 +7182,8 @@ __epm_removerepo_alt() ...@@ -7044,8 +7182,8 @@ __epm_removerepo_alt()
epm_removerepo() epm_removerepo()
{ {
case $DISTRNAME in case $BASEDISTRNAME in
ALTLinux|ALTServer) "alt")
__epm_removerepo_alt "$@" __epm_removerepo_alt "$@"
return return
;; ;;
...@@ -7418,11 +7556,11 @@ __epm_repack_to_rpm() ...@@ -7418,11 +7556,11 @@ __epm_repack_to_rpm()
fi fi
local subdir="$(echo *)" local subdir="$(echo *)"
[ -d "$subdir" ] || fatal "can't find subdir" [ -d "$subdir" ] || fatal "can't find subdir in $(pwd)"
# detect spec and move to prev dir # detect spec and move to prev dir
local spec="$(echo $tmpbuilddir/$subdir/*.spec)" local spec="$(echo $tmpbuilddir/$subdir/*.spec)"
[ -s "$spec" ] || fatal "can't find spec" [ -s "$spec" ] || fatal "Can't find spec $spec"
mv $spec $tmpbuilddir || fatal mv $spec $tmpbuilddir || fatal
spec="$tmpbuilddir/$(basename "$spec")" spec="$tmpbuilddir/$(basename "$spec")"
#__set_name_version $spec $PKGNAME $VERSION #__set_name_version $spec $PKGNAME $VERSION
...@@ -7525,7 +7663,7 @@ epm_repack() ...@@ -7525,7 +7663,7 @@ epm_repack()
__handle_pkg_urls_to_install __handle_pkg_urls_to_install
fi fi
[ -n "$pkg_names" ] && warning "Can't find $pkg_names" [ -n "$pkg_names" ] && warning "Can't find $pkg_names files"
[ -z "$pkg_files" ] && info "Skip empty repack list" && return 22 [ -z "$pkg_files" ] && info "Skip empty repack list" && return 22
if __epm_repack $pkg_files && [ -n "$repacked_pkgs" ] ; then if __epm_repack $pkg_files && [ -n "$repacked_pkgs" ] ; then
...@@ -7545,20 +7683,26 @@ epm_repack() ...@@ -7545,20 +7683,26 @@ epm_repack()
# File bin/epm-repo: # File bin/epm-repo:
epm_repo() epm_repo_help()
{ {
local CMD="$1" get_help HELPCMD $SHAREDIR/epm-repo
[ -n "$CMD" ] && shift cat <<EOF
case $CMD in
"-h"|"--help"|help) # HELPCMD: help
get_help HELPCMD $SHAREDIR/epm-repo
cat <<EOF
Examples: Examples:
epm repo set p9 epm repo set p9
epm repo add autoimports epm repo add autoimports
epm repo list epm repo list
epm repo change yandex epm repo change yandex
EOF EOF
}
epm_repo()
{
local CMD="$1"
[ -n "$CMD" ] && shift
case $CMD in
"-h"|"--help"|help) # HELPCMD: help
epm_repo_help
;; ;;
""|list) # HELPCMD: list packages ""|list) # HELPCMD: list packages
epm_repolist "$@" epm_repolist "$@"
...@@ -7827,8 +7971,8 @@ __fix_repo_to_basealt() ...@@ -7827,8 +7971,8 @@ __fix_repo_to_basealt()
epm_repofix() epm_repofix()
{ {
case $DISTRNAME in case $BASEDISTRNAME in
ALTLinux|ALTServer) "alt")
assure_exists apt-repo assure_exists apt-repo
[ -n "$quiet" ] || docmd apt-repo list [ -n "$quiet" ] || docmd apt-repo list
assure_root assure_root
...@@ -9300,7 +9444,7 @@ __epm_check_vendor() ...@@ -9300,7 +9444,7 @@ __epm_check_vendor()
[ -n "$scripts$noscripts" ] && return [ -n "$scripts$noscripts" ] && return
# only ALT # only ALT
[ "$DISTRNAME" = "ALTLinux" ] || [ "$DISTRNAME" = "ALTServer" ] || return [ "$BASEDISTRNAME" = "alt" ] || return
local i local i
for i in $* ; do for i in $* ; do
...@@ -9677,7 +9821,17 @@ done ...@@ -9677,7 +9821,17 @@ done
# File bin/epm-tool: # File bin/epm-tool:
epm_tool_help()
{
echo "Tools embedded in epm:"
get_help HELPCMD $SHAREDIR/epm-tool
cat <<EOF
Examples:
epm tool eget -U http://ya.ru
epm tool estrlist union a b a c
EOF
}
epm_tool() epm_tool()
{ {
...@@ -9689,14 +9843,7 @@ epm_tool() ...@@ -9689,14 +9843,7 @@ epm_tool()
fatal "Use epm tool help to get help." fatal "Use epm tool help to get help."
;; ;;
"-h"|"--help"|"help") "-h"|"--help"|"help")
echo "Tools embedded in epm:" epm_tool_help
get_help HELPCMD $SHAREDIR/epm-tool
cat <<EOF
Examples:
epm tool eget -U http://ya.ru
epm tool estrlist union a b a c
EOF
;; ;;
"eget") # HELPCMD: downloading tool (simular to wget or curl) "eget") # HELPCMD: downloading tool (simular to wget or curl)
showcmd eget "$@" showcmd eget "$@"
...@@ -9843,7 +9990,7 @@ epm_upgrade() ...@@ -9843,7 +9990,7 @@ epm_upgrade()
warmup_bases warmup_bases
if [ "$DISTRNAME" = "ALTLinux" ] || [ "$DISTRNAME" = "ALTServer" ] ; then if [ "$BASEDISTRNAME" = "alt" ] ; then
if tasknumber "$@" >/dev/null ; then if tasknumber "$@" >/dev/null ; then
local installlist="$(get_task_packages $*)" local installlist="$(get_task_packages $*)"
......
...@@ -592,6 +592,7 @@ set_distro_info() ...@@ -592,6 +592,7 @@ set_distro_info()
DISTRARCH=$($DISTRVENDOR --distro-arch) DISTRARCH=$($DISTRVENDOR --distro-arch)
fi fi
DISTRCONTROL="$($DISTRVENDOR -y)" DISTRCONTROL="$($DISTRVENDOR -y)"
[ -n "$BASEDISTRNAME" ] || BASEDISTRNAME=$($DISTRVENDOR -s)
# TODO: improve BIGTMPDIR conception # TODO: improve BIGTMPDIR conception
# https://bugzilla.mozilla.org/show_bug.cgi?id=69938 # https://bugzilla.mozilla.org/show_bug.cgi?id=69938
...@@ -667,8 +668,8 @@ serv_cat() ...@@ -667,8 +668,8 @@ serv_cat()
docmd systemctl cat "$SERVICE" "$@" docmd systemctl cat "$SERVICE" "$@"
;; ;;
*) *)
case $DISTRNAME in case $BASEDISTRNAME in
ALTLinux|ALTServer) "alt")
local INITFILE=/etc/init.d/$SERVICE local INITFILE=/etc/init.d/$SERVICE
[ -r "$INITFILE" ] || fatal "Can't find init file $INITFILE" [ -r "$INITFILE" ] || fatal "Can't find init file $INITFILE"
docmd cat $INITFILE docmd cat $INITFILE
...@@ -820,8 +821,8 @@ serv_exists() ...@@ -820,8 +821,8 @@ serv_exists()
docmd systemctl cat "$SERVICE" "$@" >/dev/null 2>/dev/null docmd systemctl cat "$SERVICE" "$@" >/dev/null 2>/dev/null
;; ;;
*) *)
case $DISTRNAME in case $BASEDISTRNAME in
ALTLinux|ALTServer) "alt")
local INITFILE=/etc/init.d/$SERVICE local INITFILE=/etc/init.d/$SERVICE
[ -r "$INITFILE" ] || return [ -r "$INITFILE" ] || return
return ;; return ;;
...@@ -988,8 +989,8 @@ serv_log() ...@@ -988,8 +989,8 @@ serv_log()
sudocmd journalctl -b -u "$SERVICE" "$@" sudocmd journalctl -b -u "$SERVICE" "$@"
;; ;;
*) *)
case $DISTRNAME in case $BASEDISTRNAME in
ALTLinux|ALTServer) "alt")
FF="" ; [ "$1" = "-f" ] && FF="-f" FF="" ; [ "$1" = "-f" ] && FF="-f"
__serv_log_altlinux "$SERVICE" $FF __serv_log_altlinux "$SERVICE" $FF
return ;; return ;;
...@@ -2375,7 +2376,7 @@ print_version() ...@@ -2375,7 +2376,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.31.1 https://wiki.etersoft.ru/Epm" echo "Service manager version 3.32.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