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
#
# Copyright (C) 2013, 2014, 2015 Etersoft
# Copyright (C) 2013, 2014, 2015 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2013-2016 Etersoft
# Copyright (C) 2013-2016 Vitaly Lipatov <lav@etersoft.ru>
#
# 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
......@@ -38,48 +38,77 @@ is_dirpath()
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
# $2 - package name
[ -n "$PACKAGEVERSION" ] || return 0
__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 [ -e "$1" ] ; then
if is_dirpath "$CMD" ; then
if [ -e "$CMD" ] ; then
if [ -n "$verbose" ] ; then
info "File or directory $1 is already exists."
epm qf "$1"
info "File or directory $CMD is already exists."
epm qf "$CMD"
fi
return 0
fi
[ -n "$2" ] || fatal "You need run with package name param when use with absolute path"
docmd epm --auto --skip-installed install "$2"
return
[ -n "$PACKAGE" ] || fatal "You need run with package name param when use with absolute path"
return 0
fi
if __check_command_in_path "$1" >/dev/null ; then
if __check_command_in_path "$CMD" >/dev/null ; then
if [ -n "$verbose" ] ; then
local compath="$(__check_command_in_path "$1")"
info "Command $1 is exists: $compath"
info "Command $CMD is exists: $compath"
epm qf "$compath"
fi
return 0
fi
# TODO: use package name normalization
info "Installing appropriate package for $1 command..."
return 1
}
# 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 PACKAGEVERSION="$3"
[ -n "$PACKAGE" ] || PACKAGE="$1"
local PACKAGEVERSION="$3"
warning "TODO: check for PACKAGEVERSION is missed"
__epm_assure_checking $CMD $PACKAGE $PACKAGEVERSION && return 0
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
#
# Copyright (C) 2013 Etersoft
# Copyright (C) 2013 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2013, 2016 Etersoft
# Copyright (C) 2013, 2016 Vitaly Lipatov <lav@etersoft.ru>
#
# 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
......@@ -28,8 +28,9 @@ epm_kernel_update()
info "No installed kernel packages, skipping update"
return
fi
assure_exists update-kernel
sudocmd update-kernel $pkg_filenames
assure_exists update-kernel update-kernel 0.9.9
sudocmd update-kernel $pkg_filenames || return
sudocmd remove-old-kernels $pkg_filenames
return ;;
esac
......
......@@ -88,6 +88,11 @@ print_srcpkgname()
query_package_field sourcerpm "$@"
}
compare_version()
{
which rpmevrcmp 2>/dev/null >/dev/null || fatal "rpmevrcmp exists in ALT Linux only"
rpmevrcmp "$@"
}
__epm_print()
{
......@@ -124,6 +129,7 @@ cat <<EOF
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
EOF
;;
"name")
......@@ -194,6 +200,15 @@ EOF
[ -n "$1" ] || fatal "source package filename is missed"
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."
;;
......
......@@ -82,9 +82,6 @@ __update_to_the_distro()
__replace_text_in_alt_repo "/^ *#/! s!\[updates\]![p7]!g"
docmd epm update || fatal
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)
docmd epm update || fatal
......@@ -100,16 +97,11 @@ __update_to_the_distro()
docmd epm install systemd || fatal
fi
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)
docmd epm update || fatal
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 update-kernel || fatal
info "Done."
;;
*)
esac
......@@ -125,12 +117,17 @@ __update_alt_to_next_distro()
docmd epm install apt-conf-branch || fatal
__replace_alt_version_in_repo p6/branch/ p7/branch/
__update_to_the_distro p7
docmd epm update-kernel
info "Done."
info "Run epm release-upgrade again for update to p8"
;;
"p7"|"p7 p8")
info "Upgrade $DISTRNAME from p7 to p8 ..."
docmd epm install apt-conf-branch altlinux-release-p7 || fatal
__replace_alt_version_in_repo p7/branch/ p8/branch/
__update_to_the_distro p8
docmd epm update-kernel || fatal
info "Done."
;;
"Sisyphus p8")
info "Downgrade $DISTRNAME from Sisyphus to p8 ..."
......@@ -138,6 +135,8 @@ __update_alt_to_next_distro()
__replace_alt_version_in_repo Sisyphus/ p8/branch/
__replace_text_in_alt_repo "/^ *#/! s!\[alt\]![p8]!g"
__update_to_the_distro p8
docmd epm downgrade || fatal
info "Done."
;;
"p8 Sisyphus")
info "Upgrade $DISTRNAME from p8 to Sisyphus ..."
......@@ -147,6 +146,8 @@ __update_alt_to_next_distro()
__alt_repofix
__replace_text_in_alt_repo "/^ *#/! s!\[updates\]![alt]!g"
__update_to_the_distro Sisyphus
docmd epm update-kernel || fatal
info "Done."
;;
*)
warning "Have no idea how to update from $DISTRNAME $DISTRVERSION."
......
......@@ -36,7 +36,7 @@ __fix_apt_sources_list()
regexp_subst "/ALTLinux\/$br\/branch/s/^rpm *([fhr])/rpm [$br] \1/" $i
regexp_subst "/Etersoft\/$br\/branch/s/^rpm *([fhr])/rpm [etersoft] \1/" $i
done
regexp_subst "/ALTLinux\/Sisyphus/s/^rpm *([fhr])/rpm [alt] \1/" $i
regexp_subst "/ALTLinux\/Sisyphus\//s/^rpm *([fhr])/rpm [alt] \1/" $i
done
}
......
# This spec is backported to ALTLinux p7 automatically by rpmbph script from etersoft-build-utils.
#
Name: eepm
Version: 1.7.4
Version: 1.7.5
Release: alt0.M70P.1
Summary: Etersoft EPM package manager
......@@ -67,9 +67,16 @@ chmod a+x %buildroot%_datadir/%name/{serv-,epm-}*
%_sysconfdir/bash_completion.d/cerv
%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)
* 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
- 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