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
ee51b229
Commit
ee51b229
authored
Jul 16, 2016
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Plain Diff
backported to p7 as 1.8.5-alt0.M70P.1 (with rpmbph script)
parents
f20146a4
13092601
Show whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
432 additions
and
83 deletions
+432
-83
distr_info
bin/distr_info
+7
-0
epm
bin/epm
+6
-3
epm-autoorphans
bin/epm-autoorphans
+11
-2
epm-autoremove
bin/epm-autoremove
+7
-7
epm-download
bin/epm-download
+7
-1
epm-epm_install
bin/epm-epm_install
+5
-2
epm-install
bin/epm-install
+78
-4
epm-packages
bin/epm-packages
+3
-0
epm-print
bin/epm-print
+3
-1
epm-query
bin/epm-query
+19
-3
epm-release_upgrade
bin/epm-release_upgrade
+35
-9
epm-repofix
bin/epm-repofix
+33
-4
epm-search
bin/epm-search
+3
-0
epm-sh-functions
bin/epm-sh-functions
+13
-1
epm-upgrade
bin/epm-upgrade
+1
-1
eepm.spec
eepm.spec
+17
-2
pack_in_onefile.sh
pack_in_onefile.sh
+1
-1
epm.sh
packed/epm.sh
+172
-35
serv.sh
packed/serv.sh
+11
-7
No files found.
bin/distr_info
View file @
ee51b229
...
@@ -30,6 +30,7 @@ rpmvendor()
...
@@ -30,6 +30,7 @@ rpmvendor()
{
{
[
"
$DISTRIB_ID
"
=
"ALTLinux"
]
&&
echo
"alt"
&&
return
[
"
$DISTRIB_ID
"
=
"ALTLinux"
]
&&
echo
"alt"
&&
return
[
"
$DISTRIB_ID
"
=
"LinuxXP"
]
&&
echo
"lxp"
&&
return
[
"
$DISTRIB_ID
"
=
"LinuxXP"
]
&&
echo
"lxp"
&&
return
[
"
$DISTRIB_ID
"
=
"TinyCoreLinux"
]
&&
echo
"tcl"
&&
return
echo
"
$DISTRIB_ID
"
|
tr
"[A-Z]"
"[a-z]"
echo
"
$DISTRIB_ID
"
|
tr
"[A-Z]"
"[a-z]"
}
}
...
@@ -52,6 +53,7 @@ pkgtype()
...
@@ -52,6 +53,7 @@ pkgtype()
windows
)
echo
"exe"
;;
windows
)
echo
"exe"
;;
android
)
echo
"apk"
;;
android
)
echo
"apk"
;;
alpine
)
echo
"apk"
;;
alpine
)
echo
"apk"
;;
tinycorelinux
)
echo
"tcz"
;;
cygwin
)
echo
"tar.xz"
;;
cygwin
)
echo
"tar.xz"
;;
debian|ubuntu|mint|runtu|mcst
)
echo
"deb"
;;
debian|ubuntu|mint|runtu|mcst
)
echo
"deb"
;;
alt|asplinux|suse|mandriva|rosa|mandrake|pclinux|sled|sles
)
alt|asplinux|suse|mandriva|rosa|mandrake|pclinux|sled|sles
)
...
@@ -137,6 +139,11 @@ elif distro os-release && which apk 2>/dev/null >/dev/null ; then
...
@@ -137,6 +139,11 @@ elif distro os-release && which apk 2>/dev/null >/dev/null ; then
DISTRIB_ID
=
"
$ID
"
DISTRIB_ID
=
"
$ID
"
DISTRIB_RELEASE
=
"
$VERSION_ID
"
DISTRIB_RELEASE
=
"
$VERSION_ID
"
elif
distro os-release
&&
which tce-ab 2>/dev/null
>
/dev/null
;
then
.
$ROOTDIR
/etc/os-release
DISTRIB_ID
=
"TinyCoreLinux"
DISTRIB_RELEASE
=
"
$VERSION_ID
"
elif
distro arch-release
;
then
elif
distro arch-release
;
then
DISTRIB_ID
=
"ArchLinux"
DISTRIB_ID
=
"ArchLinux"
DISTRIB_RELEASE
=
"2010"
DISTRIB_RELEASE
=
"2010"
...
...
bin/epm
View file @
ee51b229
...
@@ -19,6 +19,9 @@
...
@@ -19,6 +19,9 @@
PROGDIR
=
$(
dirname
$0
)
PROGDIR
=
$(
dirname
$0
)
[
"
$PROGDIR
"
=
"."
]
&&
PROGDIR
=
$(
pwd
)
[
"
$PROGDIR
"
=
"."
]
&&
PROGDIR
=
$(
pwd
)
if
[
"
$0
"
=
"/dev/stdin"
]
||
[
"
$0
"
=
"sh"
]
;
then
PROGDIR
=
""
fi
# will replaced to /usr/share/eepm during install
# will replaced to /usr/share/eepm during install
SHAREDIR
=
$PROGDIR
SHAREDIR
=
$PROGDIR
...
@@ -239,7 +242,7 @@ check_command()
...
@@ -239,7 +242,7 @@ check_command()
clean
)
# HELPCMD: clean local package cache
clean
)
# HELPCMD: clean local package cache
epm_cmd
=
clean
epm_cmd
=
clean
;;
;;
autoremove
)
# HELPCMD: auto remove unneeded package(s)
autoremove
|package-cleanup
)
# HELPCMD: auto remove unneeded package(s)
epm_cmd
=
autoremove
epm_cmd
=
autoremove
;;
;;
autoorphans|--orphans
)
# HELPCMD: remove all packages not from the repository
autoorphans|--orphans
)
# HELPCMD: remove all packages not from the repository
...
@@ -364,8 +367,8 @@ for opt in "$@" ; do
...
@@ -364,8 +367,8 @@ for opt in "$@" ; do
check_filenames
$opt
check_filenames
$opt
done
done
# if input is not console
, get pkg from it
too
# if input is not console
and run script from file, get pkgs from stdin
too
if
!
inputisatty
;
then
if
!
inputisatty
&&
[
-n
"
$PROGDIR
"
]
;
then
for
opt
in
$(
withtimeout 1
cat
)
;
do
for
opt
in
$(
withtimeout 1
cat
)
;
do
check_filenames
$opt
check_filenames
$opt
done
done
...
...
bin/epm-autoorphans
View file @
ee51b229
...
@@ -34,7 +34,10 @@ case $PMTYPE in
...
@@ -34,7 +34,10 @@ case $PMTYPE in
assure_exists /etc/buildreqs/files/ignore.d/apt-scripts apt-scripts
assure_exists /etc/buildreqs/files/ignore.d/apt-scripts apt-scripts
echo
"We will try remove all installed packages which are missed in repositories"
echo
"We will try remove all installed packages which are missed in repositories"
warning
"Use with caution!"
warning
"Use with caution!"
local
PKGLIST
=
$(
__epm_orphan_altrpm |
sed
-e
"s/
\.
32bit//g"
|
grep
-v
--
"^kernel"
)
local
PKGLIST
=
$(
__epm_orphan_altrpm
\
|
sed
-e
"s/
\.
32bit//g"
\
|
grep
-v
--
"^eepm$"
\
|
grep
-v
--
"^kernel"
)
docmd epm remove
$PKGLIST
docmd epm remove
$PKGLIST
;;
;;
apt-dpkg|aptitude-dpkg
)
apt-dpkg|aptitude-dpkg
)
...
@@ -47,7 +50,13 @@ case $PMTYPE in
...
@@ -47,7 +50,13 @@ case $PMTYPE in
# ;;
# ;;
yum-rpm
)
yum-rpm
)
showcmd package-cleanup
--orphans
showcmd package-cleanup
--orphans
local
PKGLIST
=
$(
package-cleanup
--orphans
)
local
PKGLIST
=
$(
package-cleanup
--orphans
|
grep
-v
"^eepm$"
)
docmd epm remove
$PKGLIST
;;
dnf-rpm
)
# TODO: dnf list extras
showcmd package-cleanup
--orphans
local
PKGLIST
=
$(
package-cleanup
--orphans
|
grep
-v
"^eepm$"
)
docmd epm remove
$PKGLIST
docmd epm remove
$PKGLIST
;;
;;
urpm-rpm
)
urpm-rpm
)
...
...
bin/epm-autoremove
View file @
ee51b229
...
@@ -32,11 +32,11 @@ __epm_autoremove_altrpm()
...
@@ -32,11 +32,11 @@ __epm_autoremove_altrpm()
# https://www.altlinux.org/APT_в_ALT_Linux/Советы_по_использованию#apt-cache_list-nodeps
# https://www.altlinux.org/APT_в_ALT_Linux/Советы_по_использованию#apt-cache_list-nodeps
showcmd
"apt-cache list-nodeps | grep --
\"
$libexclude
\"
"
showcmd
"apt-cache list-nodeps | grep --
\"
$libexclude
\"
"
pkgs
=
$(
apt-cache list-nodeps |
grep
--
"
$libexclude
"
|
\
pkgs
=
$(
apt-cache list-nodeps |
grep
--
"
$libexclude
"
\
grep
-E
-v
--
"-(devel|debuginfo)$"
|
\
|
grep
-E
-v
--
"-(devel|debuginfo)$"
\
grep
-E
-v
--
"-(util|tool|plugin|daemon)"
|
\
|
grep
-E
-v
--
"-(util|tool|plugin|daemon)"
\
sed
-e
"s/
\.
32bit
$/
/g"
|
\
|
sed
-e
"s/
\.
32bit
$/
/g"
\
grep
-E
-v
--
"^(libsystemd|libreoffice|libnss
)"
)
|
grep
-E
-v
--
"^(libsystemd|libreoffice|libnss|eepm
)"
)
[
-n
"
$pkgs
"
]
&&
sudocmd rpm
-v
-e
$pkgs
&&
flag
=
1
[
-n
"
$pkgs
"
]
&&
sudocmd rpm
-v
-e
$pkgs
&&
flag
=
1
info
"Removing unused python/perl modules..."
info
"Removing unused python/perl modules..."
...
@@ -55,7 +55,7 @@ __epm_autoremove_altrpm()
...
@@ -55,7 +55,7 @@ __epm_autoremove_altrpm()
return
0
return
0
}
}
# TODO: keep our eepm package
epm_autoremove
()
epm_autoremove
()
{
{
...
@@ -82,7 +82,7 @@ case $PMTYPE in
...
@@ -82,7 +82,7 @@ case $PMTYPE in
while
true
;
do
while
true
;
do
docmd package-cleanup
--leaves
$(
subst_option non_interactive
--assumeyes
)
docmd package-cleanup
--leaves
$(
subst_option non_interactive
--assumeyes
)
# FIXME: package-cleanup have to use stderr for errors
# FIXME: package-cleanup have to use stderr for errors
local
PKGLIST
=
$(
package-cleanup
--leaves
|
grep
-v
"Loaded plugins"
|
grep
-v
"Unable to"
)
local
PKGLIST
=
$(
package-cleanup
--leaves
|
grep
-v
"Loaded plugins"
|
grep
-v
"Unable to"
|
grep
-v
"^eepm$"
)
[
-n
"
$PKGLIST
"
]
||
break
[
-n
"
$PKGLIST
"
]
||
break
sudocmd yum remove
$PKGLIST
sudocmd yum remove
$PKGLIST
done
done
...
...
bin/epm-download
View file @
ee51b229
...
@@ -31,7 +31,13 @@ epm_download()
...
@@ -31,7 +31,13 @@ epm_download()
yum-rpm
)
yum-rpm
)
# TODO: check yum install --downloadonly --downloaddir=/tmp <package-name>
# TODO: check yum install --downloadonly --downloaddir=/tmp <package-name>
assure_exists yumdownloader yum-utils
assure_exists yumdownloader yum-utils
sudo
yumdownloader
$pkg_filenames
sudocmd yumdownloader
$pkg_filenames
;;
dnf-rpm
)
sudocmd dnf download
$pkg_filenames
;;
tce
)
sudocmd tce-load
-w
$pkg_filenames
;;
;;
*
)
*
)
fatal
"Have no suitable command for
$PMTYPE
"
fatal
"Have no suitable command for
$PMTYPE
"
...
...
bin/epm-epm_install
View file @
ee51b229
...
@@ -17,8 +17,10 @@
...
@@ -17,8 +17,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#
etersoft_updates_site
=
"http://updates.etersoft.ru/pub/Etersoft/Sisyphus/
$(
$DISTRVENDOR
-e
)
/"
myinit
(){
download_dir
=
"/tmp"
etersoft_updates_site
=
"http://updates.etersoft.ru/pub/Etersoft/Sisyphus/
$(
$DISTRVENDOR
-e
)
/"
download_dir
=
"/tmp"
}
download_epm
(){
download_epm
(){
download_link
=
$etersoft_updates_site
$(
wget
-qO-
$etersoft_updates_site
/ |
grep
-m1
-Eo
"eepm[^
\"
]+
\.
$(
$DISTRVENDOR
-p
)
"
|
tail
-n1
)
#"
download_link
=
$etersoft_updates_site
$(
wget
-qO-
$etersoft_updates_site
/ |
grep
-m1
-Eo
"eepm[^
\"
]+
\.
$(
$DISTRVENDOR
-p
)
"
|
tail
-n1
)
#"
...
@@ -27,6 +29,7 @@ download_epm(){
...
@@ -27,6 +29,7 @@ download_epm(){
}
}
epm_epm_install
(){
epm_epm_install
(){
myinit
download_epm
||
fatal
"Error. Check download link:
$download_link
"
download_epm
||
fatal
"Error. Check download link:
$download_link
"
epm i
$eepm_package
||
fatal
epm i
$eepm_package
||
fatal
rm
-fv
$eepm_package
rm
-fv
$eepm_package
...
...
bin/epm-install
View file @
ee51b229
#!/bin/sh
#!/bin/sh
#
#
# Copyright (C) 2012-201
3
Etersoft
# Copyright (C) 2012-201
6
Etersoft
# Copyright (C) 2012-201
3
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
...
@@ -101,7 +101,7 @@ epm_install_names()
...
@@ -101,7 +101,7 @@ epm_install_names()
[
-z
"
$1
"
]
&&
return
[
-z
"
$1
"
]
&&
return
case
$PMTYPE
in
case
$PMTYPE
in
apt-rpm|apt-dpkg
)
apt-rpm|apt-dpkg
)
sudocmd apt-get
$APTOPTIONS
install
$@
sudocmd apt-get
$APTOPTIONS
$noremove
install
$@
return
;;
return
;;
aptitude-dpkg
)
aptitude-dpkg
)
sudocmd aptitude
install
$@
sudocmd aptitude
install
$@
...
@@ -166,6 +166,9 @@ epm_install_names()
...
@@ -166,6 +166,9 @@ epm_install_names()
apk
)
apk
)
sudocmd apk add
$@
sudocmd apk add
$@
return
;;
return
;;
tce
)
sudocmd tce-load
-wi
$@
return
;;
guix
)
guix
)
__separate_sudocmd
"guix package -i"
"guix package -i"
$@
__separate_sudocmd
"guix package -i"
"guix package -i"
$@
return
;;
return
;;
...
@@ -188,7 +191,7 @@ epm_ni_install_names()
...
@@ -188,7 +191,7 @@ epm_ni_install_names()
case
$PMTYPE
in
case
$PMTYPE
in
apt-rpm|apt-dpkg
)
apt-rpm|apt-dpkg
)
export
DEBIAN_FRONTEND
=
noninteractive
export
DEBIAN_FRONTEND
=
noninteractive
sudocmd apt-get
-y
--force-yes
-o
Dpkg::Options::
=
"--force-confdef"
-o
Dpkg::Options::
=
"--force-confold"
$APTOPTIONS
install
$@
sudocmd apt-get
-y
$noremove
--force-yes
-o
Dpkg::Options::
=
"--force-confdef"
-o
Dpkg::Options::
=
"--force-confold"
$APTOPTIONS
install
$@
return
;;
return
;;
aptitude-dpkg
)
aptitude-dpkg
)
sudocmd aptitde
-y
install
$@
sudocmd aptitde
-y
install
$@
...
@@ -237,6 +240,9 @@ epm_ni_install_names()
...
@@ -237,6 +240,9 @@ epm_ni_install_names()
apk
)
apk
)
sudocmd apk add
$@
sudocmd apk add
$@
return
;;
return
;;
tce
)
sudocmd tce-load
-wi
$@
return
;;
#android)
#android)
# sudocmd pm install $@
# sudocmd pm install $@
# return ;;
# return ;;
...
@@ -256,6 +262,58 @@ __epm_check_if_rpm_already_installed()
...
@@ -256,6 +262,58 @@ __epm_check_if_rpm_already_installed()
LANG
=
C
$SUDO
rpm
-Uvh
$force
$nodeps
$@
2>&1 |
grep
-q
"is already installed"
LANG
=
C
$SUDO
rpm
-Uvh
$force
$nodeps
$@
2>&1 |
grep
-q
"is already installed"
}
}
# TODO: rewrite to convert (get some code from Korinf?)
__epm_check_if_try_install_deb
()
{
local
pkg
local
debpkgs
=
""
for
pkg
in
$@
;
do
[
"
$(
get_package_type
"
$pkg
"
)
"
=
"deb"
]
||
return
1
[
-e
"
$pkg
"
]
||
fatal
"Can't read
$pkg
"
debpkgs
=
"
$debpkgs
$(
realpath
$pkg
)
"
done
[
-n
"
$debpkgs
"
]
||
return
1
assure_exists alien
local
TDIR
=
$(
mktemp
-d
)
cd
$TDIR
for
pkg
in
$debpkgs
;
do
showcmd alien
-r
-k
--scripts
"
$pkg
"
# TODO: need check for return status
done
rm
-f
$TDIR
/
*
rmdir
$TDIR
/
return
0
}
# TODO: rewrite to convert (get some code from Korinf?)
__epm_check_if_try_install_rpm
()
{
local
pkg
local
rpmpkgs
=
""
for
pkg
in
$@
;
do
[
"
$(
get_package_type
"
$pkg
"
)
"
=
"rpm"
]
||
return
1
[
-e
"
$pkg
"
]
||
fatal
"Can't read
$pkg
"
rpmpkgs
=
"
$rpmpkgs
$(
realpath
$pkg
)
"
done
[
-n
"
$rpmpkgs
"
]
||
return
1
assure_exists alien
local
TDIR
=
$(
mktemp
-d
)
cd
$TDIR
for
pkg
in
$rpmpkgs
;
do
showcmd alien
-d
-k
--scripts
"
$pkg
"
# TODO: need check for return status
done
rm
-f
$TDIR
/
*
rmdir
$TDIR
/
return
0
}
epm_install_files
()
epm_install_files
()
{
{
...
@@ -267,6 +325,8 @@ epm_install_files()
...
@@ -267,6 +325,8 @@ epm_install_files()
case
$PMTYPE
in
case
$PMTYPE
in
apt-rpm
)
apt-rpm
)
__epm_check_if_try_install_deb
$@
&&
return
sudocmd rpm
-Uvh
$force
$nodeps
$@
&&
return
sudocmd rpm
-Uvh
$force
$nodeps
$@
&&
return
local
RES
=
$?
local
RES
=
$?
...
@@ -277,11 +337,15 @@ epm_install_files()
...
@@ -277,11 +337,15 @@ epm_install_files()
# use install_names
# use install_names
;;
;;
apt-dpkg|aptitude-dpkg
)
apt-dpkg|aptitude-dpkg
)
# the new version of the conf. file is installed with a .dpkg-dist suffix
# the new version of the conf. file is installed with a .dpkg-dist suffix
if
[
-n
"
$non_interactive
"
]
;
then
if
[
-n
"
$non_interactive
"
]
;
then
DPKGOPTIONS
=
"--force-confdef --force-confold"
DPKGOPTIONS
=
"--force-confdef --force-confold"
fi
fi
__epm_check_if_try_install_rpm
$@
&&
return
# FIXME: return false in case no install and in case install with broken deps
# FIXME: return false in case no install and in case install with broken deps
sudocmd dpkg
$DPKGOPTIONS
-i
$@
sudocmd dpkg
$DPKGOPTIONS
-i
$@
local
RES
=
$?
local
RES
=
$?
...
@@ -296,7 +360,10 @@ epm_install_files()
...
@@ -296,7 +360,10 @@ epm_install_files()
sudocmd dpkg
$DPKGOPTIONS
-i
$@
sudocmd dpkg
$DPKGOPTIONS
-i
$@
return
return
;;
;;
yum-rpm|dnf-rpm
)
yum-rpm|dnf-rpm
)
__epm_check_if_try_install_deb
$@
&&
return
sudocmd rpm
-Uvh
$force
$nodeps
$@
&&
return
sudocmd rpm
-Uvh
$force
$nodeps
$@
&&
return
# if run with --nodeps, do not fallback on hi level
# if run with --nodeps, do not fallback on hi level
...
@@ -306,7 +373,9 @@ epm_install_files()
...
@@ -306,7 +373,9 @@ epm_install_files()
YUMOPTIONS
=
--nogpgcheck
YUMOPTIONS
=
--nogpgcheck
# use install_names
# use install_names
;;
;;
zypper-rpm
)
zypper-rpm
)
__epm_check_if_try_install_deb
$@
&&
return
sudocmd rpm
-Uvh
$force
$nodeps
$@
&&
return
sudocmd rpm
-Uvh
$force
$nodeps
$@
&&
return
local
RES
=
$?
local
RES
=
$?
...
@@ -318,7 +387,9 @@ epm_install_files()
...
@@ -318,7 +387,9 @@ epm_install_files()
ZYPPEROPTIONS
=
$(
__use_zypper_no_gpg_checks
)
ZYPPEROPTIONS
=
$(
__use_zypper_no_gpg_checks
)
# use install_names
# use install_names
;;
;;
urpm-rpm
)
urpm-rpm
)
__epm_check_if_try_install_deb
$@
&&
return
sudocmd rpm
-Uvh
$force
$nodeps
$@
&&
return
sudocmd rpm
-Uvh
$force
$nodeps
$@
&&
return
local
RES
=
$?
local
RES
=
$?
...
@@ -406,6 +477,9 @@ epm_print_install_command()
...
@@ -406,6 +477,9 @@ epm_print_install_command()
aptcyg
)
aptcyg
)
echo
"apt-cyg install
$@
"
echo
"apt-cyg install
$@
"
;;
;;
tce
)
echo
"tce-load -wi
$@
"
;;
*
)
*
)
fatal
"Have no suitable appropriate install command for
$PMTYPE
"
fatal
"Have no suitable appropriate install command for
$PMTYPE
"
;;
;;
...
...
bin/epm-packages
View file @
ee51b229
...
@@ -125,6 +125,9 @@ case $PMTYPE in
...
@@ -125,6 +125,9 @@ case $PMTYPE in
apk
)
apk
)
CMD
=
"apk info"
CMD
=
"apk info"
;;
;;
tce
)
CMD
=
"ls -1 /usr/local/tce.installed"
;;
guix
)
guix
)
CMD
=
"guix package -I"
CMD
=
"guix package -I"
;;
;;
...
...
bin/epm-print
View file @
ee51b229
...
@@ -39,7 +39,9 @@ print_binpkgfilelist()
...
@@ -39,7 +39,9 @@ print_binpkgfilelist()
local
PKGNAME
=
$(
basename
$2
)
local
PKGNAME
=
$(
basename
$2
)
find
"
$PKGDIR
"
!
-name
'*\.src\.rpm'
-name
'*\.rpm'
-execdir
\
find
"
$PKGDIR
"
!
-name
'*\.src\.rpm'
-name
'*\.rpm'
-execdir
\
rpmquery
-p
--qf
=
'%{sourcerpm}\t%{name}-%{version}-%{release}.%{arch}.rpm\n'
"{}"
\;
\
rpmquery
-p
--qf
=
'%{sourcerpm}\t%{name}-%{version}-%{release}.%{arch}.rpm\n'
"{}"
\;
\
|
grep
"^
$PKGNAME
[[:space:]].*"
|
cut
-f2
| xargs
-n1
-I
"{}"
echo
-n
"
$PKGDIR
/{} "
|
grep
"^
$PKGNAME
[[:space:]].*"
\
|
cut
-f2
\
| xargs
-n1
-I
"{}"
echo
-n
"
$PKGDIR
/{} "
}
}
# TODO: need try detect more strict
# TODO: need try detect more strict
...
...
bin/epm-query
View file @
ee51b229
...
@@ -146,6 +146,16 @@ __epm_query_file()
...
@@ -146,6 +146,16 @@ __epm_query_file()
docmd
$CMD
$@
docmd
$CMD
$@
}
}
# hack: dpkg -W will print names for removed packages too (until newest Ubuntu)
__epm_query_dpkg_check
()
{
local
i
for
i
in
$@
;
do
a
=
dpkg
-s
$i
>
/dev/null 2>/dev/null
||
return
done
return
0
}
__epm_query_name
()
__epm_query_name
()
{
{
local
CMD
local
CMD
...
@@ -158,7 +168,10 @@ __epm_query_name()
...
@@ -158,7 +168,10 @@ __epm_query_name()
;;
;;
*
-dpkg
)
*
-dpkg
)
#docmd dpkg -l $@ | grep "^ii"
#docmd dpkg -l $@ | grep "^ii"
CMD
=
"dpkg-query -W --showformat=
\$
{Package}-
\$
{Version}
\n
"
#CMD="dpkg-query -W --showformat=\${Package}-\${Version}\n"
docmd dpkg-query
-W
"--showformat=
\$
{Package}-
\$
{Version}
\n
"
$@
||
return
__epm_query_dpkg_check
$@
||
return
return
;;
;;
npackd
)
npackd
)
docmd
"npackdcl path --package=
$@
"
docmd
"npackdcl path --package=
$@
"
...
@@ -197,7 +210,10 @@ __epm_query_shortname()
...
@@ -197,7 +210,10 @@ __epm_query_shortname()
CMD
=
"rpm -q --queryformat %{name}
\n
"
CMD
=
"rpm -q --queryformat %{name}
\n
"
;;
;;
*
-dpkg
)
*
-dpkg
)
CMD
=
"dpkg-query -W --showformat=
\$
{Package}
\n
"
#CMD="dpkg-query -W --showformat=\${Package}\n"
docmd dpkg-query
-W
"--showformat=
\$
{Package}
\n
"
$@
||
return
__epm_query_dpkg_check
$@
||
return
return
;;
;;
npackd
)
npackd
)
docmd
"npackdcl path --package=
$@
"
docmd
"npackdcl path --package=
$@
"
...
@@ -228,7 +244,7 @@ __epm_query_shortname()
...
@@ -228,7 +244,7 @@ __epm_query_shortname()
# check if pkg is installed
# check if pkg is installed
is_installed
()
is_installed
()
{
{
short
=
1
pkg_filenames
=
"
$@
"
pkg_names
=
"
$@
"
epm_query
>
/dev/null 2>/dev/null
__epm_query_shortname
$pkg_names
>
/dev/null 2>/dev/null
# broken way to recursive call here (overhead!)
# broken way to recursive call here (overhead!)
#epm installed $@ >/dev/null 2>/dev/null
#epm installed $@ >/dev/null 2>/dev/null
}
}
...
...
bin/epm-release_upgrade
View file @
ee51b229
...
@@ -35,15 +35,21 @@ __wcount()
...
@@ -35,15 +35,21 @@ __wcount()
__detect_alt_release_by_repo
()
__detect_alt_release_by_repo
()
{
{
local
BRD
=
$(
cat
/etc/apt/sources.list /etc/apt/sources.list.d/
*
.list |
\
local
BRD
=
$(
cat
/etc/apt/sources.list /etc/apt/sources.list.d/
*
.list
\
grep
-v
"^#"
|
grep
"p[5-9]/branch/"
|
sed
-e
"s|.*
\(
p[5-9]
\)
/branch.*|
\1
|g"
|
sort
-u
)
|
grep
-v
"^#"
\
|
grep
"p[5-9]/branch/"
\
|
sed
-e
"s|.*
\(
p[5-9]
\)
/branch.*|
\1
|g"
\
|
sort
-u
)
if
[
$(
__wcount
$BRD
)
=
"1"
]
;
then
if
[
$(
__wcount
$BRD
)
=
"1"
]
;
then
echo
"
$BRD
"
echo
"
$BRD
"
return
return
fi
fi
local
BRD
=
$(
cat
/etc/apt/sources.list /etc/apt/sources.list.d/
*
.list |
\
local
BRD
=
$(
cat
/etc/apt/sources.list /etc/apt/sources.list.d/
*
.list
\
grep
-v
"^#"
|
grep
"Sisyphus/"
|
sed
-e
"s|.*
\(
Sisyphus
\)
.*|
\1
|g"
|
sort
-u
)
|
grep
-v
"^#"
\
|
grep
"Sisyphus/"
\
|
sed
-e
"s|.*
\(
Sisyphus
\)
.*|
\1
|g"
\
|
sort
-u
)
if
[
$(
__wcount
$BRD
)
=
"1"
]
;
then
if
[
$(
__wcount
$BRD
)
=
"1"
]
;
then
echo
"
$BRD
"
echo
"
$BRD
"
return
return
...
@@ -58,8 +64,11 @@ __replace_alt_version_in_repo()
...
@@ -58,8 +64,11 @@ __replace_alt_version_in_repo()
assure_exists apt-repo
assure_exists apt-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
if
apt-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
docmd apt-repo list
docmd apt-repo list
}
}
...
@@ -94,8 +103,8 @@ __update_to_the_distro()
...
@@ -94,8 +103,8 @@ __update_to_the_distro()
p8
)
p8
)
docmd epm update
||
fatal
docmd epm update
||
fatal
if
!
docmd epm
install
apt rpm apt-conf-branch
$(
get_fix_release_pkg p8
)
;
then
if
!
docmd epm
install
apt rpm apt-conf-branch
$(
get_fix_release_pkg p8
)
;
then
# error: execution of %post scriptlet from glibc-core-2.23-alt1.eter1
#
Hack for
error: execution of %post scriptlet from glibc-core-2.23-alt1.eter1
docmd
epm erase
glibc-core-2.17
||
fatal
"Check an error and run epm release-upgrade again"
docmd
rpm
-ev
glibc-core-2.17
||
fatal
"Check an error and run epm release-upgrade again"
docmd epm
install
apt rpm apt-conf-branch
$(
get_fix_release_pkg p8
)
||
fatal
"Check an error and run epm release-upgrade again"
docmd epm
install
apt rpm apt-conf-branch
$(
get_fix_release_pkg p8
)
||
fatal
"Check an error and run epm release-upgrade again"
fi
fi
__alt_repofix
__alt_repofix
...
@@ -160,6 +169,7 @@ __update_alt_to_next_distro()
...
@@ -160,6 +169,7 @@ __update_alt_to_next_distro()
*
)
*
)
warning
"Have no idea how to update from
$DISTRNAME
$DISTRVERSION
."
warning
"Have no idea how to update from
$DISTRNAME
$DISTRVERSION
."
info
"Try run f.i. # epm release-upgrade p8 or # epm release-upgrade Sisyphus"
info
"Try run f.i. # epm release-upgrade p8 or # epm release-upgrade Sisyphus"
info
"Also possible you need install altlinux-release-p? package for correct distro version detecting"
return
1
return
1
esac
esac
}
}
...
@@ -177,8 +187,12 @@ epm_release_upgrade()
...
@@ -177,8 +187,12 @@ epm_release_upgrade()
# try to detect current release by repo
# try to detect current release by repo
if
[
"
$DISTRVERSION
"
=
"Sisyphus"
]
||
[
-z
"
$DISTRVERSION
"
]
;
then
if
[
"
$DISTRVERSION
"
=
"Sisyphus"
]
||
[
-z
"
$DISTRVERSION
"
]
;
then
DISTRVERSION
=
"
$(
__detect_alt_release_by_repo
)
"
local
dv
[
"
$DISTRVERSION
"
!=
"Sisyphus"
]
&&
info
"Detected running
$DISTRNAME
$DISTRVERSION
(according to using repos)"
dv
=
"
$(
__detect_alt_release_by_repo
)
"
if
[
-n
"
$dv
"
]
&&
[
"
$dv
"
!=
"
$DISTRVERSION
"
]
;
then
DISTRVERSION
=
"
$dv
"
info
"Detected running
$DISTRNAME
$DISTRVERSION
(according to using repos)"
fi
fi
fi
__alt_repofix
__alt_repofix
...
@@ -197,7 +211,7 @@ epm_release_upgrade()
...
@@ -197,7 +211,7 @@ epm_release_upgrade()
case
$PMTYPE
in
case
$PMTYPE
in
apt-rpm
)
apt-rpm
)
docmd epm update
#
docmd epm update
info
"Have no idea how to upgrade
$DISTRNAME
"
info
"Have no idea how to upgrade
$DISTRNAME
"
;;
;;
*
-dpkg
)
*
-dpkg
)
...
@@ -211,6 +225,18 @@ epm_release_upgrade()
...
@@ -211,6 +225,18 @@ epm_release_upgrade()
showcmd rpm
-Uvh
http://mirror.yandex.ru/fedora/linux/releases/16/Fedora/x86_64/os/Packages/fedora-release-16-1.noarch.rpm
showcmd rpm
-Uvh
http://mirror.yandex.ru/fedora/linux/releases/16/Fedora/x86_64/os/Packages/fedora-release-16-1.noarch.rpm
docmd epm Upgrade
docmd epm Upgrade
;;
;;
dnf-rpm
)
info
"Check https://fedoraproject.org/wiki/DNF_system_upgrade for an additional info"
docmd epm
install
dnf
sudocmd dnf clean all
assure_exists dnf-plugin-system-upgrade
sudocmd dnf system-upgrade
local
RELEASEVER
=
"
$pkg_filenames
"
[
-n
"
$RELEASEVER
"
]
||
fatal
"Run me with new version"
sudocmd dnf system-upgrade download
--refresh
--releasever
=
$RELEASEVER
sudocmd dnf system-upgrade
info
"Run epm autoorphans to remove orphaned packages"
;;
urpm-rpm
)
urpm-rpm
)
sudocmd urpmi.removemedia
-av
sudocmd urpmi.removemedia
-av
# TODO
# TODO
...
...
bin/epm-repofix
View file @
ee51b229
...
@@ -19,6 +19,16 @@
...
@@ -19,6 +19,16 @@
load_helper epm-query
load_helper epm-query
__repofix_check_vendor
()
{
local
i
for
i
in
/etc/apt/vendors.list.d/
*
.list
;
do
[
-e
"
$i
"
]
||
continue
grep
-q
"^simple-key
\"
$1
\"
"
$i
&&
return
done
return
1
}
__fix_apt_sources_list
()
__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
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'
...
@@ -31,15 +41,34 @@ __fix_apt_sources_list()
...
@@ -31,15 +41,34 @@ __fix_apt_sources_list()
#sed -i -r -e "$SUBST_ALT_RULE" $i
#sed -i -r -e "$SUBST_ALT_RULE" $i
regexp_subst
"/^ *#/!
$SUBST_ALT_RULE
"
$i
regexp_subst
"/^ *#/!
$SUBST_ALT_RULE
"
$i
# add signs
# Sisyphus uses 'alt' vendor key
if
__repofix_check_vendor alt
;
then
regexp_subst
"/ALTLinux
\/
Sisyphus
\/
/s/^rpm *([fhr])/rpm [alt]
\1
/"
$i
else
warning
"Skip set alt vendor key (it misssed)"
fi
# skip branch replacement for ALT Linux Sisyphus
[
"
$DISTRVERSION
"
=
"Sisyphus"
]
&&
continue
# add signs for branches
local
br
local
br
for
br
in
$DISTRVERSION
;
do
for
br
in
$DISTRVERSION
;
do
if
!
__repofix_check_vendor
$br
;
then
warning
"Skip set
$br
vendor key (it misssed)"
continue
fi
regexp_subst
"/ALTLinux
\/
$br
\/
branch/s/^rpm *([fhr])/rpm [
$br
]
\1
/"
$i
regexp_subst
"/ALTLinux
\/
$br
\/
branch/s/^rpm *([fhr])/rpm [
$br
]
\1
/"
$i
if
is_installed apt-conf-etersoft-common
;
then
done
regexp_subst
"/Etersoft
\/
$br
\/
branch/s/^rpm *([fhr])/rpm [etersoft]
\1
/"
$i
for
br
in
$DISTRVERSION
;
do
#if is_installed apt-conf-etersoft-common ; then
if
!
__repofix_check_vendor etersoft
;
then
warning
"Skip set etersoft vendor key (it misssed)"
continue
fi
fi
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
done
done
}
}
...
...
bin/epm-search
View file @
ee51b229
...
@@ -67,6 +67,9 @@ case $PMTYPE in
...
@@ -67,6 +67,9 @@ case $PMTYPE in
apk
)
apk
)
CMD
=
"apk search"
CMD
=
"apk search"
;;
;;
tce
)
CMD
=
"tce-ab"
;;
conary
)
conary
)
CMD
=
"conary repquery"
CMD
=
"conary repquery"
;;
;;
...
...
bin/epm-sh-functions
View file @
ee51b229
...
@@ -261,7 +261,12 @@ set_sudo()
...
@@ -261,7 +261,12 @@ set_sudo()
[
$EFFUID
=
"0"
]
&&
return
[
$EFFUID
=
"0"
]
&&
return
# use sudo if possible
# use sudo if possible
which
sudo
>
/dev/null 2>/dev/null
&&
SUDO
=
"sudo --"
&&
return
if
which
sudo
>
/dev/null 2>/dev/null
;
then
SUDO
=
"sudo --"
# check for < 1.7 version which do not support --
sudo
--help
|
grep
-q
" --"
||
SUDO
=
"sudo"
return
fi
SUDO
=
"fatal 'Can't find sudo. Please install sudo or run epm under root.'"
SUDO
=
"fatal 'Can't find sudo. Please install sudo or run epm under root.'"
}
}
...
@@ -389,6 +394,10 @@ get_package_type()
...
@@ -389,6 +394,10 @@ get_package_type()
# print options description from HELPCMD/HELPOPT lines in the code
# print options description from HELPCMD/HELPOPT lines in the code
get_help
()
get_help
()
{
{
if
[
"
$0
"
=
"/dev/stdin"
]
||
[
"
$0
"
=
"sh"
]
;
then
return
fi
grep
-v
--
"^#"
$0
|
grep
--
"#
$1
"
|
while
read
n
;
do
grep
-v
--
"^#"
$0
|
grep
--
"#
$1
"
|
while
read
n
;
do
opt
=
$(
echo
$n
|
sed
-e
"s|) #
$1
:.*||g"
)
opt
=
$(
echo
$n
|
sed
-e
"s|) #
$1
:.*||g"
)
desc
=
$(
echo
$n
|
sed
-e
"s|.*) #
$1
:||g"
)
desc
=
$(
echo
$n
|
sed
-e
"s|.*) #
$1
:||g"
)
...
@@ -474,6 +483,9 @@ case $DISTRNAME in
...
@@ -474,6 +483,9 @@ case $DISTRNAME in
alpine
)
alpine
)
CMD
=
"apk"
CMD
=
"apk"
;;
;;
TinyCoreLinux
)
CMD
=
"tce"
;;
*
)
*
)
fatal
"Have no suitable DISTRNAME
$DISTRNAME
"
fatal
"Have no suitable DISTRNAME
$DISTRNAME
"
;;
;;
...
...
bin/epm-upgrade
View file @
ee51b229
...
@@ -44,7 +44,7 @@ epm_upgrade()
...
@@ -44,7 +44,7 @@ epm_upgrade()
CMD
=
"yum update"
CMD
=
"yum update"
;;
;;
dnf-rpm
)
dnf-rpm
)
CMD
=
"dnf
update
"
CMD
=
"dnf
distro-sync
"
;;
;;
snappy
)
snappy
)
CMD
=
"snappy update"
CMD
=
"snappy update"
...
...
eepm.spec
View file @
ee51b229
# 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.8.
3
Version: 1.8.
5
Release: alt0.M70P.1
Release: alt0.M70P.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
*
Mon May 23 2016 Vitaly Lipatov <lav@altlinux.ru> 1.8.3
-alt0.M70P.1
*
Sat Jul 16 2016 Vitaly Lipatov <lav@altlinux.ru> 1.8.5
-alt0.M70P.1
- backport to ALTLinux p7 (by rpmbph script)
- backport to ALTLinux p7 (by rpmbph script)
* Sat Jun 25 2016 Vitaly Lipatov <lav@altlinux.ru> 1.8.5-alt1
- add Tiny Core Linux support (tcl, tce)
- improve dnf support: add release-upgrade
- improve ALT Linux release upgrade
* Mon May 30 2016 Vitaly Lipatov <lav@altlinux.ru> 1.8.4-alt1
- epm install: add initial support for cross install packages (deb/rpm packages on rpm/deb-based hosts)
- install: add --noremove support for apt
- repofix: add check for vendor key if set it
- add check if sudo supports --
- repofix: skip useless Sisyphus replacements
- release_upgrade: skip confirm if there are no changes
- epm-query: add semihack for check removed packages
- epm: add support for run script from stdin
* Mon May 23 2016 Vitaly Lipatov <lav@altlinux.ru> 1.8.3-alt1
* Mon May 23 2016 Vitaly Lipatov <lav@altlinux.ru> 1.8.3-alt1
- autoorphans: do real removing
- autoorphans: do real removing
- autoremove: add update-kernel version 0.9.9 checking
- autoremove: add update-kernel version 0.9.9 checking
...
...
pack_in_onefile.sh
View file @
ee51b229
...
@@ -41,7 +41,7 @@ get_version()
...
@@ -41,7 +41,7 @@ get_version()
filter_out
()
filter_out
()
{
{
grep
-v
"^
*load_helper "
|
sed
-e
's|DISTRVENDOR=$PROGDIR/distr_info|DISTRVENDOR=internal_distr_info|g'
|
\
grep
-v
"^
[ ]
*load_helper "
|
sed
-e
's|DISTRVENDOR=$PROGDIR/distr_info|DISTRVENDOR=internal_distr_info|g'
|
\
sed
-e
"s|@VERSION@|
$(
get_version
)
|g"
sed
-e
"s|@VERSION@|
$(
get_version
)
|g"
}
}
...
...
packed/epm.sh
View file @
ee51b229
...
@@ -19,6 +19,9 @@
...
@@ -19,6 +19,9 @@
PROGDIR
=
$(
dirname
$0
)
PROGDIR
=
$(
dirname
$0
)
[
"
$PROGDIR
"
=
"."
]
&&
PROGDIR
=
$(
pwd
)
[
"
$PROGDIR
"
=
"."
]
&&
PROGDIR
=
$(
pwd
)
if
[
"
$0
"
=
"/dev/stdin"
]
||
[
"
$0
"
=
"sh"
]
;
then
PROGDIR
=
""
fi
# will replaced to /usr/share/eepm during install
# will replaced to /usr/share/eepm during install
SHAREDIR
=
$PROGDIR
SHAREDIR
=
$PROGDIR
...
@@ -260,7 +263,12 @@ set_sudo()
...
@@ -260,7 +263,12 @@ set_sudo()
[
$EFFUID
=
"0"
]
&&
return
[
$EFFUID
=
"0"
]
&&
return
# use sudo if possible
# use sudo if possible
which
sudo
>
/dev/null 2>/dev/null
&&
SUDO
=
"sudo --"
&&
return
if
which
sudo
>
/dev/null 2>/dev/null
;
then
SUDO
=
"sudo --"
# check for < 1.7 version which do not support --
sudo
--help
|
grep
-q
" --"
||
SUDO
=
"sudo"
return
fi
SUDO
=
"fatal 'Can't find sudo. Please install sudo or run epm under root.'"
SUDO
=
"fatal 'Can't find sudo. Please install sudo or run epm under root.'"
}
}
...
@@ -328,7 +336,6 @@ regexp_subst()
...
@@ -328,7 +336,6 @@ regexp_subst()
assure_exists
()
assure_exists
()
{
{
load_helper epm-assure
local
package
=
"
$2
"
local
package
=
"
$2
"
local
textpackage
=
local
textpackage
=
[
-n
"
$package
"
]
||
package
=
"
$(
__get_package_for_command
"
$1
"
)
"
[
-n
"
$package
"
]
||
package
=
"
$(
__get_package_for_command
"
$1
"
)
"
...
@@ -381,6 +388,10 @@ get_package_type()
...
@@ -381,6 +388,10 @@ get_package_type()
get_help
()
get_help
()
{
{
if
[
"
$0
"
=
"/dev/stdin"
]
||
[
"
$0
"
=
"sh"
]
;
then
return
fi
grep
-v
--
"^#"
$0
|
grep
--
"#
$1
"
|
while
read
n
;
do
grep
-v
--
"^#"
$0
|
grep
--
"#
$1
"
|
while
read
n
;
do
opt
=
$(
echo
$n
|
sed
-e
"s|) #
$1
:.*||g"
)
opt
=
$(
echo
$n
|
sed
-e
"s|) #
$1
:.*||g"
)
desc
=
$(
echo
$n
|
sed
-e
"s|.*) #
$1
:||g"
)
desc
=
$(
echo
$n
|
sed
-e
"s|.*) #
$1
:||g"
)
...
@@ -662,9 +673,12 @@ case $PMTYPE in
...
@@ -662,9 +673,12 @@ case $PMTYPE in
apt-rpm
)
apt-rpm
)
# ALT Linux only
# ALT Linux only
assure_exists /etc/buildreqs/files/ignore.d/apt-scripts apt-scripts
assure_exists /etc/buildreqs/files/ignore.d/apt-scripts apt-scripts
__epm_orphan_altrpm
echo
"We will try remove all installed packages which are missed in repositories"
info
"TODO: this was just a list of orphans"
warning
"Use with caution!"
# | sudocmd epm remove
local
PKGLIST
=
$(
__epm_orphan_altrpm
\
|
sed
-e
"s/
\.
32bit//g"
\
|
grep
-v
--
"^kernel"
)
docmd epm remove
$PKGLIST
;;
;;
apt-dpkg|aptitude-dpkg
)
apt-dpkg|aptitude-dpkg
)
assure_exists deborphan
assure_exists deborphan
...
@@ -677,7 +691,7 @@ case $PMTYPE in
...
@@ -677,7 +691,7 @@ case $PMTYPE in
yum-rpm
)
yum-rpm
)
showcmd package-cleanup
--orphans
showcmd package-cleanup
--orphans
local
PKGLIST
=
$(
package-cleanup
--orphans
)
local
PKGLIST
=
$(
package-cleanup
--orphans
)
su
docmd epm remove
$PKGLIST
docmd epm remove
$PKGLIST
;;
;;
urpm-rpm
)
urpm-rpm
)
showcmd urpmq
--auto-orphans
showcmd urpmq
--auto-orphans
...
@@ -716,10 +730,10 @@ esac
...
@@ -716,10 +730,10 @@ esac
__epm_autoremove_altrpm
()
__epm_autoremove_altrpm
()
{
{
local
pkg
local
pkg
load_helper epm-packages
assure_exists /etc/buildreqs/files/ignore.d/apt-scripts apt-scripts
assure_exists /etc/buildreqs/files/ignore.d/apt-scripts apt-scripts
info
info
info
"Just removing all non -devel libs packages not need by anything..."
info
"Removing all non -devel/-debuginfo libs packages not need by anything..."
[
-n
"
$force
"
]
||
info
"You can run with --force for more deep removing"
local
flag
=
local
flag
=
local
libexclude
=
'^lib'
local
libexclude
=
'^lib'
...
@@ -727,12 +741,14 @@ __epm_autoremove_altrpm()
...
@@ -727,12 +741,14 @@ __epm_autoremove_altrpm()
# https://www.altlinux.org/APT_в_ALT_Linux/Советы_по_использованию#apt-cache_list-nodeps
# https://www.altlinux.org/APT_в_ALT_Linux/Советы_по_использованию#apt-cache_list-nodeps
showcmd
"apt-cache list-nodeps | grep --
\"
$libexclude
\"
"
showcmd
"apt-cache list-nodeps | grep --
\"
$libexclude
\"
"
pkgs
=
$(
apt-cache list-nodeps |
grep
--
"
$libexclude
"
|
\
pkgs
=
$(
apt-cache list-nodeps |
grep
--
"
$libexclude
"
\
grep
-v
--
"-devel$"
|
grep
-v
--
"-debuginfo$"
|
\
|
grep
-E
-v
--
"-(devel|debuginfo)$"
\
grep
-v
--
"-util"
|
grep
-v
--
"-tool"
|
grep
-v
--
"-plugin"
|
\
|
grep
-E
-v
--
"-(util|tool|plugin|daemon)"
\
grep
-v
--
^libreoffice |
grep
-v
--
libnss-
)
|
sed
-e
"s/
\.
32bit
$/
/g"
\
|
grep
-E
-v
--
"^(libsystemd|libreoffice|libnss)"
)
[
-n
"
$pkgs
"
]
&&
sudocmd rpm
-v
-e
$pkgs
&&
flag
=
1
[
-n
"
$pkgs
"
]
&&
sudocmd rpm
-v
-e
$pkgs
&&
flag
=
1
info
"Removing unused python/perl modules..."
libexclude
=
'^(python-module-|python3-module-|python-modules-|python3-modules|perl-)'
libexclude
=
'^(python-module-|python3-module-|python-modules-|python3-modules|perl-)'
[
-n
"
$force
"
]
||
libexclude
=
$libexclude
'[^-]*$'
[
-n
"
$force
"
]
||
libexclude
=
$libexclude
'[^-]*$'
showcmd
"apt-cache list-nodeps | grep -E --
\"
$libexclude
\"
"
showcmd
"apt-cache list-nodeps | grep -E --
\"
$libexclude
\"
"
...
@@ -740,7 +756,8 @@ __epm_autoremove_altrpm()
...
@@ -740,7 +756,8 @@ __epm_autoremove_altrpm()
[
-n
"
$pkgs
"
]
&&
sudocmd rpm
-v
-e
$pkgs
&&
flag
=
1
[
-n
"
$pkgs
"
]
&&
sudocmd rpm
-v
-e
$pkgs
&&
flag
=
1
if
[
-n
"
$flag
"
]
;
then
if
[
-n
"
$flag
"
]
;
then
info
"call again for next cycle until all libs will removed"
info
""
info
"call again for next cycle until all libs will be removed"
__epm_autoremove_altrpm
__epm_autoremove_altrpm
fi
fi
...
@@ -760,7 +777,7 @@ case $PMTYPE in
...
@@ -760,7 +777,7 @@ case $PMTYPE in
__epm_autoremove_altrpm
__epm_autoremove_altrpm
# ALT Linux only
# ALT Linux only
assure_exists remove-old-kernels
assure_exists remove-old-kernels
update-kernel 0.9.9
sudocmd remove-old-kernels
sudocmd remove-old-kernels
;;
;;
apt-dpkg|aptitude-dpkg
)
apt-dpkg|aptitude-dpkg
)
...
@@ -1404,8 +1421,10 @@ epm_download()
...
@@ -1404,8 +1421,10 @@ epm_download()
# File bin/epm-epm_install:
# File bin/epm-epm_install:
etersoft_updates_site
=
"http://updates.etersoft.ru/pub/Etersoft/Sisyphus/
$(
$DISTRVENDOR
-e
)
/"
myinit
(){
download_dir
=
"/tmp"
etersoft_updates_site
=
"http://updates.etersoft.ru/pub/Etersoft/Sisyphus/
$(
$DISTRVENDOR
-e
)
/"
download_dir
=
"/tmp"
}
download_epm
(){
download_epm
(){
download_link
=
$etersoft_updates_site
$(
wget
-qO-
$etersoft_updates_site
/ |
grep
-m1
-Eo
"eepm[^
\"
]+
\.
$(
$DISTRVENDOR
-p
)
"
|
tail
-n1
)
#"
download_link
=
$etersoft_updates_site
$(
wget
-qO-
$etersoft_updates_site
/ |
grep
-m1
-Eo
"eepm[^
\"
]+
\.
$(
$DISTRVENDOR
-p
)
"
|
tail
-n1
)
#"
...
@@ -1414,6 +1433,7 @@ download_epm(){
...
@@ -1414,6 +1433,7 @@ download_epm(){
}
}
epm_epm_install
(){
epm_epm_install
(){
myinit
download_epm
||
fatal
"Error. Check download link:
$download_link
"
download_epm
||
fatal
"Error. Check download link:
$download_link
"
epm i
$eepm_package
||
fatal
epm i
$eepm_package
||
fatal
rm
-fv
$eepm_package
rm
-fv
$eepm_package
...
@@ -1724,7 +1744,7 @@ epm_install_names()
...
@@ -1724,7 +1744,7 @@ epm_install_names()
[
-z
"
$1
"
]
&&
return
[
-z
"
$1
"
]
&&
return
case
$PMTYPE
in
case
$PMTYPE
in
apt-rpm|apt-dpkg
)
apt-rpm|apt-dpkg
)
sudocmd apt-get
$APTOPTIONS
install
$@
sudocmd apt-get
$APTOPTIONS
$noremove
install
$@
return
;;
return
;;
aptitude-dpkg
)
aptitude-dpkg
)
sudocmd aptitude
install
$@
sudocmd aptitude
install
$@
...
@@ -1810,7 +1830,7 @@ epm_ni_install_names()
...
@@ -1810,7 +1830,7 @@ epm_ni_install_names()
case
$PMTYPE
in
case
$PMTYPE
in
apt-rpm|apt-dpkg
)
apt-rpm|apt-dpkg
)
export
DEBIAN_FRONTEND
=
noninteractive
export
DEBIAN_FRONTEND
=
noninteractive
sudocmd apt-get
-y
--force-yes
-o
Dpkg::Options::
=
"--force-confdef"
-o
Dpkg::Options::
=
"--force-confold"
$APTOPTIONS
install
$@
sudocmd apt-get
-y
$noremove
--force-yes
-o
Dpkg::Options::
=
"--force-confdef"
-o
Dpkg::Options::
=
"--force-confold"
$APTOPTIONS
install
$@
return
;;
return
;;
aptitude-dpkg
)
aptitude-dpkg
)
sudocmd aptitde
-y
install
$@
sudocmd aptitde
-y
install
$@
...
@@ -1878,6 +1898,56 @@ __epm_check_if_rpm_already_installed()
...
@@ -1878,6 +1898,56 @@ __epm_check_if_rpm_already_installed()
LANG
=
C
$SUDO
rpm
-Uvh
$force
$nodeps
$@
2>&1 |
grep
-q
"is already installed"
LANG
=
C
$SUDO
rpm
-Uvh
$force
$nodeps
$@
2>&1 |
grep
-q
"is already installed"
}
}
__epm_check_if_try_install_deb
()
{
local
pkg
local
debpkgs
=
""
for
pkg
in
$@
;
do
[
"
$(
get_package_type
"
$pkg
"
)
"
=
"deb"
]
||
return
1
[
-e
"
$pkg
"
]
||
fatal
"Can't read
$pkg
"
debpkgs
=
"
$debpkgs
$(
realpath
$pkg
)
"
done
[
-n
"
$debpkgs
"
]
||
return
1
assure_exists alien
local
TDIR
=
$(
mktemp
-d
)
cd
$TDIR
for
pkg
in
$debpkgs
;
do
showcmd alien
-r
-k
--scripts
"
$pkg
"
# TODO: need check for return status
done
rm
-f
$TDIR
/
*
rmdir
$TDIR
/
return
0
}
__epm_check_if_try_install_rpm
()
{
local
pkg
local
rpmpkgs
=
""
for
pkg
in
$@
;
do
[
"
$(
get_package_type
"
$pkg
"
)
"
=
"rpm"
]
||
return
1
[
-e
"
$pkg
"
]
||
fatal
"Can't read
$pkg
"
rpmpkgs
=
"
$rpmpkgs
$(
realpath
$pkg
)
"
done
[
-n
"
$rpmpkgs
"
]
||
return
1
assure_exists alien
local
TDIR
=
$(
mktemp
-d
)
cd
$TDIR
for
pkg
in
$rpmpkgs
;
do
showcmd alien
-d
-k
--scripts
"
$pkg
"
# TODO: need check for return status
done
rm
-f
$TDIR
/
*
rmdir
$TDIR
/
return
0
}
epm_install_files
()
epm_install_files
()
{
{
...
@@ -1889,6 +1959,8 @@ epm_install_files()
...
@@ -1889,6 +1959,8 @@ epm_install_files()
case
$PMTYPE
in
case
$PMTYPE
in
apt-rpm
)
apt-rpm
)
__epm_check_if_try_install_deb
$@
&&
return
sudocmd rpm
-Uvh
$force
$nodeps
$@
&&
return
sudocmd rpm
-Uvh
$force
$nodeps
$@
&&
return
local
RES
=
$?
local
RES
=
$?
...
@@ -1899,11 +1971,15 @@ epm_install_files()
...
@@ -1899,11 +1971,15 @@ epm_install_files()
# use install_names
# use install_names
;;
;;
apt-dpkg|aptitude-dpkg
)
apt-dpkg|aptitude-dpkg
)
# the new version of the conf. file is installed with a .dpkg-dist suffix
# the new version of the conf. file is installed with a .dpkg-dist suffix
if
[
-n
"
$non_interactive
"
]
;
then
if
[
-n
"
$non_interactive
"
]
;
then
DPKGOPTIONS
=
"--force-confdef --force-confold"
DPKGOPTIONS
=
"--force-confdef --force-confold"
fi
fi
__epm_check_if_try_install_rpm
$@
&&
return
# FIXME: return false in case no install and in case install with broken deps
# FIXME: return false in case no install and in case install with broken deps
sudocmd dpkg
$DPKGOPTIONS
-i
$@
sudocmd dpkg
$DPKGOPTIONS
-i
$@
local
RES
=
$?
local
RES
=
$?
...
@@ -1918,7 +1994,10 @@ epm_install_files()
...
@@ -1918,7 +1994,10 @@ epm_install_files()
sudocmd dpkg
$DPKGOPTIONS
-i
$@
sudocmd dpkg
$DPKGOPTIONS
-i
$@
return
return
;;
;;
yum-rpm|dnf-rpm
)
yum-rpm|dnf-rpm
)
__epm_check_if_try_install_deb
$@
&&
return
sudocmd rpm
-Uvh
$force
$nodeps
$@
&&
return
sudocmd rpm
-Uvh
$force
$nodeps
$@
&&
return
# if run with --nodeps, do not fallback on hi level
# if run with --nodeps, do not fallback on hi level
...
@@ -1928,7 +2007,9 @@ epm_install_files()
...
@@ -1928,7 +2007,9 @@ epm_install_files()
YUMOPTIONS
=
--nogpgcheck
YUMOPTIONS
=
--nogpgcheck
# use install_names
# use install_names
;;
;;
zypper-rpm
)
zypper-rpm
)
__epm_check_if_try_install_deb
$@
&&
return
sudocmd rpm
-Uvh
$force
$nodeps
$@
&&
return
sudocmd rpm
-Uvh
$force
$nodeps
$@
&&
return
local
RES
=
$?
local
RES
=
$?
...
@@ -1940,7 +2021,9 @@ epm_install_files()
...
@@ -1940,7 +2021,9 @@ epm_install_files()
ZYPPEROPTIONS
=
$(
__use_zypper_no_gpg_checks
)
ZYPPEROPTIONS
=
$(
__use_zypper_no_gpg_checks
)
# use install_names
# use install_names
;;
;;
urpm-rpm
)
urpm-rpm
)
__epm_check_if_try_install_deb
$@
&&
return
sudocmd rpm
-Uvh
$force
$nodeps
$@
&&
return
sudocmd rpm
-Uvh
$force
$nodeps
$@
&&
return
local
RES
=
$?
local
RES
=
$?
...
@@ -2174,7 +2257,6 @@ epm_kernel_update()
...
@@ -2174,7 +2257,6 @@ epm_kernel_update()
case
$DISTRNAME
in
case
$DISTRNAME
in
ALTLinux
)
ALTLinux
)
load_helper epm-query_package
if
!
__epm_query_package kernel-image
>
/dev/null
;
then
if
!
__epm_query_package kernel-image
>
/dev/null
;
then
info
"No installed kernel packages, skipping update"
info
"No installed kernel packages, skipping update"
return
return
...
@@ -2400,7 +2482,9 @@ print_binpkgfilelist()
...
@@ -2400,7 +2482,9 @@ print_binpkgfilelist()
local
PKGNAME
=
$(
basename
$2
)
local
PKGNAME
=
$(
basename
$2
)
find
"
$PKGDIR
"
!
-name
'*\.src\.rpm'
-name
'*\.rpm'
-execdir
\
find
"
$PKGDIR
"
!
-name
'*\.src\.rpm'
-name
'*\.rpm'
-execdir
\
rpmquery
-p
--qf
=
'%{sourcerpm}\t%{name}-%{version}-%{release}.%{arch}.rpm\n'
"{}"
\;
\
rpmquery
-p
--qf
=
'%{sourcerpm}\t%{name}-%{version}-%{release}.%{arch}.rpm\n'
"{}"
\;
\
|
grep
"^
$PKGNAME
[[:space:]].*"
|
cut
-f2
| xargs
-n1
-I
"{}"
echo
-n
"
$PKGDIR
/{} "
|
grep
"^
$PKGNAME
[[:space:]].*"
\
|
cut
-f2
\
| xargs
-n1
-I
"{}"
echo
-n
"
$PKGDIR
/{} "
}
}
PKGNAMEMASK
=
"
\(
.*
\)
-
\(
[0-9].*
\)
-
\(
.*[0-9].*
\)
"
PKGNAMEMASK
=
"
\(
.*
\)
-
\(
[0-9].*
\)
-
\(
.*[0-9].*
\)
"
...
@@ -2813,6 +2897,15 @@ __epm_query_file()
...
@@ -2813,6 +2897,15 @@ __epm_query_file()
docmd
$CMD
$@
docmd
$CMD
$@
}
}
__epm_query_dpkg_check
()
{
local
i
for
i
in
$@
;
do
a
=
dpkg
-s
$i
>
/dev/null 2>/dev/null
||
return
done
return
0
}
__epm_query_name
()
__epm_query_name
()
{
{
local
CMD
local
CMD
...
@@ -2825,7 +2918,10 @@ __epm_query_name()
...
@@ -2825,7 +2918,10 @@ __epm_query_name()
;;
;;
*
-dpkg
)
*
-dpkg
)
#docmd dpkg -l $@ | grep "^ii"
#docmd dpkg -l $@ | grep "^ii"
CMD
=
"dpkg-query -W --showformat=
\$
{Package}-
\$
{Version}
\n
"
#CMD="dpkg-query -W --showformat=\${Package}-\${Version}\n"
docmd dpkg-query
-W
"--showformat=
\$
{Package}-
\$
{Version}
\n
"
$@
||
return
__epm_query_dpkg_check
$@
||
return
return
;;
;;
npackd
)
npackd
)
docmd
"npackdcl path --package=
$@
"
docmd
"npackdcl path --package=
$@
"
...
@@ -2864,7 +2960,10 @@ __epm_query_shortname()
...
@@ -2864,7 +2960,10 @@ __epm_query_shortname()
CMD
=
"rpm -q --queryformat %{name}
\n
"
CMD
=
"rpm -q --queryformat %{name}
\n
"
;;
;;
*
-dpkg
)
*
-dpkg
)
CMD
=
"dpkg-query -W --showformat=
\$
{Package}
\n
"
#CMD="dpkg-query -W --showformat=\${Package}\n"
docmd dpkg-query
-W
"--showformat=
\$
{Package}
\n
"
$@
||
return
__epm_query_dpkg_check
$@
||
return
return
;;
;;
npackd
)
npackd
)
docmd
"npackdcl path --package=
$@
"
docmd
"npackdcl path --package=
$@
"
...
@@ -2894,7 +2993,7 @@ __epm_query_shortname()
...
@@ -2894,7 +2993,7 @@ __epm_query_shortname()
is_installed
()
is_installed
()
{
{
short
=
1
pkg_filenames
=
"
$@
"
pkg_names
=
"
$@
"
epm_query
>
/dev/null 2>/dev/null
__epm_query_shortname
$pkg_names
>
/dev/null 2>/dev/null
# broken way to recursive call here (overhead!)
# broken way to recursive call here (overhead!)
#epm installed $@ >/dev/null 2>/dev/null
#epm installed $@ >/dev/null 2>/dev/null
}
}
...
@@ -3174,15 +3273,21 @@ __wcount()
...
@@ -3174,15 +3273,21 @@ __wcount()
__detect_alt_release_by_repo
()
__detect_alt_release_by_repo
()
{
{
local
BRD
=
$(
cat
/etc/apt/sources.list /etc/apt/sources.list.d/
*
.list |
\
local
BRD
=
$(
cat
/etc/apt/sources.list /etc/apt/sources.list.d/
*
.list
\
grep
-v
"^#"
|
grep
"p[5-9]/branch/"
|
sed
-e
"s|.*
\(
p[5-9]
\)
/branch.*|
\1
|g"
|
sort
-u
)
|
grep
-v
"^#"
\
|
grep
"p[5-9]/branch/"
\
|
sed
-e
"s|.*
\(
p[5-9]
\)
/branch.*|
\1
|g"
\
|
sort
-u
)
if
[
$(
__wcount
$BRD
)
=
"1"
]
;
then
if
[
$(
__wcount
$BRD
)
=
"1"
]
;
then
echo
"
$BRD
"
echo
"
$BRD
"
return
return
fi
fi
local
BRD
=
$(
cat
/etc/apt/sources.list /etc/apt/sources.list.d/
*
.list |
\
local
BRD
=
$(
cat
/etc/apt/sources.list /etc/apt/sources.list.d/
*
.list
\
grep
-v
"^#"
|
grep
"Sisyphus/"
|
sed
-e
"s|.*
\(
Sisyphus
\)
.*|
\1
|g"
|
sort
-u
)
|
grep
-v
"^#"
\
|
grep
"Sisyphus/"
\
|
sed
-e
"s|.*
\(
Sisyphus
\)
.*|
\1
|g"
\
|
sort
-u
)
if
[
$(
__wcount
$BRD
)
=
"1"
]
;
then
if
[
$(
__wcount
$BRD
)
=
"1"
]
;
then
echo
"
$BRD
"
echo
"
$BRD
"
return
return
...
@@ -3197,14 +3302,16 @@ __replace_alt_version_in_repo()
...
@@ -3197,14 +3302,16 @@ __replace_alt_version_in_repo()
assure_exists apt-repo
assure_exists apt-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
if
apt-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
docmd apt-repo list
docmd apt-repo list
}
}
__alt_repofix
()
__alt_repofix
()
{
{
load_helper epm-repofix
showcmd epm repofix
showcmd epm repofix
quiet
=
1
pkg_filenames
=
epm_repofix
>
/dev/null
quiet
=
1
pkg_filenames
=
epm_repofix
>
/dev/null
__replace_text_in_alt_repo
"/^ *#/! s!
\[
p[6-9]
\]
![updates]!g"
__replace_text_in_alt_repo
"/^ *#/! s!
\[
p[6-9]
\]
![updates]!g"
...
@@ -3299,6 +3406,7 @@ __update_alt_to_next_distro()
...
@@ -3299,6 +3406,7 @@ __update_alt_to_next_distro()
*
)
*
)
warning
"Have no idea how to update from
$DISTRNAME
$DISTRVERSION
."
warning
"Have no idea how to update from
$DISTRNAME
$DISTRVERSION
."
info
"Try run f.i. # epm release-upgrade p8 or # epm release-upgrade Sisyphus"
info
"Try run f.i. # epm release-upgrade p8 or # epm release-upgrade Sisyphus"
info
"Also possible you need install altlinux-release-p? package for correct distro version detecting"
return
1
return
1
esac
esac
}
}
...
@@ -3650,6 +3758,16 @@ esac
...
@@ -3650,6 +3758,16 @@ esac
# File bin/epm-repofix:
# File bin/epm-repofix:
__repofix_check_vendor
()
{
local
i
for
i
in
/etc/apt/vendors.list.d/
*
.list
;
do
[
-e
"
$i
"
]
||
continue
grep
-q
"^simple-key
\"
$1
\"
"
$i
&&
return
done
return
1
}
__fix_apt_sources_list
()
__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
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'
...
@@ -3662,15 +3780,34 @@ __fix_apt_sources_list()
...
@@ -3662,15 +3780,34 @@ __fix_apt_sources_list()
#sed -i -r -e "$SUBST_ALT_RULE" $i
#sed -i -r -e "$SUBST_ALT_RULE" $i
regexp_subst
"/^ *#/!
$SUBST_ALT_RULE
"
$i
regexp_subst
"/^ *#/!
$SUBST_ALT_RULE
"
$i
# add signs
# Sisyphus uses 'alt' vendor key
if
__repofix_check_vendor alt
;
then
regexp_subst
"/ALTLinux
\/
Sisyphus
\/
/s/^rpm *([fhr])/rpm [alt]
\1
/"
$i
else
warning
"Skip set alt vendor key (it misssed)"
fi
# skip branch replacement for ALT Linux Sisyphus
[
"
$DISTRVERSION
"
=
"Sisyphus"
]
&&
continue
# add signs for branches
local
br
local
br
for
br
in
$DISTRVERSION
;
do
for
br
in
$DISTRVERSION
;
do
if
!
__repofix_check_vendor
$br
;
then
warning
"Skip set
$br
vendor key (it misssed)"
continue
fi
regexp_subst
"/ALTLinux
\/
$br
\/
branch/s/^rpm *([fhr])/rpm [
$br
]
\1
/"
$i
regexp_subst
"/ALTLinux
\/
$br
\/
branch/s/^rpm *([fhr])/rpm [
$br
]
\1
/"
$i
if
is_installed apt-conf-etersoft-common
;
then
done
regexp_subst
"/Etersoft
\/
$br
\/
branch/s/^rpm *([fhr])/rpm [etersoft]
\1
/"
$i
for
br
in
$DISTRVERSION
;
do
#if is_installed apt-conf-etersoft-common ; then
if
!
__repofix_check_vendor etersoft
;
then
warning
"Skip set etersoft vendor key (it misssed)"
continue
fi
fi
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
done
done
}
}
...
@@ -4973,7 +5110,7 @@ $(get_help HELPOPT)
...
@@ -4973,7 +5110,7 @@ $(get_help HELPOPT)
print_version
()
print_version
()
{
{
echo
"EPM package manager version 1.8.
2
"
echo
"EPM package manager version 1.8.
4
"
echo
"Running on
$(
$DISTRVENDOR
)
('
$PMTYPE
' package manager uses '
$PKGFORMAT
' package format)"
echo
"Running on
$(
$DISTRVENDOR
)
('
$PMTYPE
' package manager uses '
$PKGFORMAT
' package format)"
echo
"Copyright (c) Etersoft 2012-2016"
echo
"Copyright (c) Etersoft 2012-2016"
echo
"This program may be freely redistributed under the terms of the GNU AGPLv3."
echo
"This program may be freely redistributed under the terms of the GNU AGPLv3."
...
@@ -5279,8 +5416,8 @@ for opt in "$@" ; do
...
@@ -5279,8 +5416,8 @@ for opt in "$@" ; do
check_filenames
$opt
check_filenames
$opt
done
done
# if input is not console
, get pkg from it
too
# if input is not console
and run script from file, get pkgs from stdin
too
if
!
inputisatty
;
then
if
!
inputisatty
&&
[
-n
"
$PROGDIR
"
]
;
then
for
opt
in
$(
withtimeout 1
cat
)
;
do
for
opt
in
$(
withtimeout 1
cat
)
;
do
check_filenames
$opt
check_filenames
$opt
done
done
...
...
packed/serv.sh
View file @
ee51b229
...
@@ -258,7 +258,12 @@ set_sudo()
...
@@ -258,7 +258,12 @@ set_sudo()
[
$EFFUID
=
"0"
]
&&
return
[
$EFFUID
=
"0"
]
&&
return
# use sudo if possible
# use sudo if possible
which
sudo
>
/dev/null 2>/dev/null
&&
SUDO
=
"sudo --"
&&
return
if
which
sudo
>
/dev/null 2>/dev/null
;
then
SUDO
=
"sudo --"
# check for < 1.7 version which do not support --
sudo
--help
|
grep
-q
" --"
||
SUDO
=
"sudo"
return
fi
SUDO
=
"fatal 'Can't find sudo. Please install sudo or run epm under root.'"
SUDO
=
"fatal 'Can't find sudo. Please install sudo or run epm under root.'"
}
}
...
@@ -326,7 +331,6 @@ regexp_subst()
...
@@ -326,7 +331,6 @@ regexp_subst()
assure_exists
()
assure_exists
()
{
{
load_helper epm-assure
local
package
=
"
$2
"
local
package
=
"
$2
"
local
textpackage
=
local
textpackage
=
[
-n
"
$package
"
]
||
package
=
"
$(
__get_package_for_command
"
$1
"
)
"
[
-n
"
$package
"
]
||
package
=
"
$(
__get_package_for_command
"
$1
"
)
"
...
@@ -379,6 +383,10 @@ get_package_type()
...
@@ -379,6 +383,10 @@ get_package_type()
get_help
()
get_help
()
{
{
if
[
"
$0
"
=
"/dev/stdin"
]
||
[
"
$0
"
=
"sh"
]
;
then
return
fi
grep
-v
--
"^#"
$0
|
grep
--
"#
$1
"
|
while
read
n
;
do
grep
-v
--
"^#"
$0
|
grep
--
"#
$1
"
|
while
read
n
;
do
opt
=
$(
echo
$n
|
sed
-e
"s|) #
$1
:.*||g"
)
opt
=
$(
echo
$n
|
sed
-e
"s|) #
$1
:.*||g"
)
desc
=
$(
echo
$n
|
sed
-e
"s|.*) #
$1
:||g"
)
desc
=
$(
echo
$n
|
sed
-e
"s|.*) #
$1
:||g"
)
...
@@ -578,8 +586,6 @@ serv_list()
...
@@ -578,8 +586,6 @@ serv_list()
sudocmd systemctl list-units
$@
sudocmd systemctl list-units
$@
;;
;;
*
)
*
)
load_helper serv-list_all
load_helper serv-status
for
i
in
$(
serv_list_all
)
;
do
for
i
in
$(
serv_list_all
)
;
do
is_service_running
$i
>
/dev/null
&&
echo
$i
is_service_running
$i
>
/dev/null
&&
echo
$i
done
done
...
@@ -614,8 +620,6 @@ serv_list_startup()
...
@@ -614,8 +620,6 @@ serv_list_startup()
{
{
case
$SERVICETYPE
in
case
$SERVICETYPE
in
*
)
*
)
load_helper serv-list_all
load_helper serv-status
for
i
in
$(
serv_list_all |
cut
-f
1
-d
" "
|
grep
"
\.
service$"
)
;
do
for
i
in
$(
serv_list_all |
cut
-f
1
-d
" "
|
grep
"
\.
service$"
)
;
do
is_service_autostart
>
/dev/null
$i
&&
echo
$i
is_service_autostart
>
/dev/null
$i
&&
echo
$i
done
done
...
@@ -1237,7 +1241,7 @@ $(get_help HELPOPT)
...
@@ -1237,7 +1241,7 @@ $(get_help HELPOPT)
print_version
()
print_version
()
{
{
echo
"Service manager version 1.8.
2
"
echo
"Service manager version 1.8.
4
"
echo
"Running on
$(
$DISTRVENDOR
)
"
echo
"Running on
$(
$DISTRVENDOR
)
"
echo
"Copyright (c) Etersoft 2012, 2013, 2016"
echo
"Copyright (c) Etersoft 2012, 2013, 2016"
echo
"This program may be freely redistributed under the terms of the GNU AGPLv3."
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