Commit e4d9a8a8 authored by Vitaly Lipatov's avatar Vitaly Lipatov

backported to p7 as 1.7.5-alt0.M70P.1 (with rpmbph script)

parents 050081aa 33d4fbc7
#!/bin/sh #!/bin/sh
# #
# Copyright (C) 2013, 2014, 2015 Etersoft # Copyright (C) 2013-2016 Etersoft
# Copyright (C) 2013, 2014, 2015 Vitaly Lipatov <lav@etersoft.ru> # Copyright (C) 2013-2016 Vitaly Lipatov <lav@etersoft.ru>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by # it under the terms of the GNU Affero General Public License as published by
...@@ -38,48 +38,77 @@ is_dirpath() ...@@ -38,48 +38,77 @@ is_dirpath()
rhas "$1" "/" rhas "$1" "/"
} }
# Do fast checking for command and install package if the command does not exist __epm_need_update()
{
local PACKAGE="$1"
local PACKAGEVERSION="$2"
# $1 - command name [ -n "$PACKAGEVERSION" ] || return 0
# $2 - package name
__epm_assure() load_helper epm-query
is_installed "$PACKAGE" || return 0
load_helper epm-print
# epm print version for package N
local INSTALLEDVERSION=$(query_package_field "version" "$PACKAGE")
# if needed >= installed, return 0
[ "$(compare_version "$PACKAGEVERSION" "$INSTALLEDVERSION")" -gt 0 ] && return 0
return 1
}
__epm_assure_checking()
{ {
local CMD="$1"
local PACKAGE="$2"
local PACKAGEVERSION="$3"
[ -n "$PACKAGEVERSION" ] && return 1
if is_dirpath "$1" ; then if is_dirpath "$CMD" ; then
if [ -e "$1" ] ; then if [ -e "$CMD" ] ; then
if [ -n "$verbose" ] ; then if [ -n "$verbose" ] ; then
info "File or directory $1 is already exists." info "File or directory $CMD is already exists."
epm qf "$1" epm qf "$CMD"
fi fi
return 0 return 0
fi fi
[ -n "$2" ] || fatal "You need run with package name param when use with absolute path" [ -n "$PACKAGE" ] || fatal "You need run with package name param when use with absolute path"
return 0
docmd epm --auto --skip-installed install "$2"
return
fi fi
if __check_command_in_path "$1" >/dev/null ; then if __check_command_in_path "$CMD" >/dev/null ; then
if [ -n "$verbose" ] ; then if [ -n "$verbose" ] ; then
local compath="$(__check_command_in_path "$1")" local compath="$(__check_command_in_path "$1")"
info "Command $1 is exists: $compath" info "Command $CMD is exists: $compath"
epm qf "$compath" epm qf "$compath"
fi fi
return 0 return 0
fi fi
# TODO: use package name normalization return 1
info "Installing appropriate package for $1 command..." }
# Do fast checking for command and install package if the command does not exist
# $1 - command name
# $2 - [package name]
# $3 - [needed package version]
__epm_assure()
{
local CMD="$1"
local PACKAGE="$2" local PACKAGE="$2"
local PACKAGEVERSION="$3"
[ -n "$PACKAGE" ] || PACKAGE="$1" [ -n "$PACKAGE" ] || PACKAGE="$1"
local PACKAGEVERSION="$3" __epm_assure_checking $CMD $PACKAGE $PACKAGEVERSION && return 0
warning "TODO: check for PACKAGEVERSION is missed"
info "Installing appropriate package for $CMD command..."
__epm_need_update $PACKAGE $PACKAGEVERSION || return 0
docmd epm --auto --skip-installed install "$PACKAGE" docmd epm --auto install $PACKAGE
} }
......
#!/bin/sh #!/bin/sh
# #
# Copyright (C) 2013 Etersoft # Copyright (C) 2013, 2016 Etersoft
# Copyright (C) 2013 Vitaly Lipatov <lav@etersoft.ru> # Copyright (C) 2013, 2016 Vitaly Lipatov <lav@etersoft.ru>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by # it under the terms of the GNU Affero General Public License as published by
...@@ -28,8 +28,9 @@ epm_kernel_update() ...@@ -28,8 +28,9 @@ epm_kernel_update()
info "No installed kernel packages, skipping update" info "No installed kernel packages, skipping update"
return return
fi fi
assure_exists update-kernel assure_exists update-kernel update-kernel 0.9.9
sudocmd update-kernel $pkg_filenames sudocmd update-kernel $pkg_filenames || return
sudocmd remove-old-kernels $pkg_filenames
return ;; return ;;
esac esac
......
...@@ -88,6 +88,11 @@ print_srcpkgname() ...@@ -88,6 +88,11 @@ print_srcpkgname()
query_package_field sourcerpm "$@" query_package_field sourcerpm "$@"
} }
compare_version()
{
which rpmevrcmp 2>/dev/null >/dev/null || fatal "rpmevrcmp exists in ALT Linux only"
rpmevrcmp "$@"
}
__epm_print() __epm_print()
{ {
...@@ -124,6 +129,7 @@ cat <<EOF ...@@ -124,6 +129,7 @@ cat <<EOF
epm print srcpkgname from [filename|package] NN print source package name for the binary 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 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 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
EOF EOF
;; ;;
"name") "name")
...@@ -194,6 +200,15 @@ EOF ...@@ -194,6 +200,15 @@ EOF
[ -n "$1" ] || fatal "source package filename is missed" [ -n "$1" ] || fatal "source package filename is missed"
print_binpkgfilelist "$DIR" "$1" print_binpkgfilelist "$DIR" "$1"
;; ;;
"compare")
[ "$1" = "version" ] && shift
[ -n "$1" ] || fatal "Arg is missed"
#if [ -n "$PKFLAG" ] ; then
# query_package_field "name" "$@"
#else
compare_version "$1" "$2"
#fi
;;
*) *)
fatal "Unknown command $ epm print $WHAT. Use epm print help for get help." fatal "Unknown command $ epm print $WHAT. Use epm print help for get help."
;; ;;
......
...@@ -82,9 +82,6 @@ __update_to_the_distro() ...@@ -82,9 +82,6 @@ __update_to_the_distro()
__replace_text_in_alt_repo "/^ *#/! s!\[updates\]![p7]!g" __replace_text_in_alt_repo "/^ *#/! s!\[updates\]![p7]!g"
docmd epm update || fatal docmd epm update || fatal
docmd epm upgrade || fatal "Check an error and run epm release-upgrade again" docmd epm upgrade || fatal "Check an error and run epm release-upgrade again"
docmd epm update-kernel
info "Done."
info "Run epm release-upgrade again for update to p8"
;; ;;
p8) p8)
docmd epm update || fatal docmd epm update || fatal
...@@ -100,16 +97,11 @@ __update_to_the_distro() ...@@ -100,16 +97,11 @@ __update_to_the_distro()
docmd epm install systemd || fatal docmd epm install systemd || fatal
fi fi
docmd epm upgrade || fatal "Check an error and run epm release-upgrade again" docmd epm upgrade || fatal "Check an error and run epm release-upgrade again"
#info " # epmi branding-simply-linux-release branding-simply-linux-graphics"
docmd epm update-kernel || fatal
info "Done."
;; ;;
Sisyphus) Sisyphus)
docmd epm update || fatal docmd epm update || fatal
docmd epm install apt rpm apt-conf-sisyphus altlinux-release-sisyphus || fatal "Check an error and run again" docmd epm install apt rpm apt-conf-sisyphus altlinux-release-sisyphus || fatal "Check an error and run again"
docmd epm upgrade || fatal "Check an error and run epm release-upgrade again" docmd epm upgrade || fatal "Check an error and run epm release-upgrade again"
docmd epm update-kernel || fatal
info "Done."
;; ;;
*) *)
esac esac
...@@ -125,12 +117,17 @@ __update_alt_to_next_distro() ...@@ -125,12 +117,17 @@ __update_alt_to_next_distro()
docmd epm install apt-conf-branch || fatal docmd epm install apt-conf-branch || fatal
__replace_alt_version_in_repo p6/branch/ p7/branch/ __replace_alt_version_in_repo p6/branch/ p7/branch/
__update_to_the_distro p7 __update_to_the_distro p7
docmd epm update-kernel
info "Done."
info "Run epm release-upgrade again for update to p8"
;; ;;
"p7"|"p7 p8") "p7"|"p7 p8")
info "Upgrade $DISTRNAME from p7 to p8 ..." info "Upgrade $DISTRNAME from p7 to p8 ..."
docmd epm install apt-conf-branch altlinux-release-p7 || fatal docmd epm install apt-conf-branch altlinux-release-p7 || fatal
__replace_alt_version_in_repo p7/branch/ p8/branch/ __replace_alt_version_in_repo p7/branch/ p8/branch/
__update_to_the_distro p8 __update_to_the_distro p8
docmd epm update-kernel || fatal
info "Done."
;; ;;
"Sisyphus p8") "Sisyphus p8")
info "Downgrade $DISTRNAME from Sisyphus to p8 ..." info "Downgrade $DISTRNAME from Sisyphus to p8 ..."
...@@ -138,6 +135,8 @@ __update_alt_to_next_distro() ...@@ -138,6 +135,8 @@ __update_alt_to_next_distro()
__replace_alt_version_in_repo Sisyphus/ p8/branch/ __replace_alt_version_in_repo Sisyphus/ p8/branch/
__replace_text_in_alt_repo "/^ *#/! s!\[alt\]![p8]!g" __replace_text_in_alt_repo "/^ *#/! s!\[alt\]![p8]!g"
__update_to_the_distro p8 __update_to_the_distro p8
docmd epm downgrade || fatal
info "Done."
;; ;;
"p8 Sisyphus") "p8 Sisyphus")
info "Upgrade $DISTRNAME from p8 to Sisyphus ..." info "Upgrade $DISTRNAME from p8 to Sisyphus ..."
...@@ -147,6 +146,8 @@ __update_alt_to_next_distro() ...@@ -147,6 +146,8 @@ __update_alt_to_next_distro()
__alt_repofix __alt_repofix
__replace_text_in_alt_repo "/^ *#/! s!\[updates\]![alt]!g" __replace_text_in_alt_repo "/^ *#/! s!\[updates\]![alt]!g"
__update_to_the_distro Sisyphus __update_to_the_distro Sisyphus
docmd epm update-kernel || fatal
info "Done."
;; ;;
*) *)
warning "Have no idea how to update from $DISTRNAME $DISTRVERSION." warning "Have no idea how to update from $DISTRNAME $DISTRVERSION."
......
...@@ -36,7 +36,7 @@ __fix_apt_sources_list() ...@@ -36,7 +36,7 @@ __fix_apt_sources_list()
regexp_subst "/ALTLinux\/$br\/branch/s/^rpm *([fhr])/rpm [$br] \1/" $i regexp_subst "/ALTLinux\/$br\/branch/s/^rpm *([fhr])/rpm [$br] \1/" $i
regexp_subst "/Etersoft\/$br\/branch/s/^rpm *([fhr])/rpm [etersoft] \1/" $i regexp_subst "/Etersoft\/$br\/branch/s/^rpm *([fhr])/rpm [etersoft] \1/" $i
done done
regexp_subst "/ALTLinux\/Sisyphus/s/^rpm *([fhr])/rpm [alt] \1/" $i regexp_subst "/ALTLinux\/Sisyphus\//s/^rpm *([fhr])/rpm [alt] \1/" $i
done done
} }
......
# This spec is backported to ALTLinux p7 automatically by rpmbph script from etersoft-build-utils. # This spec is backported to ALTLinux p7 automatically by rpmbph script from etersoft-build-utils.
# #
Name: eepm Name: eepm
Version: 1.7.4 Version: 1.7.5
Release: alt0.M70P.1 Release: alt0.M70P.1
Summary: Etersoft EPM package manager Summary: Etersoft EPM package manager
...@@ -67,9 +67,16 @@ chmod a+x %buildroot%_datadir/%name/{serv-,epm-}* ...@@ -67,9 +67,16 @@ chmod a+x %buildroot%_datadir/%name/{serv-,epm-}*
%_sysconfdir/bash_completion.d/cerv %_sysconfdir/bash_completion.d/cerv
%changelog %changelog
* Sat Apr 23 2016 Vitaly Lipatov <lav@altlinux.ru> 1.7.4-alt0.M70P.1 * Sun Apr 24 2016 Vitaly Lipatov <lav@altlinux.ru> 1.7.5-alt0.M70P.1
- backport to ALTLinux p7 (by rpmbph script) - backport to ALTLinux p7 (by rpmbph script)
* Sun Apr 24 2016 Vitaly Lipatov <lav@altlinux.ru> 1.7.5-alt1
- epm-print: add compare version command
- repofix: fix Sisyphus replace
- release_upgrade: do packages downgrade after changes to p8 from Sisyphus
- epm-assure: rewrite to realize correct version comparing
- kernel_update: run remove-old-kernels too
* Sat Apr 23 2016 Vitaly Lipatov <lav@altlinux.ru> 1.7.4-alt1 * Sat Apr 23 2016 Vitaly Lipatov <lav@altlinux.ru> 1.7.4-alt1
- release-upgrade: small logic improvements - release-upgrade: small logic improvements
......
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