Commit c0efdeec authored by Vitaly Lipatov's avatar Vitaly Lipatov

add BASEDISTRNAME and use it for alt based systems

parent 8c038f47
......@@ -195,8 +195,8 @@ __epm_addkey_deb()
epm_addkey()
{
case $DISTRNAME in
ALTLinux|ALTServer)
case $BASEDISTRNAME in
"alt")
__epm_addkey_altlinux "$@"
return
;;
......@@ -265,8 +265,8 @@ epm_addrepo()
{
local repo="$*"
case $DISTRNAME in
ALTLinux|ALTServer)
case $BASEDISTRNAME in
"alt")
# Note! Don't use quotes here
__epm_addrepo_altlinux $repo
return
......
......@@ -232,8 +232,8 @@ EOF
epm_autoremove()
{
case $DISTRNAME in
ALTLinux|ALTServer)
case $BASEDISTRNAME in
"alt")
if [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" = "help" ] ; then
epm_autoremove_print_help
return 0
......
......@@ -53,8 +53,8 @@ case $PMTYPE in
;;
esac
case $DISTRNAME in
ALTLinux|ALTServer)
case $BASEDISTRNAME in
"alt")
epm_checksystem_$DISTRNAME
;;
*)
......
......@@ -90,8 +90,8 @@ __epm_commentrepo_alt()
epm_commentrepo()
{
case $DISTRNAME in
ALTLinux|ALTServer)
case $BASEDISTRNAME in
"alt")
__epm_commentrepo_alt "$@"
return
;;
......
......@@ -49,8 +49,8 @@ try_fix_apt_rpm_dupls()
epm_dedup()
{
case "$DISTRNAME" in
ALTLinux|ALTServer)
case "$BASEDISTRNAME" in
"alt")
assure_exists /usr/share/apt/scripts/dedup.lua apt-scripts
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)"
......
......@@ -190,8 +190,8 @@ epm_download()
{
local CMD
case $DISTRNAME-$PMTYPE in
ALTLinux-apt-rpm|ALTServer-apt-rpm)
case "$BASEDISTRNAME" in
"alt")
__epm_download_alt $*
return
;;
......
......@@ -273,8 +273,8 @@ __epm_check_if_rpm_already_installed()
__handle_direct_install()
{
case "$DISTRNAME" in
ALTLinux|ALTServer)
case "$BASEDISTRNAME" in
"alt")
load_helper epm-download
local pkg url
for pkg in $pkg_names ; do
......@@ -311,8 +311,8 @@ epm_install_files()
# TODO: check read permissions
# sudo test -r FILE
# do not fallback to install_names if we have no permissions
case "$DISTRNAME" in
ALTLinux|ALTServer)
case "$BASEDISTRNAME" in
"alt")
# do not use low-level for install by file path (f.i. epm install /usr/bin/git)
if __epm_if_command_path $files ; then
......@@ -611,7 +611,7 @@ epm_print_install_names_command()
epm_install()
{
if [ "$DISTRNAME" = "ALTLinux" ] || [ "$DISTRNAME" = "ALTServer" ] ; then
if [ "$BASEDISTRNAME" = "alt" ] ; then
if tasknumber "$pkg_names" >/dev/null ; then
assure_exists apt-repo
# TODO: add --auto support
......
......@@ -26,8 +26,8 @@ epm_kernel_update()
info "Updating system kernel to the latest version..."
case $DISTRNAME in
ALTLinux|ALTServer)
case $BASEDISTRNAME in
"alt")
load_helper epm-query_package
if ! __epm_query_package kernel-image >/dev/null ; then
info "No installed kernel packages, skipping update"
......
......@@ -81,8 +81,8 @@ __dnf_assure_versionlock()
epm_mark_hold()
{
case $DISTRNAME in
ALTLinux|ALTServer)
case $BASEDISTRNAME in
"alt")
__alt_mark_hold "$@"
exit
;;
......@@ -116,8 +116,8 @@ esac
epm_mark_unhold()
{
case $DISTRNAME in
ALTLinux|ALTServer)
case $BASEDISTRNAME in
"alt")
__alt_mark_unhold "$@"
exit
;;
......@@ -151,8 +151,8 @@ esac
epm_mark_showhold()
{
case $DISTRNAME in
ALTLinux|ALTServer)
case $BASEDISTRNAME in
"alt")
__alt_mark_showhold "$@"
exit
;;
......@@ -186,8 +186,8 @@ esac
epm_mark_auto()
{
case $DISTRNAME in
ALTLinux|ALTServer)
case $BASEDISTRNAME in
"alt")
sudocmd apt-mark auto "$@"
exit
;;
......@@ -217,8 +217,8 @@ esac
epm_mark_manual()
{
case $DISTRNAME in
ALTLinux|ALTServer)
case $BASEDISTRNAME in
"alt")
sudocmd apt-mark manual "$@"
exit
;;
......@@ -248,8 +248,8 @@ esac
epm_mark_showauto()
{
case $DISTRNAME in
ALTLinux|ALTServer)
case $BASEDISTRNAME in
"alt")
sudocmd apt-mark showauto "$@"
exit
;;
......@@ -272,8 +272,8 @@ esac
epm_mark_showmanual()
{
case $DISTRNAME in
ALTLinux|ALTServer)
case $BASEDISTRNAME in
"alt")
sudocmd apt-mark showmanual "$@"
exit
;;
......
......@@ -60,8 +60,8 @@ epm_release_downgrade()
# TODO: it is possible eatmydata does not do his work
export EPMNOEATMYDATA=1
case $DISTRNAME in
ALTLinux|ALTServer)
case $BASEDISTRNAME in
"alt")
__epm_ru_update || fatal
# try to detect current release by repo
......
......@@ -447,8 +447,8 @@ epm_release_upgrade()
# TODO: it is possible eatmydata does not do his work
export EPMNOEATMYDATA=1
case $DISTRNAME in
ALTLinux|ALTServer)
case $BASEDISTRNAME in
"alt")
__epm_ru_update || fatal
# TODO: remove this hack (or move it to distro_info)
......
......@@ -294,7 +294,7 @@ epm_remove()
return
fi
if [ "$DISTRNAME" = "ALTLinux" ] || [ "$DISTRNAME" = "ALTServer" ] ; then
if [ "$BASEDISTRNAME" = "alt" ] ; then
load_helper epm-sh-altlinux
if tasknumber "$pkg_names" >/dev/null ; then
assure_exists apt-repo
......
......@@ -24,8 +24,8 @@ epm_remove_old_kernels()
warmup_bases
case $DISTRNAME in
ALTLinux|ALTServer)
case $BASEDISTRNAME in
"alt")
load_helper epm-query_package
if ! __epm_query_package kernel-image >/dev/null ; then
info "No installed kernel packages, skipping cleaning"
......@@ -44,6 +44,9 @@ epm_remove_old_kernels()
fi
return ;;
esac
case $DISTRNAME in
Ubuntu)
load_helper epm-query_package
if ! __epm_query_package linux-image >/dev/null ; then
......
......@@ -93,8 +93,8 @@ __epm_removerepo_alt()
epm_removerepo()
{
case $DISTRNAME in
ALTLinux|ALTServer)
case $BASEDISTRNAME in
"alt")
__epm_removerepo_alt "$@"
return
;;
......
......@@ -234,8 +234,8 @@ __fix_repo_to_basealt()
epm_repofix()
{
case $DISTRNAME in
ALTLinux|ALTServer)
case $BASEDISTRNAME in
"alt")
assure_exists apt-repo
[ -n "$quiet" ] || docmd apt-repo list
assure_root
......
......@@ -619,6 +619,7 @@ set_distro_info()
DISTRARCH=$($DISTRVENDOR --distro-arch)
fi
DISTRCONTROL="$($DISTRVENDOR -y)"
[ -n "$BASEDISTRNAME" ] || BASEDISTRNAME=$($DISTRVENDOR -s)
# TODO: improve BIGTMPDIR conception
# https://bugzilla.mozilla.org/show_bug.cgi?id=69938
......
......@@ -112,7 +112,7 @@ __epm_check_vendor()
[ -n "$scripts$noscripts" ] && return
# only ALT
[ "$DISTRNAME" = "ALTLinux" ] || [ "$DISTRNAME" = "ALTServer" ] || return
[ "$BASEDISTRNAME" = "alt" ] || return
local i
for i in $* ; do
......
......@@ -29,7 +29,7 @@ epm_upgrade()
warmup_bases
if [ "$DISTRNAME" = "ALTLinux" ] || [ "$DISTRNAME" = "ALTServer" ] ; then
if [ "$BASEDISTRNAME" = "alt" ] ; then
load_helper epm-sh-altlinux
if tasknumber "$@" >/dev/null ; then
load_helper epm-addrepo
......
......@@ -27,8 +27,8 @@ serv_cat()
docmd systemctl cat "$SERVICE" "$@"
;;
*)
case $DISTRNAME in
ALTLinux|ALTServer)
case $BASEDISTRNAME in
"alt")
local INITFILE=/etc/init.d/$SERVICE
[ -r "$INITFILE" ] || fatal "Can't find init file $INITFILE"
docmd cat $INITFILE
......
......@@ -28,8 +28,8 @@ serv_exists()
docmd systemctl cat "$SERVICE" "$@" >/dev/null 2>/dev/null
;;
*)
case $DISTRNAME in
ALTLinux|ALTServer)
case $BASEDISTRNAME in
"alt")
local INITFILE=/etc/init.d/$SERVICE
[ -r "$INITFILE" ] || return
return ;;
......
......@@ -52,8 +52,8 @@ serv_log()
sudocmd journalctl -b -u "$SERVICE" "$@"
;;
*)
case $DISTRNAME in
ALTLinux|ALTServer)
case $BASEDISTRNAME in
"alt")
FF="" ; [ "$1" = "-f" ] && FF="-f"
__serv_log_altlinux "$SERVICE" $FF
return ;;
......
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