Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
eepm
Commits
e4d9a8a8
Commit
e4d9a8a8
authored
Apr 24, 2016
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Plain Diff
backported to p7 as 1.7.5-alt0.M70P.1 (with rpmbph script)
parents
050081aa
33d4fbc7
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
90 additions
and
37 deletions
+90
-37
epm-assure
bin/epm-assure
+51
-22
epm-kernel_update
bin/epm-kernel_update
+5
-4
epm-print
bin/epm-print
+15
-0
epm-release_upgrade
bin/epm-release_upgrade
+9
-8
epm-repofix
bin/epm-repofix
+1
-1
eepm.spec
eepm.spec
+9
-2
No files found.
bin/epm-assure
View file @
e4d9a8a8
#!/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
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/epm-kernel_update
View file @
e4d9a8a8
#!/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
...
...
bin/epm-print
View file @
e4d9a8a8
...
...
@@ -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."
;;
...
...
bin/epm-release_upgrade
View file @
e4d9a8a8
...
...
@@ -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
."
...
...
bin/epm-repofix
View file @
e4d9a8a8
...
...
@@ -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
}
...
...
eepm.spec
View file @
e4d9a8a8
# 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
* S
at Apr 23 2016 Vitaly Lipatov <lav@altlinux.ru> 1.7.4
-alt0.M70P.1
* S
un 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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment