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
Vladislav
eepm
Commits
5923058a
Commit
5923058a
authored
Apr 15, 2016
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Plain Diff
backported to p7 as 1.6.5-alt0.M70P.1 (with rpmbph script)
parents
6d64a7be
c47676e1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
126 additions
and
21 deletions
+126
-21
epm-check_updated_repo
bin/epm-check_updated_repo
+1
-1
epm-release_upgrade
bin/epm-release_upgrade
+2
-1
epm-repofix
bin/epm-repofix
+1
-2
epm-sh-functions
bin/epm-sh-functions
+1
-1
eepm.spec
eepm.spec
+6
-2
epm.sh
packed/epm.sh
+87
-12
serv.sh
packed/serv.sh
+28
-2
No files found.
bin/epm-check_updated_repo
View file @
5923058a
...
...
@@ -36,7 +36,7 @@ __is_repo_info_uptodate()
case
$PMTYPE
in
apt-rpm
)
# apt-deb do not update lock file date
if
$SUDO
[
-r
/var/lib/apt/lists
]
;
then
if
$SUDO
test
-r
/var/lib/apt/lists
;
then
local
LOCKFILE
=
/var/lib/apt/lists/lock
$SUDO
test
-r
$LOCKFILE
||
return
# if repo older than 1 day, return false
...
...
bin/epm-release_upgrade
View file @
5923058a
...
...
@@ -31,7 +31,7 @@ __replace_alt_version_in_repo()
regexp_subst
"/^ *#/! s!
$1
/branch!
$2
/branch!g"
$i
# TODO: start with improve to [p8] - install some package firstly?
regexp_subst
"/^ *#/! s
s
!
\[
$1
\]
![alt]/branch!g"
$i
regexp_subst
"/^ *#/! s!
\[
$1
\]
![alt]/branch!g"
$i
done
docmd apt-repo list
}
...
...
@@ -62,6 +62,7 @@ epm_release_upgrade()
ALTLinux
)
docmd epm update
docmd epm
install
apt rpm
load_helper epm-repofix
pkg_filenames
=
epm_repofix
__update_alt_repo_to_next_distro
||
exit
docmd epm Upgrade
...
...
bin/epm-repofix
View file @
5923058a
...
...
@@ -17,11 +17,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# FIXME
SUBST_ALT_RULE
=
's!^([^#].*)[/ ](ALTLinux|LINUX\@Etersoft)[/ ](Sisyphus|p8[/ ]branch|p7[/ ]branch|p6[/ ]branch)[/ ](x86_64|i586|x86_64-i586|noarch) !\1 \2/\3/\4 !gi'
__fix_apt_sources_list
()
{
local
SUBST_ALT_RULE
=
's!^([^#].*)[/ ](ALTLinux|LINUX\@Etersoft)[/ ](Sisyphus|p8[/ ]branch|p7[/ ]branch|p6[/ ]branch)[/ ](x86_64|i586|x86_64-i586|noarch) !\1 \2/\3/\4 !gi'
local
i
assure_root
for
i
in
"
$@
"
;
do
...
...
bin/epm-sh-functions
View file @
5923058a
...
...
@@ -261,7 +261,7 @@ set_sudo()
[
$EFFUID
=
"0"
]
&&
return
# use sudo if possible
which
sudo
>
/dev/null 2>/dev/null
&&
SUDO
=
"sudo"
&&
return
which
sudo
>
/dev/null 2>/dev/null
&&
SUDO
=
"sudo
--
"
&&
return
SUDO
=
"fatal 'Can't find sudo. Please install sudo or run epm under root.'"
}
...
...
eepm.spec
View file @
5923058a
# This spec is backported to ALTLinux p7 automatically by rpmbph script from etersoft-build-utils.
#
Name: eepm
Version: 1.6.
4
Version: 1.6.
5
Release: alt0.M70P.1
Summary: Etersoft EPM package manager
...
...
@@ -67,9 +67,13 @@ chmod a+x %buildroot%_datadir/%name/{serv-,epm-}*
%_sysconfdir/bash_completion.d/cerv
%changelog
* Fri Apr 15 2016 Vitaly Lipatov <lav@altlinux.ru> 1.6.
4
-alt0.M70P.1
* Fri Apr 15 2016 Vitaly Lipatov <lav@altlinux.ru> 1.6.
5
-alt0.M70P.1
- backport to ALTLinux p7 (by rpmbph script)
* Fri Apr 15 2016 Vitaly Lipatov <lav@altlinux.ru> 1.6.5-alt1
- restrict sudo args
- small fixes
* Fri Apr 15 2016 Vitaly Lipatov <lav@altlinux.ru> 1.6.4-alt1
- epm-repofix: use sed -r instead perl -pi
- pack_in_onefile: fix run positional load_helper
...
...
packed/epm.sh
View file @
5923058a
...
...
@@ -260,7 +260,7 @@ set_sudo()
[
$EFFUID
=
"0"
]
&&
return
# use sudo if possible
which
sudo
>
/dev/null 2>/dev/null
&&
SUDO
=
"sudo"
&&
return
which
sudo
>
/dev/null 2>/dev/null
&&
SUDO
=
"sudo
--
"
&&
return
SUDO
=
"fatal 'Can't find sudo. Please install sudo or run epm under root.'"
}
...
...
@@ -300,6 +300,32 @@ __get_package_for_command()
esac
}
confirm
()
{
local
response
# call with a prompt string or use a default
read
-r
-p
"
${
1
:-
Are
you sure? [y/N]
}
"
response
case
$response
in
[
yY][eE][sS]|[yY]
)
true
;;
*
)
false
;;
esac
}
assure_root
()
{
[
"
$EFFUID
"
=
0
]
||
fatal
"run me only under root"
}
regexp_subst
()
{
local
expression
=
"
$1
"
shift
sed
-i
-r
-e
"
$expression
"
"
$@
"
}
assure_exists
()
{
load_helper epm-assure
...
...
@@ -968,7 +994,7 @@ epm_checksystem_ALTLinux()
epm_checksystem
()
{
[
-n
"
$SUDO
"
]
||
fatal
"Do not use checksystem under root"
[
$EFFUID
=
"0"
]
&&
fatal
"Do not use checksystem under root"
case
$DISTRNAME
in
ALTLinux
)
...
...
@@ -1009,7 +1035,7 @@ __is_repo_info_uptodate()
case
$PMTYPE
in
apt-rpm
)
# apt-deb do not update lock file date
if
$SUDO
[
-r
/var/lib/apt/lists
]
;
then
if
$SUDO
test
-r
/var/lib/apt/lists
;
then
local
LOCKFILE
=
/var/lib/apt/lists/lock
$SUDO
test
-r
$LOCKFILE
||
return
# if repo older than 1 day, return false
...
...
@@ -2999,20 +3025,67 @@ epm_reinstall()
}
# File bin/epm-release-upgrade:
# File bin/epm-release_upgrade:
__replace_alt_version_in_repo
()
{
local
i
assure_exists apt-repo
echo
"Upgrading
$DISTRNAME
from
$1
to
$2
..."
docmd apt-repo list |
sed
-e
"s|
\(
$1
/branch
\)
|{
\1
}->
$2
/branch<|g"
| egrep
--color
--
"
$1
/branch"
confirm
"Are these correct changes?"
||
fatal
"Exiting"
for
i
in
/etc/apt/sources.list /etc/apt/sources.list.d/
*
.list
;
do
[
-s
"
$i
"
]
||
continue
# TODO: only for uncommended strings
#sed -i -r -e "s!$1/branch!$2/branch!g" $i
regexp_subst
"/^ *#/! s!
$1
/branch!
$2
/branch!g"
$i
# TODO: start with improve to [p8] - install some package firstly?
regexp_subst
"/^ *#/! s s!
\[
$1
\]
![alt]/branch!g"
$i
done
docmd apt-repo list
}
__update_alt_repo_to_next_distro
()
{
case
"
$DISTRVERSION
"
in
p6
)
__replace_alt_version_in_repo p6 p7
info
"Run epm release-upgrade again for update to p8"
;;
p7
)
__replace_alt_version_in_repo p7 p8
;;
*
)
info
"Have no idea how to update from
$DISTRNAME
$DISTRVERSION
"
return
1
esac
}
epm_release_upgrade
()
{
assure_root
info
"Starting upgrade whole system to the next release"
info
"Check also http://wiki.etersoft.ru/Admin/UpdateLinux"
case
$
PMTYP
E
in
apt-rpm
)
case
$
DISTRNAM
E
in
ALTLinux
)
docmd epm update
docmd epm
install
apt rpm
showcmd
"TODO: change repo"
pkg_filenames
=
epm_repofix
__update_alt_repo_to_next_distro
||
exit
docmd epm Upgrade
docmd epm update-kernel
return
;;
*
)
;;
esac
case
$PMTYPE
in
apt-rpm
)
docmd epm update
info
"Have no idea how to upgrade
$DISTRNAME
"
;;
*
-dpkg
)
sudocmd
do
-release-upgrade
-d
...
...
@@ -3058,7 +3131,6 @@ epm_release_upgrade()
;;
esac
sudocmd
$CMD
$pkg_filenames
}
# File bin/epm-remove:
...
...
@@ -3321,15 +3393,18 @@ esac
# File bin/epm-repofix:
SUBST_ALT_RULE
=
's!^([^#].*)[/ ](ALTLinux|LINUX\@Etersoft)[/ ](Sisyphus|p7[/ ]branch|p6[/ ]branch)[/ ](x86_64|i586|x86_64-i586|noarch) !\1 \2/\3/\4 !gi'
SUBST_ALT_RULE
=
's!^([^#].*)[/ ](ALTLinux|LINUX\@Etersoft)[/ ](Sisyphus|p
8[/ ]branch|p
7[/ ]branch|p6[/ ]branch)[/ ](x86_64|i586|x86_64-i586|noarch) !\1 \2/\3/\4 !gi'
__fix_apt_sources_list
()
{
[
-n
"
$SUDO
"
]
&&
fatal
"run only under root"
local
i
assure_root
for
i
in
"
$@
"
;
do
[
-s
"
$i
"
]
||
continue
#perl -i.bak -pe "$SUBST_ALT_RULE" $i
sed
-i
-e
-r
"
$SUBST_ALT_RULE
"
$i
# TODO: only for uncommented strings
#sed -i -r -e "$SUBST_ALT_RULE" $i
regexp_subst
"/^ *#/!
$SUBST_ALT_RULE
"
$i
done
}
...
...
@@ -4619,7 +4694,7 @@ $(get_help HELPOPT)
print_version
()
{
echo
"EPM package manager version 1.6.
3
"
echo
"EPM package manager version 1.6.
4
"
echo
"Running on
$(
$DISTRVENDOR
)
('
$PMTYPE
' package manager uses '
$PKGFORMAT
' package format)"
echo
"Copyright (c) Etersoft 2012-2015"
echo
"This program may be freely redistributed under the terms of the GNU AGPLv3."
...
...
packed/serv.sh
View file @
5923058a
...
...
@@ -258,7 +258,7 @@ set_sudo()
[
$EFFUID
=
"0"
]
&&
return
# use sudo if possible
which
sudo
>
/dev/null 2>/dev/null
&&
SUDO
=
"sudo"
&&
return
which
sudo
>
/dev/null 2>/dev/null
&&
SUDO
=
"sudo
--
"
&&
return
SUDO
=
"fatal 'Can't find sudo. Please install sudo or run epm under root.'"
}
...
...
@@ -298,6 +298,32 @@ __get_package_for_command()
esac
}
confirm
()
{
local
response
# call with a prompt string or use a default
read
-r
-p
"
${
1
:-
Are
you sure? [y/N]
}
"
response
case
$response
in
[
yY][eE][sS]|[yY]
)
true
;;
*
)
false
;;
esac
}
assure_root
()
{
[
"
$EFFUID
"
=
0
]
||
fatal
"run me only under root"
}
regexp_subst
()
{
local
expression
=
"
$1
"
shift
sed
-i
-r
-e
"
$expression
"
"
$@
"
}
assure_exists
()
{
load_helper epm-assure
...
...
@@ -1199,7 +1225,7 @@ $(get_help HELPOPT)
print_version
()
{
echo
"Service manager version 1.6.
3
"
echo
"Service manager version 1.6.
4
"
echo
"Running on
$(
$DISTRVENDOR
)
"
echo
"Copyright (c) Etersoft 2012, 2013, 2016"
echo
"This program may be freely redistributed under the terms of the GNU AGPLv3."
...
...
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