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
edc6ef46
Commit
edc6ef46
authored
Aug 24, 2016
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Plain Diff
backported to p8 as 1.9.3-alt0.M80P.1 (with rpmbph script)
parents
7ca79667
5806fcb7
Hide whitespace changes
Inline
Side-by-side
Showing
38 changed files
with
289 additions
and
106 deletions
+289
-106
Makefile
Makefile
+1
-1
README
README
+6
-1
distr_info
bin/distr_info
+10
-3
epm
bin/epm
+12
-7
epm-addrepo
bin/epm-addrepo
+9
-8
epm-autoorphans
bin/epm-autoorphans
+3
-0
epm-autoremove
bin/epm-autoremove
+3
-0
epm-clean
bin/epm-clean
+3
-0
epm-filelist
bin/epm-filelist
+5
-2
epm-info
bin/epm-info
+5
-2
epm-install
bin/epm-install
+38
-14
epm-packages
bin/epm-packages
+41
-20
epm-query
bin/epm-query
+9
-4
epm-query_file
bin/epm-query_file
+6
-2
epm-release_upgrade
bin/epm-release_upgrade
+1
-1
epm-remove
bin/epm-remove
+11
-2
epm-remove_old_kernels
bin/epm-remove_old_kernels
+3
-0
epm-removerepo
bin/epm-removerepo
+9
-8
epm-repofix
bin/epm-repofix
+7
-3
epm-repolist
bin/epm-repolist
+5
-2
epm-requires
bin/epm-requires
+3
-0
epm-search
bin/epm-search
+5
-2
epm-search_file
bin/epm-search_file
+5
-2
epm-sh-functions
bin/epm-sh-functions
+13
-1
epm-update
bin/epm-update
+5
-2
epm-upgrade
bin/epm-upgrade
+3
-0
epm-whatdepends
bin/epm-whatdepends
+3
-0
serv
bin/serv
+4
-0
serv-common
bin/serv-common
+5
-2
serv-disable
bin/serv-disable
+4
-1
serv-enable
bin/serv-enable
+8
-2
serv-reload
bin/serv-reload
+3
-1
serv-restart
bin/serv-restart
+3
-0
serv-start
bin/serv-start
+3
-0
serv-status
bin/serv-status
+9
-0
serv-stop
bin/serv-stop
+3
-0
serv-try_restart
bin/serv-try_restart
+6
-11
eepm.spec
eepm.spec
+17
-2
No files found.
Makefile
View file @
edc6ef46
...
@@ -13,7 +13,7 @@ install:
...
@@ -13,7 +13,7 @@ install:
sed
-e
"s|SHAREDIR=.*|SHAREDIR=
$(instpkgdatadir)
|g"
-e
"s|@VERSION@|
$(version)
|g"
<bin/serv
>
$(DESTDIR)$(bindir)
/serv
sed
-e
"s|SHAREDIR=.*|SHAREDIR=
$(instpkgdatadir)
|g"
-e
"s|@VERSION@|
$(version)
|g"
<bin/serv
>
$(DESTDIR)$(bindir)
/serv
mkdir
-p
$(DESTDIR)$(pkgdatadir)/
mkdir
-p
$(DESTDIR)$(pkgdatadir)/
install
-m
644
`ls
-1
bin/*
|
grep
"
-
"
`
$(DESTDIR)$(pkgdatadir)/
install
-m
644
`ls
-1
bin/*
|
grep
"
[-_]
"
`
$(DESTDIR)$(pkgdatadir)/
mkdir
-p
$(DESTDIR)$(mandir)/man1
mkdir
-p
$(DESTDIR)$(mandir)/man1
cp
-a
`ls
-1
man/*`
$(DESTDIR)$(mandir)/man1/
cp
-a
`ls
-1
man/*`
$(DESTDIR)$(mandir)/man1/
README
View file @
edc6ef46
...
@@ -37,7 +37,12 @@ Note: epm is placed as /usr/bin/epm
...
@@ -37,7 +37,12 @@ Note: epm is placed as /usr/bin/epm
$ rpm -qf /usr/bin/epm
$ rpm -qf /usr/bin/epm
eepm-1.1.0-alt2
eepm-1.1.0-alt2
== How to add new distro support ==
1. Fix detection with distr_info
2. Add distro support in set_pm_type function
3. Realize every command in epm-* files
4. Check epm packages and epm --short packages works correctly
(epm package 'awk' have to print packages with awk substring in their names)
See detailed description in russian at
See detailed description in russian at
http://wiki.etersoft.ru/Epm
http://wiki.etersoft.ru/Epm
...
...
bin/distr_info
View file @
edc6ef46
#!/bin/sh
#!/bin/sh
# Author: Vitaly Lipatov <lav@etersoft.ru>
# Author: Vitaly Lipatov <lav@etersoft.ru>
# 2007, 2009, 2010, 2012 (c) Etersoft
# 2007, 2009, 2010, 2012
, 2016
(c) Etersoft
# 2007 Public domain
# 2007
-2016
Public domain
# Detect the distro and version
# Detect the distro and version
# Welcome to send updates!
# Welcome to send updates!
...
@@ -32,6 +32,7 @@ rpmvendor()
...
@@ -32,6 +32,7 @@ rpmvendor()
[
"
$DISTRIB_ID
"
=
"AstraLinux"
]
&&
echo
"astra"
&&
return
[
"
$DISTRIB_ID
"
=
"AstraLinux"
]
&&
echo
"astra"
&&
return
[
"
$DISTRIB_ID
"
=
"LinuxXP"
]
&&
echo
"lxp"
&&
return
[
"
$DISTRIB_ID
"
=
"LinuxXP"
]
&&
echo
"lxp"
&&
return
[
"
$DISTRIB_ID
"
=
"TinyCoreLinux"
]
&&
echo
"tcl"
&&
return
[
"
$DISTRIB_ID
"
=
"TinyCoreLinux"
]
&&
echo
"tcl"
&&
return
[
"
$DISTRIB_ID
"
=
"VoidLinux"
]
&&
echo
"void"
&&
return
echo
"
$DISTRIB_ID
"
|
tr
"[A-Z]"
"[a-z]"
echo
"
$DISTRIB_ID
"
|
tr
"[A-Z]"
"[a-z]"
}
}
...
@@ -55,6 +56,7 @@ pkgtype()
...
@@ -55,6 +56,7 @@ pkgtype()
android
)
echo
"apk"
;;
android
)
echo
"apk"
;;
alpine
)
echo
"apk"
;;
alpine
)
echo
"apk"
;;
tinycorelinux
)
echo
"tcz"
;;
tinycorelinux
)
echo
"tcz"
;;
voidlinux
)
echo
"xbps"
;;
cygwin
)
echo
"tar.xz"
;;
cygwin
)
echo
"tar.xz"
;;
debian|ubuntu|mint|runtu|mcst|astra
)
echo
"deb"
;;
debian|ubuntu|mint|runtu|mcst|astra
)
echo
"deb"
;;
alt|asplinux|suse|mandriva|rosa|mandrake|pclinux|sled|sles
)
alt|asplinux|suse|mandriva|rosa|mandrake|pclinux|sled|sles
)
...
@@ -147,6 +149,11 @@ elif distro os-release && which tce-ab 2>/dev/null >/dev/null ; then
...
@@ -147,6 +149,11 @@ elif distro os-release && which tce-ab 2>/dev/null >/dev/null ; then
DISTRIB_ID
=
"TinyCoreLinux"
DISTRIB_ID
=
"TinyCoreLinux"
DISTRIB_RELEASE
=
"
$VERSION_ID
"
DISTRIB_RELEASE
=
"
$VERSION_ID
"
elif
distro os-release
&&
which xbps-query 2>/dev/null
>
/dev/null
;
then
.
$ROOTDIR
/etc/os-release
DISTRIB_ID
=
"VoidLinux"
DISTRIB_RELEASE
=
"Live"
elif
distro arch-release
;
then
elif
distro arch-release
;
then
DISTRIB_ID
=
"ArchLinux"
DISTRIB_ID
=
"ArchLinux"
DISTRIB_RELEASE
=
"2010"
DISTRIB_RELEASE
=
"2010"
...
@@ -333,7 +340,7 @@ case $1 in
...
@@ -333,7 +340,7 @@ case $1 in
exit
0
exit
0
;;
;;
-V
)
-V
)
echo
"201
20519
"
echo
"201
60822
"
exit
0
exit
0
;;
;;
*
)
*
)
...
...
bin/epm
View file @
edc6ef46
#!/bin/sh
#!/bin/sh
#
#
# Copyright (C) 2012-201
4
Etersoft
# Copyright (C) 2012-201
6
Etersoft
# Copyright (C) 2012-201
4
Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2012-201
6
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
...
@@ -17,10 +17,12 @@
...
@@ -17,10 +17,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#
PROGDIR
=
$(
dirname
$0
)
PROGDIR
=
$(
dirname
"
$0
"
)
PROGNAME
=
$(
basename
"
$0
"
)
[
"
$PROGDIR
"
=
"."
]
&&
PROGDIR
=
$(
pwd
)
[
"
$PROGDIR
"
=
"."
]
&&
PROGDIR
=
$(
pwd
)
if
[
"
$0
"
=
"/dev/stdin"
]
||
[
"
$0
"
=
"sh"
]
;
then
if
[
"
$0
"
=
"/dev/stdin"
]
||
[
"
$0
"
=
"sh"
]
;
then
PROGDIR
=
""
PROGDIR
=
""
PROGNAME
=
""
fi
fi
# will replaced to /usr/share/eepm during install
# will replaced to /usr/share/eepm during install
...
@@ -89,9 +91,7 @@ pkg_names=
...
@@ -89,9 +91,7 @@ pkg_names=
pkg_urls
=
pkg_urls
=
quoted_args
=
quoted_args
=
progname
=
"
${
0
##*/
}
"
case
$PROGNAME
in
case
$progname
in
epmi
)
epmi
)
epm_cmd
=
install
epm_cmd
=
install
;;
;;
...
@@ -136,12 +136,17 @@ case $progname in
...
@@ -136,12 +136,17 @@ case $progname in
;;
;;
epm|upm|eepm
)
epm|upm|eepm
)
;;
;;
epm.sh
)
;;
*
)
*
)
# epm by default
# epm by default
# fatal "Unknown command: $progname"
# fatal "Unknown command: $progname"
;;
;;
esac
esac
# was called with alias name
[
-n
"
$epm_cmd
"
]
&&
PROGNAME
=
"epm"
check_command
()
check_command
()
{
{
# do not override command
# do not override command
...
@@ -397,7 +402,7 @@ pkg_filenames=$(strip_spaces "$pkg_files $pkg_names")
...
@@ -397,7 +402,7 @@ pkg_filenames=$(strip_spaces "$pkg_files $pkg_names")
if
[
-z
"
$epm_cmd
"
]
;
then
if
[
-z
"
$epm_cmd
"
]
;
then
print_version
print_version
echo
echo
fatal
"Run
$ $
progname
--help for get help"
fatal
"Run
$ $
PROGNAME
--help for get help"
fi
fi
# Use eatmydata for write specific operations
# Use eatmydata for write specific operations
...
...
bin/epm-addrepo
View file @
edc6ef46
#!/bin/sh
#!/bin/sh
#
#
# Copyright (C) 2012 Etersoft
# Copyright (C) 2012
, 2016
Etersoft
# Copyright (C) 2012 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2012
, 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
...
@@ -19,26 +19,27 @@
...
@@ -19,26 +19,27 @@
epm_addrepo
()
epm_addrepo
()
{
{
local
repo
=
"
$(
eval echo
$quoted_args
)
"
case
$PMTYPE
in
case
$PMTYPE
in
apt-rpm
)
apt-rpm
)
assure_exists apt-repo
assure_exists apt-repo
sudocmd apt-repo add
"
$
pkg_filenames
"
sudocmd apt-repo add
"
$
repo
"
;;
;;
apt-dpkg|aptitude-dpkg
)
apt-dpkg|aptitude-dpkg
)
info
"You need manually add repo to /etc/apt/sources.list"
info
"You need manually add repo to /etc/apt/sources.list"
;;
;;
yum-rpm
)
yum-rpm
)
assure_exists yum-utils
assure_exists yum-utils
sudocmd yum-config-manager
--add-repo
"
$
pkg_filenames
"
sudocmd yum-config-manager
--add-repo
"
$
repo
"
;;
;;
urpm-rpm
)
urpm-rpm
)
sudocmd urpmi.addmedia
"
$
pkg_filenames
"
sudocmd urpmi.addmedia
"
$
repo
"
;;
;;
zypper-rpm
)
zypper-rpm
)
sudocmd zypper ar
"
$
pkg_filenames
"
sudocmd zypper ar
"
$
repo
"
;;
;;
emerge
)
emerge
)
sudocmd layman
-a
$"pkg_filenames
"
sudocmd layman
-a
"
$repo
"
;;
;;
pacman
)
pacman
)
info
"You need manually add repo to /etc/pacman.conf"
info
"You need manually add repo to /etc/pacman.conf"
...
@@ -46,7 +47,7 @@ case $PMTYPE in
...
@@ -46,7 +47,7 @@ case $PMTYPE in
#sudocmd repo-add $pkg_filenames
#sudocmd repo-add $pkg_filenames
;;
;;
npackd
)
npackd
)
sudocmd npackdcl add-repo
--url
=
"
$
pkg_filenames
"
sudocmd npackdcl add-repo
--url
=
"
$
repo
"
;;
;;
slackpkg
)
slackpkg
)
info
"You need manually add repo to /etc/slackpkg/mirrors"
info
"You need manually add repo to /etc/slackpkg/mirrors"
...
...
bin/epm-autoorphans
View file @
edc6ef46
...
@@ -90,6 +90,9 @@ case $PMTYPE in
...
@@ -90,6 +90,9 @@ case $PMTYPE in
local
PKGLIST
=
$(
zypper packages
--orphaned
|
tail
-n
+5 |
cut
-d
\|
-f
3 |
sort
-u
)
local
PKGLIST
=
$(
zypper packages
--orphaned
|
tail
-n
+5 |
cut
-d
\|
-f
3 |
sort
-u
)
sudocmd zypper remove
--clean-deps
$PKGLIST
sudocmd zypper remove
--clean-deps
$PKGLIST
;;
;;
xbps
)
CMD
=
"xbps-remove -o"
;;
*
)
*
)
fatal
"Have no suitable command for
$PMTYPE
"
fatal
"Have no suitable command for
$PMTYPE
"
;;
;;
...
...
bin/epm-autoremove
View file @
edc6ef46
...
@@ -127,6 +127,9 @@ case $PMTYPE in
...
@@ -127,6 +127,9 @@ case $PMTYPE in
local
PKGLIST
=
$(
zypper packages
--unneeded
|
tail
-n
+5 |
cut
-d
\|
-f
3 |
sort
-u
)
local
PKGLIST
=
$(
zypper packages
--unneeded
|
tail
-n
+5 |
cut
-d
\|
-f
3 |
sort
-u
)
sudocmd zypper remove
--clean-deps
$PKGLIST
sudocmd zypper remove
--clean-deps
$PKGLIST
;;
;;
xbps
)
CMD
=
"xbps-remove -O"
;;
*
)
*
)
fatal
"Have no suitable command for
$PMTYPE
"
fatal
"Have no suitable command for
$PMTYPE
"
;;
;;
...
...
bin/epm-clean
View file @
edc6ef46
...
@@ -77,6 +77,9 @@ case $PMTYPE in
...
@@ -77,6 +77,9 @@ case $PMTYPE in
pkgng
)
pkgng
)
sudocmd pkg clean
-a
sudocmd pkg clean
-a
;;
;;
xbps
)
sudocmd xbps-remove
-O
;;
*
)
*
)
fatal
"Have no suitable command for
$PMTYPE
"
fatal
"Have no suitable command for
$PMTYPE
"
;;
;;
...
...
bin/epm-filelist
View file @
edc6ef46
#!/bin/sh
#!/bin/sh
#
#
# Copyright (C) 2012-201
5
Etersoft
# Copyright (C) 2012-201
6
Etersoft
# Copyright (C) 2012-201
5
Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2012-201
6
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
...
@@ -123,6 +123,9 @@ __epm_filelist_name()
...
@@ -123,6 +123,9 @@ __epm_filelist_name()
pkgng
)
pkgng
)
CMD
=
"pkg info -l"
CMD
=
"pkg info -l"
;;
;;
xbps
)
CMD
=
"xbps-query -f"
;;
aptcyg
)
aptcyg
)
docmd apt-cyg listfiles
$@
|
sed
-e
"s|^|/|g"
docmd apt-cyg listfiles
$@
|
sed
-e
"s|^|/|g"
return
return
...
...
bin/epm-info
View file @
edc6ef46
#!/bin/sh
#!/bin/sh
#
#
# Copyright (C) 2012,
2014
Etersoft
# Copyright (C) 2012,
2014, 2016
Etersoft
# Copyright (C) 2012,
2014
Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2012,
2014, 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
...
@@ -103,6 +103,9 @@ case $PMTYPE in
...
@@ -103,6 +103,9 @@ case $PMTYPE in
pkgng
)
pkgng
)
docmd pkg info
$pkg_names
docmd pkg info
$pkg_names
;;
;;
xbps
)
docmd xbps-query
--show
$pkg_names
;;
homebrew
)
homebrew
)
docmd brew info
$pkg_names
docmd brew info
$pkg_names
;;
;;
...
...
bin/epm-install
View file @
edc6ef46
...
@@ -170,6 +170,9 @@ epm_install_names()
...
@@ -170,6 +170,9 @@ epm_install_names()
aptcyg
)
aptcyg
)
sudocmd apt-cyg
install
$@
sudocmd apt-cyg
install
$@
return
;;
return
;;
xbps
)
sudocmd xbps-install
$@
return
;;
*
)
*
)
fatal
"Have no suitable install command for
$PMTYPE
"
fatal
"Have no suitable install command for
$PMTYPE
"
;;
;;
...
@@ -235,6 +238,9 @@ epm_ni_install_names()
...
@@ -235,6 +238,9 @@ epm_ni_install_names()
tce
)
tce
)
sudocmd tce-load
-wi
$@
sudocmd tce-load
-wi
$@
return
;;
return
;;
xbps
)
sudocmd xbps-install
-y
$@
return
;;
#android)
#android)
# sudocmd pm install $@
# sudocmd pm install $@
# return ;;
# return ;;
...
@@ -271,8 +277,11 @@ __epm_check_if_try_install_deb()
...
@@ -271,8 +277,11 @@ __epm_check_if_try_install_deb()
local
TDIR
=
$(
mktemp
-d
)
local
TDIR
=
$(
mktemp
-d
)
cd
$TDIR
cd
$TDIR
for
pkg
in
$debpkgs
;
do
for
pkg
in
$debpkgs
;
do
showcmd alien
-r
-k
--scripts
"
$pkg
"
# TODO: fakeroot for non ALT?
# TODO: need check for return status
showcmd_store_output alien
-r
-k
--scripts
"
$pkg
"
||
fatal
local
RPMCONVERTED
=
$(
grep
"rpm generated"
$RC_STDOUT
|
sed
-e
"s| generated||g"
)
clean_store_output
epm
install
$RPMCONVERTED
done
done
rm
-f
$TDIR
/
*
rm
-f
$TDIR
/
*
rmdir
$TDIR
/
rmdir
$TDIR
/
...
@@ -293,12 +302,16 @@ __epm_check_if_try_install_rpm()
...
@@ -293,12 +302,16 @@ __epm_check_if_try_install_rpm()
[
-n
"
$rpmpkgs
"
]
||
return
1
[
-n
"
$rpmpkgs
"
]
||
return
1
assure_exists alien
assure_exists alien
assure_exists fakeroot
local
TDIR
=
$(
mktemp
-d
)
local
TDIR
=
$(
mktemp
-d
)
cd
$TDIR
cd
$TDIR
for
pkg
in
$rpmpkgs
;
do
for
pkg
in
$rpmpkgs
;
do
showcmd alien
-d
-k
--scripts
"
$pkg
"
showcmd_store_output fakeroot alien
-d
-k
--scripts
"
$pkg
"
# TODO: need check for return status
clean_store_output
local
DEBCONVERTED
=
$(
grep
"deb generated"
$RC_STDOUT
|
sed
-e
"s| generated||g"
)
clean_store_output
epm
install
$DEBCONVERTED
done
done
rm
-f
$TDIR
/
*
rm
-f
$TDIR
/
*
rmdir
$TDIR
/
rmdir
$TDIR
/
...
@@ -323,7 +336,7 @@ epm_install_files()
...
@@ -323,7 +336,7 @@ epm_install_files()
if
!
is_dirpath
"
$@
"
||
[
"
$(
get_package_type
"
$@
"
)
"
=
"rpm"
]
;
then
if
!
is_dirpath
"
$@
"
||
[
"
$(
get_package_type
"
$@
"
)
"
=
"rpm"
]
;
then
sudocmd rpm
-Uvh
$force
$nodeps
$@
&&
return
sudocmd rpm
-Uvh
$force
$nodeps
$@
&&
return
local
RES
=
$?
local
RES
=
$?
# TODO: check rpm result code and convert it to compatible format if possible
__epm_check_if_rpm_already_installed
$@
&&
return
__epm_check_if_rpm_already_installed
$@
&&
return
# if run with --nodeps, do not fallback on hi level
# if run with --nodeps, do not fallback on hi level
...
@@ -475,6 +488,10 @@ epm_print_install_command()
...
@@ -475,6 +488,10 @@ epm_print_install_command()
tce
)
tce
)
echo
"tce-load -wi
$@
"
echo
"tce-load -wi
$@
"
;;
;;
xbps
)
echo
"xbps-install -y
$@
"
;;
*
)
*
)
fatal
"Have no suitable appropriate install command for
$PMTYPE
"
fatal
"Have no suitable appropriate install command for
$PMTYPE
"
;;
;;
...
@@ -497,14 +514,8 @@ download_pkg_urls()
...
@@ -497,14 +514,8 @@ download_pkg_urls()
done
done
}
}
__use_url_install
()
__handle_pkg_urls
()
{
{
[
-n
"
$pkg_urls
"
]
||
return
# TODO: do it correcly
to_remove_pkg_files
=
case
$PMTYPE
in
case
$PMTYPE
in
apt-rpm
)
apt-rpm
)
# ALT Linux really?
# ALT Linux really?
...
@@ -526,10 +537,23 @@ __handle_pkg_urls()
...
@@ -526,10 +537,23 @@ __handle_pkg_urls()
# pkg_names="$pkg_names $pkg_urls"
# pkg_names="$pkg_names $pkg_urls"
# ;;
# ;;
*
)
*
)
# use workaround with eget: download and put in pkg_files
return
1
download_pkg_urls
;;
;;
esac
esac
return
0
}
__handle_pkg_urls
()
{
[
-n
"
$pkg_urls
"
]
||
return
# TODO: do it correctly
to_remove_pkg_files
=
if
[
"
$(
get_package_type
"
$pkg
"
)
"
!=
$PKGFORMAT
]
||
!
__use_url_install
;
then
# use workaround with eget: download and put in pkg_files
download_pkg_urls
fi
pkg_urls
=
pkg_urls
=
}
}
...
...
bin/epm-packages
View file @
edc6ef46
#!/bin/sh
#!/bin/sh
#
#
# Copyright (C) 2012 Etersoft
# Copyright (C) 2012
, 2016
Etersoft
# Copyright (C) 2012 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2012
, 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
...
@@ -41,6 +41,11 @@ __aptcyg_print_full()
...
@@ -41,6 +41,11 @@ __aptcyg_print_full()
echo
"
$1
-
$VERSION
"
echo
"
$1
-
$VERSION
"
}
}
__fo_pfn
()
{
grep
-v
"^$"
|
grep
--
"
$pkg_filenames
"
}
# TODO: we have a problem with error status here
# TODO: we have a problem with error status here
epm_packages
()
epm_packages
()
{
{
...
@@ -49,23 +54,28 @@ epm_packages()
...
@@ -49,23 +54,28 @@ epm_packages()
case
$PMTYPE
in
case
$PMTYPE
in
apt-rpm
)
apt-rpm
)
# FIXME: strong equal
CMD
=
"rpm -qa
$pkg_filenames
"
CMD
=
"rpm -qa
$pkg_filenames
"
[
-n
"
$short
"
]
&&
CMD
=
"rpm -qa --queryformat %{name}
\n
$pkg_filenames
"
[
-n
"
$short
"
]
&&
CMD
=
"rpm -qa --queryformat %{name}
\n
$pkg_filenames
"
;;
docmd
$CMD
return
;;
*
-dpkg
)
*
-dpkg
)
# FIXME: strong equal
#CMD="dpkg -l $pkg_filenames"
#CMD="dpkg -l $pkg_filenames"
CMD
=
"dpkg-query -W --showformat=
\$
{db:Status-Abbrev}
\$
{Package}-
\$
{Version}
\n
$pkg_filenames
"
CMD
=
"dpkg-query -W --showformat=
\$
{db:Status-Abbrev}
\$
{Package}-
\$
{Version}
\n
$pkg_filenames
"
[
-n
"
$short
"
]
&&
CMD
=
"dpkg-query -W --showformat=
\$
{db:Status-Abbrev}
\$
{Package}
\n
$pkg_filenames
"
[
-n
"
$short
"
]
&&
CMD
=
"dpkg-query -W --showformat=
\$
{db:Status-Abbrev}
\$
{Package}
\n
$pkg_filenames
"
docmd
$CMD
|
grep
"^i"
|
sed
-e
"s|.* ||g"
showcmd
$CMD
retur
n
$CMD
|
grep
"^i"
|
sed
-e
"s|.* ||g"
| __fo_pf
n
;;
return
;;
snappy
)
snappy
)
CMD
=
"snappy info"
CMD
=
"snappy info"
;;
;;
yum-rpm|urpm-rpm|zypper-rpm|dnf-rpm
)
yum-rpm|urpm-rpm|zypper-rpm|dnf-rpm
)
# FIXME: strong equal
CMD
=
"rpm -qa
$pkg_filenames
"
CMD
=
"rpm -qa
$pkg_filenames
"
[
-n
"
$short
"
]
&&
CMD
=
"rpm -qa --queryformat %{name}
\n
$pkg_filenames
"
[
-n
"
$short
"
]
&&
CMD
=
"rpm -qa --queryformat %{name}
\n
$pkg_filenames
"
;;
docmd
$CMD
return
;;
emerge
)
emerge
)
CMD
=
"qlist -I -C"
CMD
=
"qlist -I -C"
# print with colors for console output
# print with colors for console output
...
@@ -73,26 +83,27 @@ case $PMTYPE in
...
@@ -73,26 +83,27 @@ case $PMTYPE in
;;
;;
pkgsrc
)
pkgsrc
)
CMD
=
"pkg_info"
CMD
=
"pkg_info"
docmd
$CMD
|
sed
-e
"s| .*||g"
showcmd
$CMD
retur
n
$CMD
|
sed
-e
"s| .*||g"
| __fo_pf
n
;;
return
;;
pkgng
)
pkgng
)
if
[
-n
"
$pkg_filenames
"
]
;
then
if
[
-n
"
$pkg_filenames
"
]
;
then
CMD
=
"pkg info -E
$pkg_filenames
"
CMD
=
"pkg info -E
$pkg_filenames
"
else
else
CMD
=
"pkg info"
CMD
=
"pkg info"
fi
fi
showcmd
$CMD
if
[
-n
"
$short
"
]
;
then
if
[
-n
"
$short
"
]
;
then
docmd
$CMD
|
sed
-e
"s| .*||g"
|
sed
-e
"s|-[0-9].*||g"
$CMD
|
sed
-e
"s| .*||g"
|
sed
-e
"s|-[0-9].*||g"
| __fo_pfn
else
else
docmd
$CMD
|
sed
-e
"s| .*||g"
$CMD
|
sed
-e
"s| .*||g"
| __fo_pfn
fi
fi
return
return
;;
;;
pacman
)
pacman
)
CMD
=
"pacman -Qs
$pkg_filenames
"
CMD
=
"pacman -Qs
$pkg_filenames
"
showcmd
$CMD
if
[
-n
"
$short
"
]
;
then
if
[
-n
"
$short
"
]
;
then
docmd
$CMD
|
sed
-e
"s| .*||g"
-e
"s|.*/||g"
|
grep
-v
"^$"
$CMD
|
sed
-e
"s| .*||g"
-e
"s|.*/||g"
| __fo_pfn
return
return
fi
fi
;;
;;
...
@@ -112,7 +123,7 @@ case $PMTYPE in
...
@@ -112,7 +123,7 @@ case $PMTYPE in
# FIXME: does not work for libjpeg-v8a
# FIXME: does not work for libjpeg-v8a
# TODO: remove last 3 elements (if arch is second from the last?)
# TODO: remove last 3 elements (if arch is second from the last?)
# FIXME this hack
# FIXME this hack
docmd
ls
-1
/var/log/packages/ |
sed
-e
"s|-[0-9].*||g"
|
sed
-e
"s|libjpeg-v8a.*|libjpeg|g"
docmd
ls
-1
/var/log/packages/ |
sed
-e
"s|-[0-9].*||g"
|
sed
-e
"s|libjpeg-v8a.*|libjpeg|g"
| __fo_pfn
return
return
fi
fi
;;
;;
...
@@ -131,9 +142,20 @@ case $PMTYPE in
...
@@ -131,9 +142,20 @@ case $PMTYPE in
guix
)
guix
)
CMD
=
"guix package -I"
CMD
=
"guix package -I"
;;
;;
xbps
)
CMD
=
"xbps-query -l"
showcmd
$CMD
if
[
-n
"
$short
"
]
;
then
$CMD
|
sed
-e
"s|^ii ||g"
-e
"s| .*||g"
-e
"s|
\(
.*
\)
-.*|
\1
|g"
| __fo_pfn
else
$CMD
|
sed
-e
"s|^ii ||g"
-e
"s| .*||g"
| __fo_pfn
fi
return
0
;;
android
)
android
)
CMD
=
"pm list packages"
CMD
=
"pm list packages"
docmd
$CMD
|
sed
-e
"s|^package:||g"
showcmd
$CMD
$CMD
|
sed
-e
"s|^package:||g"
| __fo_pfn
return
return
;;
;;
aptcyg
)
aptcyg
)
...
@@ -152,8 +174,7 @@ case $PMTYPE in
...
@@ -152,8 +174,7 @@ case $PMTYPE in
;;
;;
esac
esac
docmd
$CMD
docmd
$CMD
| __fopfn
# FIXME: do not print empty lines, but we will lost error status definitely
# FIXME: we print empty lines, but will lost error status
# | grep -v "^$"
}
}
bin/epm-query
View file @
edc6ef46
...
@@ -33,16 +33,18 @@ _get_grep_exp()
...
@@ -33,16 +33,18 @@ _get_grep_exp()
# TODO: combine with -qa (the difference only in return status now)
# TODO: combine with -qa (the difference only in return status now)
_shortquery_via_packages_list
()
_shortquery_via_packages_list
()
{
{
local
res
=
0
local
res
=
1
local
grepexp
local
grepexp
local
firstpkg
=
$1
local
firstpkg
=
$1
shift
shift
grepexp
=
$(
_get_grep_exp
$firstpkg
)
grepexp
=
$(
_get_grep_exp
$firstpkg
)
# TODO: we miss status due grep
# Note: double call due stderr redirect
# Note: we use short=1 here due grep by ^name$
# Note: we use short=1 here due grep by ^name$
# separate first line for print out command
# separate first line for print out command
short
=
1
pkg_filenames
=
$firstpkg
epm_packages |
grep
--
"
$grepexp
"
||
res
=
1
short
=
1
pkg_filenames
=
$firstpkg
epm_packages |
grep
--
"
$grepexp
"
&&
res
=
0
||
res
=
1
local
pkg
local
pkg
for
pkg
in
"
$@
"
;
do
for
pkg
in
"
$@
"
;
do
...
@@ -57,16 +59,19 @@ _shortquery_via_packages_list()
...
@@ -57,16 +59,19 @@ _shortquery_via_packages_list()
# TODO: non optimal double epm packages call
# TODO: non optimal double epm packages call
_query_via_packages_list
()
_query_via_packages_list
()
{
{
local
res
=
0
local
res
=
1
local
grepexp
local
grepexp
local
firstpkg
=
$1
local
firstpkg
=
$1
shift
shift
grepexp
=
$(
_get_grep_exp
$firstpkg
)
grepexp
=
$(
_get_grep_exp
$firstpkg
)
# TODO: we miss status due grep
# TODO: grep correctly
# Note: double call due stderr redirect
# Note: we use short=1 here due grep by ^name$
# Note: we use short=1 here due grep by ^name$
# separate first line for print out command
# separate first line for print out command
short
=
1
pkg_filenames
=
$firstpkg
epm_packages |
grep
-q
--
"
$grepexp
"
&&
quiet
=
1
pkg_filenames
=
$firstpkg
epm_packages
||
res
=
1
short
=
1
pkg_filenames
=
$firstpkg
epm_packages |
grep
-q
--
"
$grepexp
"
&&
quiet
=
1
pkg_filenames
=
$firstpkg
epm_packages
&&
res
=
0
||
res
=
1
local
pkg
local
pkg
for
pkg
in
"
$@
"
;
do
for
pkg
in
"
$@
"
;
do
...
...
bin/epm-query_file
View file @
edc6ef46
#!/bin/sh
#!/bin/sh
#
#
# Copyright (C) 2009, 2012 Etersoft
# Copyright (C) 2009, 2012
, 2016
Etersoft
# Copyright (C) 2009, 2012 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2009, 2012
, 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
...
@@ -98,6 +98,10 @@ __do_query()
...
@@ -98,6 +98,10 @@ __do_query()
ipkg
)
ipkg
)
CMD
=
"ipkg files"
CMD
=
"ipkg files"
;;
;;
xbps
)
# FIXME: maybe it is search file?
CMD
=
"xbps-query -o"
;;
aptcyg
)
aptcyg
)
#CMD="apt-cyg packageof"
#CMD="apt-cyg packageof"
# do not realized locally
# do not realized locally
...
...
bin/epm-release_upgrade
View file @
edc6ef46
...
@@ -65,7 +65,7 @@ __replace_alt_version_in_repo()
...
@@ -65,7 +65,7 @@ __replace_alt_version_in_repo()
#echo "Upgrading $DISTRNAME from $1 to $2 ..."
#echo "Upgrading $DISTRNAME from $1 to $2 ..."
docmd apt-repo list |
sed
-e
"s|
\(
$1
\)
|{
\1
}->{
$2
}|g"
| egrep
--color
--
"
$1
"
docmd apt-repo list |
sed
-e
"s|
\(
$1
\)
|{
\1
}->{
$2
}|g"
| egrep
--color
--
"
$1
"
# ask and replace only we will have changes
# ask and replace only we will have changes
if
apt-repo list | egrep
-q
--
"
$1
"
;
then
if
a
=
a
pt-repo list | egrep
-q
--
"
$1
"
;
then
confirm
"Are these correct changes? [y/N]"
||
fatal
"Exiting"
confirm
"Are these correct changes? [y/N]"
||
fatal
"Exiting"
__replace_text_in_alt_repo
"/^ *#/! s!
$1
!
$2
!g"
__replace_text_in_alt_repo
"/^ *#/! s!
$1
!
$2
!g"
fi
fi
...
...
bin/epm-remove
View file @
edc6ef46
#!/bin/sh
#!/bin/sh
#
#
# Copyright (C) 2012-2014 Etersoft
# Copyright (C) 2012-2014
, 2016
Etersoft
# Copyright (C) 2012-2014 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2012-2014
, 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
...
@@ -128,6 +128,9 @@ epm_remove_names()
...
@@ -128,6 +128,9 @@ epm_remove_names()
aptcyg
)
aptcyg
)
sudocmd apt-cyg remove
$@
sudocmd apt-cyg remove
$@
return
;;
return
;;
xbps
)
sudocmd xbps remove
-R
$@
return
;;
ipkg
)
ipkg
)
sudocmd ipkg
$(
subst_option force
-force-depends
)
remove
$@
sudocmd ipkg
$(
subst_option force
-force-depends
)
remove
$@
return
;;
return
;;
...
@@ -171,6 +174,9 @@ epm_remove_nonint()
...
@@ -171,6 +174,9 @@ epm_remove_nonint()
ipkg
)
ipkg
)
sudocmd ipkg
-force-defaults
remove
$@
sudocmd ipkg
-force-defaults
remove
$@
return
;;
return
;;
xbps
)
sudocmd xbps remove
-y
$@
return
;;
esac
esac
return
5
return
5
}
}
...
@@ -205,6 +211,9 @@ epm_print_remove_command()
...
@@ -205,6 +211,9 @@ epm_print_remove_command()
aptcyg
)
aptcyg
)
echo
"apt-cyg remove
$@
"
echo
"apt-cyg remove
$@
"
;;
;;
xbps
)
echo
"xbps remove -y
$@
"
;;
*
)
*
)
fatal
"Have no suitable appropriate remove command for
$PMTYPE
"
fatal
"Have no suitable appropriate remove command for
$PMTYPE
"
;;
;;
...
...
bin/epm-remove_old_kernels
View file @
edc6ef46
...
@@ -52,6 +52,9 @@ epm_remove_old_kernels()
...
@@ -52,6 +52,9 @@ epm_remove_old_kernels()
Gentoo
)
Gentoo
)
sudocmd emerge
-P
gentoo-sources
sudocmd emerge
-P
gentoo-sources
return
;;
return
;;
VoidLinux
)
sudocmd vkpurge
rm
all
return
;;
esac
esac
case
$PMTYPE
in
case
$PMTYPE
in
...
...
bin/epm-removerepo
View file @
edc6ef46
#!/bin/sh
#!/bin/sh
#
#
# Copyright (C) 2012 Etersoft
# Copyright (C) 2012
, 2016
Etersoft
# Copyright (C) 2012 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2012
, 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
...
@@ -19,32 +19,33 @@
...
@@ -19,32 +19,33 @@
epm_removerepo
()
epm_removerepo
()
{
{
local
repo
=
"
$(
eval echo
$quoted_args
)
"
case
$PMTYPE
in
case
$PMTYPE
in
apt-rpm
)
apt-rpm
)
assure_exists apt-repo
assure_exists apt-repo
sudocmd apt-repo
rm
"
$
quoted_args
"
sudocmd apt-repo
rm
"
$
repo
"
;;
;;
apt-dpkg|aptitude-dpkg
)
apt-dpkg|aptitude-dpkg
)
info
"You need remove repo from /etc/apt/sources.list"
info
"You need remove repo from /etc/apt/sources.list"
;;
;;
yum-rpm
)
yum-rpm
)
assure_exists yum-utils
assure_exists yum-utils
sudocmd yum-config-manager
--disable
"
$
pkg_filenames
"
sudocmd yum-config-manager
--disable
"
$
repo
"
;;
;;
urpm-rpm
)
urpm-rpm
)
sudocmd urpmi.removemedia
"
$
pkg_filenames
"
sudocmd urpmi.removemedia
"
$
repo
"
;;
;;
zypper-rpm
)
zypper-rpm
)
sudocmd zypper removerepo
"
$
pkg_filenames
"
sudocmd zypper removerepo
"
$
repo
"
;;
;;
emerge
)
emerge
)
sudocmd layman
"-d
$
pkg_filenames
"
sudocmd layman
"-d
$
repo
"
;;
;;
pacman
)
pacman
)
info
"You need remove repo from /etc/pacman.conf"
info
"You need remove repo from /etc/pacman.conf"
;;
;;
npackd
)
npackd
)
sudocmd npackdcl remove-repo
--url
=
"
$
pkg_filenames
"
sudocmd npackdcl remove-repo
--url
=
"
$
repo
"
;;
;;
slackpkg
)
slackpkg
)
info
"You need remove repo from /etc/slackpkg/mirrors"
info
"You need remove repo from /etc/slackpkg/mirrors"
...
...
bin/epm-repofix
View file @
edc6ef46
...
@@ -84,14 +84,18 @@ case $PMTYPE in
...
@@ -84,14 +84,18 @@ case $PMTYPE in
__fix_apt_sources_list /etc/apt/sources.list
__fix_apt_sources_list /etc/apt/sources.list
__fix_apt_sources_list /etc/apt/sources.list.d/
*
.list
__fix_apt_sources_list /etc/apt/sources.list.d/
*
.list
docmd apt-repo list
docmd apt-repo list
# FIXME: what the best place?
# rebuild rpm database
# rebuild rpm database
#sudocmd rm -fv /var/lib/rpm/__db*
#sudocmd rm -fv /var/lib/rpm/__db*
#sudocmd rpm --rebuilddb
#sudocmd rpm --rebuilddb
;;
;;
yum-rpm|dnf-rpm
)
yum-rpm|dnf-rpm
)
sudocmd
rm
-fv
/var/lib/rpm/__db
*
# FIXME: what the best place?
sudocmd rpm
--rebuilddb
#sudocmd rm -fv /var/lib/rpm/__db*
#sudocmd rpm --rebuilddb
;;
xbps
)
sudocmd xbps-pkgdb
-a
;;
;;
*
)
*
)
fatal
"Have no suitable command for
$PMTYPE
"
fatal
"Have no suitable command for
$PMTYPE
"
...
...
bin/epm-repolist
View file @
edc6ef46
#!/bin/sh
#!/bin/sh
#
#
# Copyright (C) 2012 Etersoft
# Copyright (C) 2012
, 2016
Etersoft
# Copyright (C) 2012 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2012
, 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
...
@@ -58,6 +58,9 @@ case $PMTYPE in
...
@@ -58,6 +58,9 @@ case $PMTYPE in
docmd eselect profile list
docmd eselect profile list
docmd layman
-L
docmd layman
-L
;;
;;
xbps
)
docmd xbps-query
-L
;;
pacman
)
pacman
)
docmd
grep
-v
--
"^#
\|
^$"
/etc/pacman.conf
docmd
grep
-v
--
"^#
\|
^$"
/etc/pacman.conf
;;
;;
...
...
bin/epm-requires
View file @
edc6ef46
...
@@ -105,6 +105,9 @@ case $PMTYPE in
...
@@ -105,6 +105,9 @@ case $PMTYPE in
#CMD="pkg rquery '%dn-%dv'"
#CMD="pkg rquery '%dn-%dv'"
CMD
=
"pkg info -d"
CMD
=
"pkg info -d"
;;
;;
xbps
)
CMD
=
"xbps-query -x"
;;
aptcyg
)
aptcyg
)
#CMD="apt-cyg depends"
#CMD="apt-cyg depends"
# print show version
# print show version
...
...
bin/epm-search
View file @
edc6ef46
#!/bin/sh
#!/bin/sh
#
#
# Copyright (C) 2012,
2013
Etersoft
# Copyright (C) 2012,
2013, 2016
Etersoft
# Copyright (C) 2012,
2013
Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2012,
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
...
@@ -97,6 +97,9 @@ case $PMTYPE in
...
@@ -97,6 +97,9 @@ case $PMTYPE in
aptcyg
)
aptcyg
)
CMD
=
"apt-cyg searchall"
CMD
=
"apt-cyg searchall"
;;
;;
xbps
)
CMD
=
"xbps-query -s"
;;
*
)
*
)
fatal
"Have no suitable search command for
$PMTYPE
"
fatal
"Have no suitable search command for
$PMTYPE
"
;;
;;
...
...
bin/epm-search_file
View file @
edc6ef46
#!/bin/sh
#!/bin/sh
#
#
# Copyright (C) 2012 Etersoft
# Copyright (C) 2012
, 2016
Etersoft
# Copyright (C) 2012 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2012
, 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
...
@@ -73,6 +73,9 @@ case $PMTYPE in
...
@@ -73,6 +73,9 @@ case $PMTYPE in
ipkg
)
ipkg
)
CMD
=
"ipkg search"
CMD
=
"ipkg search"
;;
;;
xbps
)
CMD
=
"xbps-query -Ro"
;;
aptcyg
)
aptcyg
)
docmd apt-cyg searchall
$(
echo
"
$pkg_filenames
"
|
sed
-e
"s| /| |g"
)
docmd apt-cyg searchall
$(
echo
"
$pkg_filenames
"
|
sed
-e
"s| /| |g"
)
return
return
...
...
bin/epm-sh-functions
View file @
edc6ef46
...
@@ -200,6 +200,12 @@ store_output()
...
@@ -200,6 +200,12 @@ store_output()
#return $PIPESTATUS
#return $PIPESTATUS
}
}
showcmd_store_output
()
{
showcmd
"
$@
"
store_output
"
$@
"
}
clean_store_output
()
clean_store_output
()
{
{
rm
-f
$RC_STDOUT
$RC_STDOUT
.pipestatus
rm
-f
$RC_STDOUT
$RC_STDOUT
.pipestatus
...
@@ -208,7 +214,8 @@ clean_store_output()
...
@@ -208,7 +214,8 @@ clean_store_output()
# run epm, possible from side repo
# run epm, possible from side repo
epm
()
epm
()
{
{
$PROGDIR
/epm
$@
[
-n
"
$PROGNAME
"
]
||
fatal
"Can't use epm call from the piped script"
$PROGDIR
/
$PROGNAME
$@
}
}
# Print error message and stop the program
# Print error message and stop the program
...
@@ -424,6 +431,8 @@ if [ -n "$FORCEPM" ] ; then
...
@@ -424,6 +431,8 @@ if [ -n "$FORCEPM" ] ; then
return
return
fi
fi
# TODO: move it in distr_vendor?
# FIXME: some problems with multibased distros (Server Edition on CentOS and Desktop Edition on Ubuntu)
case
$DISTRNAME
in
case
$DISTRNAME
in
ALTLinux
)
ALTLinux
)
CMD
=
"apt-rpm"
CMD
=
"apt-rpm"
...
@@ -487,6 +496,9 @@ case $DISTRNAME in
...
@@ -487,6 +496,9 @@ case $DISTRNAME in
TinyCoreLinux
)
TinyCoreLinux
)
CMD
=
"tce"
CMD
=
"tce"
;;
;;
VoidLinux
)
CMD
=
"xbps"
;;
*
)
*
)
fatal
"Have no suitable DISTRNAME
$DISTRNAME
"
fatal
"Have no suitable DISTRNAME
$DISTRNAME
"
;;
;;
...
...
bin/epm-update
View file @
edc6ef46
#!/bin/sh
#!/bin/sh
#
#
# Copyright (C) 2012,
2014
Etersoft
# Copyright (C) 2012,
2014, 2016
Etersoft
# Copyright (C) 2012,
2014
Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2012,
2014, 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
...
@@ -90,6 +90,9 @@ case $PMTYPE in
...
@@ -90,6 +90,9 @@ case $PMTYPE in
aptcyg
)
aptcyg
)
sudocmd apt-cyg update
sudocmd apt-cyg update
;;
;;
xbps
)
sudocmd xbps-install
-S
;;
*
)
*
)
fatal
"Have no suitable update command for
$PMTYPE
"
fatal
"Have no suitable update command for
$PMTYPE
"
;;
;;
...
...
bin/epm-upgrade
View file @
edc6ef46
...
@@ -97,6 +97,9 @@ epm_upgrade()
...
@@ -97,6 +97,9 @@ epm_upgrade()
docmd_foreach
"epm install"
$(
short
=
1 epm packages
)
docmd_foreach
"epm install"
$(
short
=
1 epm packages
)
return
return
;;
;;
xbps
)
CMD
=
"xbps-install -Su"
;;
*
)
*
)
fatal
"Have no suitable command for
$PMTYPE
"
fatal
"Have no suitable command for
$PMTYPE
"
;;
;;
...
...
bin/epm-whatdepends
View file @
edc6ef46
...
@@ -56,6 +56,9 @@ case $PMTYPE in
...
@@ -56,6 +56,9 @@ case $PMTYPE in
aptcyg
)
aptcyg
)
CMD
=
"apt-cyg rdepends"
CMD
=
"apt-cyg rdepends"
;;
;;
xbps
)
CMD
=
"xbps-query -X"
;;
*
)
*
)
fatal
"Have no suitable command for
$PMTYPE
"
fatal
"Have no suitable command for
$PMTYPE
"
;;
;;
...
...
bin/serv
View file @
edc6ef46
...
@@ -76,6 +76,9 @@ case $DISTRNAME in
...
@@ -76,6 +76,9 @@ case $DISTRNAME in
Fedora|LinuxXP|ASPLinux|CentOS|RHEL|Scientific
)
Fedora|LinuxXP|ASPLinux|CentOS|RHEL|Scientific
)
CMD
=
"service-chkconfig"
CMD
=
"service-chkconfig"
;;
;;
VoidLinux
)
CMD
=
"runit"
;;
Slackware
)
Slackware
)
CMD
=
"service-initd"
CMD
=
"service-initd"
;;
;;
...
@@ -106,6 +109,7 @@ ANYSERVICE=$(which anyservice 2>/dev/null)
...
@@ -106,6 +109,7 @@ ANYSERVICE=$(which anyservice 2>/dev/null)
is_anyservice
()
is_anyservice
()
{
{
[
-n
"
$ANYSERVICE
"
]
||
return
[
-n
"
$ANYSERVICE
"
]
||
return
[
-n
"
$1
"
]
||
return
# check if anyservice is exists and checkd returns true
# check if anyservice is exists and checkd returns true
$ANYSERVICE
"
$1
"
checkd 2>/dev/null
$ANYSERVICE
"
$1
"
checkd 2>/dev/null
}
}
...
...
bin/serv-common
View file @
edc6ef46
#!/bin/sh
#!/bin/sh
#
#
# Copyright (C) 2012 Etersoft
# Copyright (C) 2012
, 2016
Etersoft
# Copyright (C) 2012 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2012
, 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
...
@@ -40,6 +40,9 @@ serv_common()
...
@@ -40,6 +40,9 @@ serv_common()
sudocmd systemctl
"
$@
"
$SERVICE
sudocmd systemctl
"
$@
"
$SERVICE
fi
fi
;;
;;
runit
)
sudocmd sv
$SERVICE
"
$@
"
;;
*
)
*
)
fatal
"Have no suitable command for
$SERVICETYPE
"
fatal
"Have no suitable command for
$SERVICETYPE
"
;;
;;
...
...
bin/serv-disable
View file @
edc6ef46
...
@@ -26,7 +26,7 @@ serv_disable()
...
@@ -26,7 +26,7 @@ serv_disable()
local
SERVICE
=
"
$1
"
local
SERVICE
=
"
$1
"
is_service_running
$1
&&
{
serv_stop
$1
||
return
;
}
is_service_running
$1
&&
{
serv_stop
$1
||
return
;
}
is_service_autostart
$1
||
{
ech
o
"Service
$1
already disabled for startup"
&&
return
;
}
is_service_autostart
$1
||
{
inf
o
"Service
$1
already disabled for startup"
&&
return
;
}
case
$SERVICETYPE
in
case
$SERVICETYPE
in
service-chkconfig|service-upstart
)
service-chkconfig|service-upstart
)
...
@@ -42,6 +42,9 @@ serv_disable()
...
@@ -42,6 +42,9 @@ serv_disable()
systemd
)
systemd
)
sudocmd systemctl disable
$1
sudocmd systemctl disable
$1
;;
;;
runit
)
sudocmd
rm
-fv
/var/service/
$SERVICE
;;
*
)
*
)
fatal
"Have no suitable command for
$SERVICETYPE
"
fatal
"Have no suitable command for
$SERVICETYPE
"
;;
;;
...
...
bin/serv-enable
View file @
edc6ef46
...
@@ -25,7 +25,7 @@ __serv_enable()
...
@@ -25,7 +25,7 @@ __serv_enable()
{
{
local
SERVICE
=
"
$1
"
local
SERVICE
=
"
$1
"
is_service_autostart
$1
&&
echo
"Service
$1
already enabled for startup"
&&
return
is_service_autostart
$1
&&
info
"Service
$1
is
already enabled for startup"
&&
return
case
$SERVICETYPE
in
case
$SERVICETYPE
in
service-chkconfig
)
service-chkconfig
)
...
@@ -46,6 +46,11 @@ __serv_enable()
...
@@ -46,6 +46,11 @@ __serv_enable()
systemd
)
systemd
)
sudocmd systemctl
enable
$1
sudocmd systemctl
enable
$1
;;
;;
runit
)
epm assure
$SERVICE
[
-r
"/etc/sv/
$SERVICE
"
]
||
fatal
"Can't find /etc/sv/
$SERVICE
"
sudocmd
ln
-s
/etc/sv/
$SERVICE
/var/service/
;;
*
)
*
)
fatal
"Have no suitable command for
$SERVICETYPE
"
fatal
"Have no suitable command for
$SERVICETYPE
"
;;
;;
...
@@ -57,5 +62,6 @@ serv_enable()
...
@@ -57,5 +62,6 @@ serv_enable()
{
{
__serv_enable
"
$1
"
||
return
__serv_enable
"
$1
"
||
return
# start if need
# start if need
is_service_running
$1
||
serv_start
$1
||
return
is_service_running
$1
&&
info
"Service
$1
is already running"
&&
return
serv_start
$1
}
}
bin/serv-reload
View file @
edc6ef46
...
@@ -40,7 +40,9 @@ serv_reload()
...
@@ -40,7 +40,9 @@ serv_reload()
sudocmd systemctl reload
$SERVICE
"
$@
"
sudocmd systemctl reload
$SERVICE
"
$@
"
;;
;;
*
)
*
)
fatal
"Have no suitable command for
$SERVICETYPE
"
info
"Fallback to restart..."
load_helper serv-restart
serv_restart
"
$SERVICE
"
"
$@
"
;;
;;
esac
esac
}
}
bin/serv-restart
View file @
edc6ef46
...
@@ -39,6 +39,9 @@ serv_restart()
...
@@ -39,6 +39,9 @@ serv_restart()
systemd
)
systemd
)
sudocmd systemctl restart
$SERVICE
"
$@
"
sudocmd systemctl restart
$SERVICE
"
$@
"
;;
;;
runit
)
sudocmd sv restart
"
$SERVICE
"
;;
*
)
*
)
fatal
"Have no suitable command for
$SERVICETYPE
"
fatal
"Have no suitable command for
$SERVICETYPE
"
;;
;;
...
...
bin/serv-start
View file @
edc6ef46
...
@@ -37,6 +37,9 @@ serv_start()
...
@@ -37,6 +37,9 @@ serv_start()
systemd
)
systemd
)
sudocmd systemctl start
"
$SERVICE
"
"
$@
"
sudocmd systemctl start
"
$SERVICE
"
"
$@
"
;;
;;
runit
)
sudocmd sv up
"
$SERVICE
"
;;
*
)
*
)
fatal
"Have no suitable command for
$SERVICETYPE
"
fatal
"Have no suitable command for
$SERVICETYPE
"
;;
;;
...
...
bin/serv-status
View file @
edc6ef46
...
@@ -36,6 +36,9 @@ is_service_running()
...
@@ -36,6 +36,9 @@ is_service_running()
systemd
)
systemd
)
$SUDO
systemctl status
$1
>
/dev/null
$SUDO
systemctl status
$1
>
/dev/null
;;
;;
runit
)
$SUDO
sv status
"
$SERVICE
"
>
/dev/null
;;
*
)
*
)
fatal
"Have no suitable command for
$SERVICETYPE
"
fatal
"Have no suitable command for
$SERVICETYPE
"
;;
;;
...
@@ -63,6 +66,9 @@ is_service_autostart()
...
@@ -63,6 +66,9 @@ is_service_autostart()
systemd
)
systemd
)
$SUDO
systemctl is-enabled
$1
$SUDO
systemctl is-enabled
$1
;;
;;
runit
)
test
-L
/var/service/
$SERVICE
;;
*
)
*
)
fatal
"Have no suitable command for
$SERVICETYPE
"
fatal
"Have no suitable command for
$SERVICETYPE
"
;;
;;
...
@@ -90,6 +96,9 @@ serv_status()
...
@@ -90,6 +96,9 @@ serv_status()
systemd
)
systemd
)
sudocmd systemctl status
$SERVICE
"
$@
"
sudocmd systemctl status
$SERVICE
"
$@
"
;;
;;
runit
)
sudocmd sv status
"
$SERVICE
"
;;
*
)
*
)
fatal
"Have no suitable command for
$SERVICETYPE
"
fatal
"Have no suitable command for
$SERVICETYPE
"
;;
;;
...
...
bin/serv-stop
View file @
edc6ef46
...
@@ -37,6 +37,9 @@ serv_stop()
...
@@ -37,6 +37,9 @@ serv_stop()
systemd
)
systemd
)
sudocmd systemctl stop
$SERVICE
"
$@
"
sudocmd systemctl stop
$SERVICE
"
$@
"
;;
;;
runit
)
sudocmd sv down
"
$SERVICE
"
;;
*
)
*
)
fatal
"Have no suitable command for
$SERVICETYPE
"
fatal
"Have no suitable command for
$SERVICETYPE
"
;;
;;
...
...
bin/serv-try_restart
View file @
edc6ef46
#!/bin/sh
#!/bin/sh
#
#
# Copyright (C) 2012 Etersoft
# Copyright (C) 2012
, 2016
Etersoft
# Copyright (C) 2012 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2012
, 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
...
@@ -26,19 +26,14 @@ serv_try_restart()
...
@@ -26,19 +26,14 @@ serv_try_restart()
shift
shift
case
$SERVICETYPE
in
case
$SERVICETYPE
in
service-chkconfig|service-upstart
)
is_service_running
$SERVICE
||
return
0
docmd serv
$SERVICE
restart
"
$@
"
;;
service-initd|service-update
)
is_service_running
$SERVICE
||
return
0
sudocmd
$INITDIR
/
$SERVICE
restart
"
$@
"
;;
systemd
)
systemd
)
sudocmd systemctl try-restart
$SERVICE
"
$@
"
sudocmd systemctl try-restart
$SERVICE
"
$@
"
;;
;;
*
)
*
)
fatal
"Have no suitable command for
$SERVICETYPE
"
info
"Fallback to restart..."
is_service_running
$SERVICE
||
{
info
"Service
$SERVICE
is not running, restart skipping…"
;
return
0
;
}
load_helper serv-restart
serv_restart
"
$SERVICE
"
"
$@
"
;;
;;
esac
esac
}
}
eepm.spec
View file @
edc6ef46
# This spec is backported to ALTLinux p8 automatically by rpmbph script from etersoft-build-utils.
# This spec is backported to ALTLinux p8 automatically by rpmbph script from etersoft-build-utils.
#
#
Name: eepm
Name: eepm
Version: 1.9.
1
Version: 1.9.
3
Release: alt0.M80P.1
Release: alt0.M80P.1
Summary: Etersoft EPM package manager
Summary: Etersoft EPM package manager
...
@@ -67,9 +67,24 @@ chmod a+x %buildroot%_datadir/%name/{serv-,epm-}*
...
@@ -67,9 +67,24 @@ chmod a+x %buildroot%_datadir/%name/{serv-,epm-}*
%_sysconfdir/bash_completion.d/cerv
%_sysconfdir/bash_completion.d/cerv
%changelog
%changelog
*
Thu Aug 18 2016 Vitaly Lipatov <lav@altlinux.ru> 1.9.1
-alt0.M80P.1
*
Wed Aug 24 2016 Vitaly Lipatov <lav@altlinux.ru> 1.9.3
-alt0.M80P.1
- backport to ALTLinux p8 (by rpmbph script)
- backport to ALTLinux p8 (by rpmbph script)
* Wed Aug 24 2016 Vitaly Lipatov <lav@altlinux.ru> 1.9.3-alt1
- implement cross install for rpm and deb packages
- serv: add runit support (Void Linux)
- serv-reload: add fallback via restart
- serv-try_restart: add fallback via restart
- small fixes
* Tue Aug 23 2016 Vitaly Lipatov <lav@altlinux.ru> 1.9.2-alt1
- add Void Linux initial support
- addrepo/removerepo: fix used repo id string
- release-upgrade: fix direct apt-repo
- epm install: disable optimize when install foreign packages
- serv: more verbose
- rewrite query and packages
* Thu Aug 18 2016 Vitaly Lipatov <lav@altlinux.ru> 1.9.1-alt1
* Thu Aug 18 2016 Vitaly Lipatov <lav@altlinux.ru> 1.9.1-alt1
- upgrade: add --auto support for apt and yum/dnf
- upgrade: add --auto support for apt and yum/dnf
- serv: add reload command support
- serv: add reload command support
...
...
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