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() ...@@ -195,8 +195,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
;; ;;
...@@ -265,8 +265,8 @@ epm_addrepo() ...@@ -265,8 +265,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
......
...@@ -232,8 +232,8 @@ EOF ...@@ -232,8 +232,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
......
...@@ -53,8 +53,8 @@ case $PMTYPE in ...@@ -53,8 +53,8 @@ case $PMTYPE in
;; ;;
esac esac
case $DISTRNAME in case $BASEDISTRNAME in
ALTLinux|ALTServer) "alt")
epm_checksystem_$DISTRNAME epm_checksystem_$DISTRNAME
;; ;;
*) *)
......
...@@ -90,8 +90,8 @@ __epm_commentrepo_alt() ...@@ -90,8 +90,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
;; ;;
......
...@@ -49,8 +49,8 @@ try_fix_apt_rpm_dupls() ...@@ -49,8 +49,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)"
......
...@@ -190,8 +190,8 @@ epm_download() ...@@ -190,8 +190,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
;; ;;
......
...@@ -273,8 +273,8 @@ __epm_check_if_rpm_already_installed() ...@@ -273,8 +273,8 @@ __epm_check_if_rpm_already_installed()
__handle_direct_install() __handle_direct_install()
{ {
case "$DISTRNAME" in case "$BASEDISTRNAME" in
ALTLinux|ALTServer) "alt")
load_helper epm-download load_helper epm-download
local pkg url local pkg url
for pkg in $pkg_names ; do for pkg in $pkg_names ; do
...@@ -311,8 +311,8 @@ epm_install_files() ...@@ -311,8 +311,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
...@@ -611,7 +611,7 @@ epm_print_install_names_command() ...@@ -611,7 +611,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
......
...@@ -26,8 +26,8 @@ epm_kernel_update() ...@@ -26,8 +26,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")
load_helper epm-query_package load_helper epm-query_package
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"
......
...@@ -81,8 +81,8 @@ __dnf_assure_versionlock() ...@@ -81,8 +81,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
;; ;;
...@@ -116,8 +116,8 @@ esac ...@@ -116,8 +116,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
;; ;;
...@@ -151,8 +151,8 @@ esac ...@@ -151,8 +151,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
;; ;;
...@@ -186,8 +186,8 @@ esac ...@@ -186,8 +186,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
;; ;;
...@@ -217,8 +217,8 @@ esac ...@@ -217,8 +217,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
;; ;;
...@@ -248,8 +248,8 @@ esac ...@@ -248,8 +248,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
;; ;;
...@@ -272,8 +272,8 @@ esac ...@@ -272,8 +272,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
;; ;;
......
...@@ -60,8 +60,8 @@ epm_release_downgrade() ...@@ -60,8 +60,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
......
...@@ -447,8 +447,8 @@ epm_release_upgrade() ...@@ -447,8 +447,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)
......
...@@ -294,7 +294,7 @@ epm_remove() ...@@ -294,7 +294,7 @@ epm_remove()
return return
fi fi
if [ "$DISTRNAME" = "ALTLinux" ] || [ "$DISTRNAME" = "ALTServer" ] ; then if [ "$BASEDISTRNAME" = "alt" ] ; then
load_helper epm-sh-altlinux load_helper epm-sh-altlinux
if tasknumber "$pkg_names" >/dev/null ; then if tasknumber "$pkg_names" >/dev/null ; then
assure_exists apt-repo assure_exists apt-repo
......
...@@ -24,8 +24,8 @@ epm_remove_old_kernels() ...@@ -24,8 +24,8 @@ epm_remove_old_kernels()
warmup_bases warmup_bases
case $DISTRNAME in case $BASEDISTRNAME in
ALTLinux|ALTServer) "alt")
load_helper epm-query_package load_helper epm-query_package
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"
...@@ -44,6 +44,9 @@ epm_remove_old_kernels() ...@@ -44,6 +44,9 @@ epm_remove_old_kernels()
fi fi
return ;; return ;;
esac
case $DISTRNAME in
Ubuntu) Ubuntu)
load_helper epm-query_package load_helper epm-query_package
if ! __epm_query_package linux-image >/dev/null ; then if ! __epm_query_package linux-image >/dev/null ; then
......
...@@ -93,8 +93,8 @@ __epm_removerepo_alt() ...@@ -93,8 +93,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
;; ;;
......
...@@ -234,8 +234,8 @@ __fix_repo_to_basealt() ...@@ -234,8 +234,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
......
...@@ -619,6 +619,7 @@ set_distro_info() ...@@ -619,6 +619,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
......
...@@ -112,7 +112,7 @@ __epm_check_vendor() ...@@ -112,7 +112,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
......
...@@ -29,7 +29,7 @@ epm_upgrade() ...@@ -29,7 +29,7 @@ epm_upgrade()
warmup_bases warmup_bases
if [ "$DISTRNAME" = "ALTLinux" ] || [ "$DISTRNAME" = "ALTServer" ] ; then if [ "$BASEDISTRNAME" = "alt" ] ; then
load_helper epm-sh-altlinux load_helper epm-sh-altlinux
if tasknumber "$@" >/dev/null ; then if tasknumber "$@" >/dev/null ; then
load_helper epm-addrepo load_helper epm-addrepo
......
...@@ -27,8 +27,8 @@ serv_cat() ...@@ -27,8 +27,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
......
...@@ -28,8 +28,8 @@ serv_exists() ...@@ -28,8 +28,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 ;;
......
...@@ -52,8 +52,8 @@ serv_log() ...@@ -52,8 +52,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 ;;
......
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