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
ffeedebb
Commit
ffeedebb
authored
Jul 15, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit packed 3.58.0
parent
27425fff
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
150 additions
and
52 deletions
+150
-52
epm.sh
packed/epm.sh
+119
-33
serv.sh
packed/serv.sh
+31
-19
No files found.
packed/epm.sh
View file @
ffeedebb
...
@@ -33,7 +33,7 @@ SHAREDIR=$PROGDIR
...
@@ -33,7 +33,7 @@ SHAREDIR=$PROGDIR
# will replaced with /etc/eepm during install
# will replaced with /etc/eepm during install
CONFIGDIR
=
$PROGDIR
/../etc
CONFIGDIR
=
$PROGDIR
/../etc
EPMVERSION
=
"3.5
7.14
"
EPMVERSION
=
"3.5
8.0
"
# package, single (file), pipe, git
# package, single (file), pipe, git
EPMMODE
=
"package"
EPMMODE
=
"package"
...
@@ -1600,7 +1600,7 @@ case $BASEDISTRNAME in
...
@@ -1600,7 +1600,7 @@ case $BASEDISTRNAME in
fi
fi
# TODO: implement for other PMTYPE
# TODO: implement for other PMTYPE
local
hold_packages
=
"
$(
epm mark showhold
)
"
local
hold_packages
=
"
$(
epm mark
--short
showhold
)
"
if
[
-n
"
$hold_packages
"
]
;
then
if
[
-n
"
$hold_packages
"
]
;
then
echo
"Skip follow packages on hold:
$(
echo
$hold_packages
| xargs
-n1000
echo
)
"
echo
"Skip follow packages on hold:
$(
echo
$hold_packages
| xargs
-n1000
echo
)
"
PKGLIST
=
"
$(
estrlist exclude
"
$hold_packages
"
"
$PKGLIST
"
)
"
PKGLIST
=
"
$(
estrlist exclude
"
$hold_packages
"
"
$PKGLIST
"
)
"
...
@@ -2896,6 +2896,9 @@ __use_url_install()
...
@@ -2896,6 +2896,9 @@ __use_url_install()
# force download if wildcard is used
# force download if wildcard is used
echo
"
$pkg_urls
"
|
grep
-q
"[?*]"
&&
return
1
echo
"
$pkg_urls
"
|
grep
-q
"[?*]"
&&
return
1
# force download if repack is asked
[
-n
"
$repack
"
]
&&
return
1
# install of remote files has a side affect
# install of remote files has a side affect
# (more fresh package from a repo can be installed instead of the file)
# (more fresh package from a repo can be installed instead of the file)
#case $DISTRNAME in
#case $DISTRNAME in
...
@@ -2918,10 +2921,10 @@ __use_url_install()
...
@@ -2918,10 +2921,10 @@ __use_url_install()
# pkg_names="$pkg_names $pkg_urls"
# pkg_names="$pkg_names $pkg_urls"
# ;;
# ;;
pacman
)
pacman
)
pkg_names
=
"
$pkg_names
$pkg_urls
"
true
;;
;;
yum-rpm|dnf-rpm
)
yum-rpm|dnf-rpm
)
pkg_names
=
"
$pkg_names
$pkg_urls
"
true
;;
;;
#zypper-rpm)
#zypper-rpm)
# pkg_names="$pkg_names $pkg_urls"
# pkg_names="$pkg_names $pkg_urls"
...
@@ -2930,6 +2933,7 @@ __use_url_install()
...
@@ -2930,6 +2933,7 @@ __use_url_install()
return
1
return
1
;;
;;
esac
esac
[
-n
"
$pkg_names
"
]
&&
pkg_names
=
"
$pkg_names
$pkg_urls
"
||
pkg_names
=
"
$pkg_urls
"
return
0
return
0
}
}
...
@@ -5204,6 +5208,11 @@ __dnf_assure_versionlock()
...
@@ -5204,6 +5208,11 @@ __dnf_assure_versionlock()
epm assure /etc/dnf/plugins/versionlock.conf
'dnf-command(versionlock)'
epm assure /etc/dnf/plugins/versionlock.conf
'dnf-command(versionlock)'
}
}
__dnf_is_supported_versionlock
()
{
[
-f
/etc/dnf/plugins/versionlock.conf
]
}
epm_mark_hold
()
epm_mark_hold
()
{
{
...
@@ -5286,14 +5295,20 @@ esac
...
@@ -5286,14 +5295,20 @@ esac
case
$PMTYPE
in
case
$PMTYPE
in
apt-dpkg
)
apt-dpkg
)
su
docmd apt-mark showhold
"
$@
"
docmd apt-mark showhold
"
$@
"
;;
;;
dnf-rpm
)
dnf-rpm
)
# there is no hold entries without versionlock
__dnf_is_supported_versionlock
||
return
0
__dnf_assure_versionlock
__dnf_assure_versionlock
sudocmd dnf versionlock list
if
[
-n
"
$short
"
]
;
then
docmd dnf versionlock list
"
$@
"
|
sed
-e
's|\.\*$||'
|
grep
-v
" "
| filter_pkgnames_to_short
else
docmd dnf versionlock list
"
$@
"
fi
;;
;;
zypper-rpm
)
zypper-rpm
)
su
docmd zypper ll
"
$@
"
docmd zypper ll
"
$@
"
;;
;;
emerge
)
emerge
)
cat
/etc/portage/package.mask
cat
/etc/portage/package.mask
...
@@ -5308,6 +5323,22 @@ esac
...
@@ -5308,6 +5323,22 @@ esac
}
}
epm_mark_checkhold
()
{
case
$PMTYPE
in
dnf-rpm
)
# there is no hold entries without versionlock
__dnf_is_supported_versionlock
||
return
1
__dnf_assure_versionlock
docmd dnf versionlock list |
grep
"^
$1
"
|
sed
-e
's|\.\*$||'
|
grep
-v
" "
| filter_pkgnames_to_short |
grep
-q
"^
$1
$"
return
;;
esac
epm_mark_showhold |
grep
-q
"^
$1
$"
}
epm_mark_auto
()
epm_mark_auto
()
{
{
...
@@ -5447,6 +5478,9 @@ epm_mark()
...
@@ -5447,6 +5478,9 @@ epm_mark()
showhold
)
# HELPCMD: print the list of packages on hold
showhold
)
# HELPCMD: print the list of packages on hold
epm_mark_showhold
"
$@
"
epm_mark_showhold
"
$@
"
;;
;;
checkhold
)
# HELPCMD: return true if the package is on hold
epm_mark_checkhold
"
$@
"
;;
auto
)
# HELPCMD: mark the given package(s) as automatically installed
auto
)
# HELPCMD: mark the given package(s) as automatically installed
epm_mark_auto
"
$@
"
epm_mark_auto
"
$@
"
;;
;;
...
@@ -6643,8 +6677,12 @@ compare_version()
...
@@ -6643,8 +6677,12 @@ compare_version()
{
{
case
$PMTYPE
in
case
$PMTYPE
in
*
-rpm
)
*
-rpm
)
is_command rpmevrcmp
||
fatal
"rpmevrcmp exists in ALT Linux only"
# rpmevrcmp exists in ALT Linux only
if
is_command rpmevrcmp
;
then
a
=
rpmevrcmp
"
$@
"
a
=
rpmevrcmp
"
$@
"
else
a
=
rpm
--eval
"%{lua:print(rpm.vercmp('
$1
', '
$2
'))}"
fi
;;
;;
*
-dpkg
)
*
-dpkg
)
a
=
dpkg
--compare-versions
"
$1
"
lt
"
$2
"
&&
echo
"-1"
&&
return
a
=
dpkg
--compare-versions
"
$1
"
lt
"
$2
"
&&
echo
"-1"
&&
return
...
@@ -6872,7 +6910,11 @@ epm_provides_files()
...
@@ -6872,7 +6910,11 @@ epm_provides_files()
case
$PKGTYPE
in
case
$PKGTYPE
in
rpm
)
rpm
)
assure_exists rpm
assure_exists rpm
if
[
-n
"
$short
"
]
;
then
docmd rpm
-q
--provides
-p
$pkg_files
|
sed
-e
's| .*||'
else
docmd rpm
-q
--provides
-p
$pkg_files
docmd rpm
-q
--provides
-p
$pkg_files
fi
;;
;;
deb
)
deb
)
assure_exists dpkg
assure_exists dpkg
...
@@ -6900,7 +6942,11 @@ case $PMTYPE in
...
@@ -6900,7 +6942,11 @@ case $PMTYPE in
CMD
=
"rpm -q --provides"
CMD
=
"rpm -q --provides"
else
else
EXTRA_SHOWDOCMD
=
' | grep "Provides:"'
EXTRA_SHOWDOCMD
=
' | grep "Provides:"'
docmd apt-cache show
$pkg_names
|
grep
"Provides:"
if
[
-n
"
$short
"
]
;
then
docmd apt-cache show
$pkg_names
|
grep
"Provides:"
|
sed
-e
's|, |\n|g'
-e
's|Provides: ||'
-e
's| .*||'
else
docmd apt-cache show
$pkg_names
|
grep
"Provides:"
|
sed
-e
's|, |\n|g'
-e
's|Provides: ||'
fi
return
return
fi
fi
;;
;;
...
@@ -6956,7 +7002,15 @@ case $PMTYPE in
...
@@ -6956,7 +7002,15 @@ case $PMTYPE in
;;
;;
esac
esac
docmd
$CMD
$pkg_names
if
[
-n
"
$direct
"
]
&&
[
"
$CMD
"
=
"rpm -q --provides"
]
;
then
# do universal provides
docmd
$CMD
$pkg_names
|
sed
-e
's| .*||'
|
grep
-F
"()"
a
=
$CMD
$pkg_names
|
sed
-e
's| .*||'
|
grep
-v
-E
"^(lib|ld-linux)"
elif
[
-n
"
$short
"
]
;
then
docmd
$CMD
$pkg_names
|
sed
-e
's| .*||'
else
docmd
$CMD
$pkg_names
fi
}
}
...
@@ -7283,6 +7337,11 @@ is_installed()
...
@@ -7283,6 +7337,11 @@ is_installed()
(
quiet
=
1 __epm_query_name
"
$@
"
)
>
/dev/null 2>/dev/null
(
quiet
=
1 __epm_query_name
"
$@
"
)
>
/dev/null 2>/dev/null
}
}
filter_pkgnames_to_short
()
{
local
names
=
"
$(
cat
)
"
__epm_query_shortname
$names
}
epm_query
()
epm_query
()
{
{
...
@@ -7752,7 +7811,7 @@ assure_safe_run()
...
@@ -7752,7 +7811,7 @@ assure_safe_run()
# run under screen, check if systemd will not kill our processes
# run under screen, check if systemd will not kill our processes
local
res
local
res
if
!
is_active_systemd
systemd
;
then
if
!
is_active_systemd
;
then
return
return
fi
fi
...
@@ -7891,7 +7950,7 @@ __check_system()
...
@@ -7891,7 +7950,7 @@ __check_system()
shift
shift
# sure we have systemd if systemd is running
# sure we have systemd if systemd is running
if
is_active_systemd
systemd
;
then
if
is_active_systemd
;
then
docmd epm
--skip-installed
install
systemd
||
fatal
docmd epm
--skip-installed
install
systemd
||
fatal
fi
fi
...
@@ -7905,7 +7964,7 @@ __check_system()
...
@@ -7905,7 +7964,7 @@ __check_system()
fi
fi
# switch from prefdm: https://bugzilla.altlinux.org/show_bug.cgi?id=26405#c47
# switch from prefdm: https://bugzilla.altlinux.org/show_bug.cgi?id=26405#c47
if
is_active_systemd
systemd
;
then
if
is_active_systemd
;
then
if
serv display-manager exists
||
serv prefdm exists
;
then
if
serv display-manager exists
||
serv prefdm exists
;
then
# don't stop running X server!
# don't stop running X server!
# docmd serv dm off
# docmd serv dm off
...
@@ -9143,6 +9202,11 @@ __fix_spec()
...
@@ -9143,6 +9202,11 @@ __fix_spec()
}
}
has_repack_script
()
{
local
repackcode
=
"
$EPM_REPACK_SCRIPTS_DIR
/
$1
.sh"
[
-s
"
$repackcode
"
]
}
__apply_fix_code
()
__apply_fix_code
()
{
{
...
@@ -9230,6 +9294,9 @@ __epm_repack_to_rpm()
...
@@ -9230,6 +9294,9 @@ __epm_repack_to_rpm()
a
=
''
alien
--generate
--to-rpm
$scripts
"../
$alpkg
"
>
/dev/null
||
fatal
a
=
''
alien
--generate
--to-rpm
$scripts
"../
$alpkg
"
>
/dev/null
||
fatal
fi
fi
# remove all empty dirs (hack against broken dpkg with LF in the end of line) (hack for linux_pantum.deb)
rmdir
*
2>/dev/null
local
subdir
=
"
$(
echo
*)
"
local
subdir
=
"
$(
echo
*)
"
[
-d
"
$subdir
"
]
||
fatal
"can't find subdir in
$(
pwd
)
"
[
-d
"
$subdir
"
]
||
fatal
"can't find subdir in
$(
pwd
)
"
...
@@ -9253,6 +9320,9 @@ __epm_repack_to_rpm()
...
@@ -9253,6 +9320,9 @@ __epm_repack_to_rpm()
__apply_fix_code
"generic"
$buildroot
$spec
$pkgname
$abspkg
__apply_fix_code
"generic"
$buildroot
$spec
$pkgname
$abspkg
__apply_fix_code
"generic-
$SUBGENERIC
"
$buildroot
$spec
$pkgname
$abspkg
__apply_fix_code
"generic-
$SUBGENERIC
"
$buildroot
$spec
$pkgname
$abspkg
__apply_fix_code
$pkgname
$buildroot
$spec
$pkgname
$abspkg
__apply_fix_code
$pkgname
$buildroot
$spec
$pkgname
$abspkg
if
!
has_repack_script
$pkgname
;
then
__apply_fix_code
"generic-default"
$buildroot
$spec
$pkgname
$abspkg
fi
cd
-
>
/dev/null
cd
-
>
/dev/null
TARGETARCH
=
$(
epm print info
-a
|
sed
-e
's|^x86$|i586|'
)
TARGETARCH
=
$(
epm print info
-a
|
sed
-e
's|^x86$|i586|'
)
...
@@ -10157,7 +10227,11 @@ case $PMTYPE in
...
@@ -10157,7 +10227,11 @@ case $PMTYPE in
docmd eoget list-repo
docmd eoget list-repo
;;
;;
pacman
)
pacman
)
if
[
-f
/etc/pacman.d/mirrorlist
]
;
then
docmd
grep
-v
--
"^#
\|
^$"
/etc/pacman.d/mirrorlist |
grep
"^Server ="
|
sed
-e
's|^Server = ||'
else
docmd
grep
-v
--
"^#
\|
^$"
/etc/pacman.conf
docmd
grep
-v
--
"^#
\|
^$"
/etc/pacman.conf
fi
;;
;;
slackpkg
)
slackpkg
)
docmd
grep
-v
--
"^#
\|
^$"
/etc/slackpkg/mirrors
docmd
grep
-v
--
"^#
\|
^$"
/etc/slackpkg/mirrors
...
@@ -10496,9 +10570,9 @@ case $PMTYPE in
...
@@ -10496,9 +10570,9 @@ case $PMTYPE in
CMD
=
"apt-cache depends"
CMD
=
"apt-cache depends"
else
else
if
[
-n
"
$short
"
]
;
then
if
[
-n
"
$short
"
]
;
then
LANG
=
C docmd apt-cache depends
$pkg_names
|
grep
"Depends:"
|
sed
-e
"s|.*Depends: ||"
-e
"s|<
\(
.*
\)
>|
\1
|"
| __epm_filter_out_base_alt_reqs |
sed
-e
"s| .*||"
LANG
=
C docmd apt-cache depends
$pkg_names
|
grep
"Depends:"
|
sed
-e
's|, |\n|g'
-e
"s|.*Depends: ||"
-e
"s|<
\(
.*
\)
>|
\1
|"
| __epm_filter_out_base_alt_reqs |
sed
-e
"s| .*||"
else
else
LANG
=
C docmd apt-cache depends
$pkg_names
|
grep
"Depends:"
|
sed
-e
"s|.*Depends: ||"
-e
"s|<
\(
.*
\)
>|
\1
|"
| __epm_filter_out_base_alt_reqs
LANG
=
C docmd apt-cache depends
$pkg_names
|
grep
"Depends:"
|
sed
-e
's|, |\n|g'
-e
"s|.*Depends: ||"
-e
"s|<
\(
.*
\)
>|
\1
|"
| __epm_filter_out_base_alt_reqs
fi
fi
return
return
fi
fi
...
@@ -13012,20 +13086,25 @@ pkgvendor()
...
@@ -13012,20 +13086,25 @@ pkgvendor()
# TODO: in more appropriate way
# TODO: in more appropriate way
#which pkcon 2>/dev/null >/dev/null && info "You can run $ PMTYPE=packagekit epm to use packagekit backend"
#which pkcon 2>/dev/null >/dev/null && info "You can run $ PMTYPE=packagekit epm to use packagekit backend"
# Print package manager (need DISTRIB_ID
var
)
# Print package manager (need DISTRIB_ID
, DISTRIB_RELEASE vars
)
pkgmanager
()
pkgmanager
()
{
{
local
CMD
local
CMD
# FIXME: some problems with multibased distros (Server Edition on CentOS and Desktop Edition on Ubuntu)
case
$DISTRIB_ID
in
case
$VENDOR_ID
in
ALTLinux|ALTServer
)
alt
)
#which ds-install 2>/dev/null >/dev/null && CMD=deepsolver-rpm
echo
"apt-rpm"
&&
return
#which pkcon 2>/dev/null >/dev/null && CMD=packagekit-rpm
CMD
=
"apt-rpm"
;;
;;
ALTServer
)
arch
|
manjaro
)
CMD
=
"apt-rpm"
echo
"pacman"
&&
return
;;
debian
)
echo
"apt-dpkg"
&&
return
;;
;;
esac
# FIXME: some problems with multibased distros (Server Edition on CentOS and Desktop Edition on Ubuntu)
case
$DISTRIB_ID
in
PCLinux
)
PCLinux
)
CMD
=
"apt-rpm"
CMD
=
"apt-rpm"
;;
;;
...
@@ -13106,11 +13185,6 @@ case $DISTRIB_ID in
...
@@ -13106,11 +13185,6 @@ case $DISTRIB_ID in
CMD
=
"xbps"
CMD
=
"xbps"
;;
;;
*
)
*
)
# try detect firstly
if
grep
-q
"ID_LIKE=debian"
/etc/os-release 2>/dev/null
;
then
echo
"apt-dpkg"
&&
return
fi
if
is_command
"rpm"
&&
[
-s
/var/lib/rpm/Name
]
||
[
-s
/var/lib/rpm/rpmdb.sqlite
]
;
then
if
is_command
"rpm"
&&
[
-s
/var/lib/rpm/Name
]
||
[
-s
/var/lib/rpm/rpmdb.sqlite
]
;
then
is_command
"zypper"
&&
echo
"zypper-rpm"
&&
return
is_command
"zypper"
&&
echo
"zypper-rpm"
&&
return
is_command
"dnf"
&&
echo
"dnf-rpm"
&&
return
is_command
"dnf"
&&
echo
"dnf-rpm"
&&
return
...
@@ -13124,7 +13198,7 @@ case $DISTRIB_ID in
...
@@ -13124,7 +13198,7 @@ case $DISTRIB_ID in
is_command
"apt-get"
&&
echo
"apt-dpkg"
&&
return
is_command
"apt-get"
&&
echo
"apt-dpkg"
&&
return
fi
fi
echo
"pkgmanager(): We don't support yet DISTRIB_ID
$DISTRIB_ID
"
>
&2
echo
"pkgmanager(): We don't support yet DISTRIB_ID
$DISTRIB_ID
(VENDOR_ID
$VENDOR_ID
)
"
>
&2
;;
;;
esac
esac
echo
"
$CMD
"
echo
"
$CMD
"
...
@@ -13133,6 +13207,13 @@ echo "$CMD"
...
@@ -13133,6 +13207,13 @@ echo "$CMD"
# Print pkgtype (need DISTRIB_ID var)
# Print pkgtype (need DISTRIB_ID var)
pkgtype
()
pkgtype
()
{
{
case
$VENDOR_ID
in
arch
|
manjaro
)
echo
"pkg.tar.xz"
&&
return
;;
esac
# TODO: try use generic names
# TODO: try use generic names
case
$(
pkgvendor
)
in
case
$(
pkgvendor
)
in
freebsd
)
echo
"tbz"
;;
freebsd
)
echo
"tbz"
;;
...
@@ -13191,6 +13272,9 @@ normalize_name()
...
@@ -13191,6 +13272,9 @@ normalize_name()
"Debian GNU/Linux"
)
"Debian GNU/Linux"
)
echo
"Debian"
echo
"Debian"
;;
;;
"Liya GNU/Linux"
)
echo
"LiyaLinux"
;;
"CentOS Linux"
)
"CentOS Linux"
)
echo
"CentOS"
echo
"CentOS"
;;
;;
...
@@ -13264,11 +13348,13 @@ if distro os-release ; then
...
@@ -13264,11 +13348,13 @@ if distro os-release ; then
DISTRIB_RELEASE_ORIG
=
"
$VERSION_ID
"
DISTRIB_RELEASE_ORIG
=
"
$VERSION_ID
"
DISTRIB_RELEASE
=
"
$VERSION_ID
"
DISTRIB_RELEASE
=
"
$VERSION_ID
"
[
-n
"
$DISTRIB_RELEASE
"
]
||
DISTRIB_RELEASE
=
"CUR"
[
-n
"
$DISTRIB_RELEASE
"
]
||
DISTRIB_RELEASE
=
"CUR"
[
"
$BUILD_ID
"
=
"rolling"
]
&&
DISTRIB_RELEASE
=
"rolling"
[
-n
"
$BUG_REPORT_URL
"
]
||
BUG_REPORT_URL
=
"
$HOME_URL
"
# set by os-release:
# set by os-release:
#PRETTY_NAME
#PRETTY_NAME
VENDOR_ID
=
"
$ID
"
VENDOR_ID
=
"
$ID
"
case
"
$VENDOR_ID
"
in
case
"
$VENDOR_ID
"
in
ubuntu|reld|rhel|astra
)
ubuntu|reld|rhel|astra
|manjaro
)
;;
;;
*
)
*
)
[
-n
"
$ID_LIKE
"
]
&&
VENDOR_ID
=
"
$(
echo
"
$ID_LIKE
"
|
cut
-d
" "
-f1
)
"
[
-n
"
$ID_LIKE
"
]
&&
VENDOR_ID
=
"
$(
echo
"
$ID_LIKE
"
|
cut
-d
" "
-f1
)
"
...
@@ -13370,7 +13456,7 @@ case "$DISTRIB_ID" in
...
@@ -13370,7 +13456,7 @@ case "$DISTRIB_ID" in
esac
esac
[
-n
"
$DISTRIB_ID
"
]
&&
return
[
-n
"
$DISTRIB_ID
"
]
&&
[
-n
"
$DISTRIB_RELEASE
"
]
&&
return
# check via obsoleted ways
# check via obsoleted ways
...
@@ -13756,7 +13842,7 @@ get_service_manager()
...
@@ -13756,7 +13842,7 @@ get_service_manager()
[
-d
/run/systemd/system
]
&&
echo
"systemd"
&&
return
[
-d
/run/systemd/system
]
&&
echo
"systemd"
&&
return
# TODO
# TODO
#[ -d /usr/share/upstart ] && echo "upstart" && return
#[ -d /usr/share/upstart ] && echo "upstart" && return
is_command systemctl
&&
echo
"systemd"
&&
return
is_command systemctl
&&
cat
/proc/1/comm |
grep
-q
'systemd$'
&&
echo
"systemd"
&&
return
[
-d
/etc/init.d
]
&&
echo
"sysvinit"
&&
return
[
-d
/etc/init.d
]
&&
echo
"sysvinit"
&&
return
echo
"(unknown)"
echo
"(unknown)"
}
}
...
...
packed/serv.sh
View file @
ffeedebb
...
@@ -33,7 +33,7 @@ SHAREDIR=$PROGDIR
...
@@ -33,7 +33,7 @@ SHAREDIR=$PROGDIR
# will replaced with /etc/eepm during install
# will replaced with /etc/eepm during install
CONFIGDIR
=
$PROGDIR
/../etc
CONFIGDIR
=
$PROGDIR
/../etc
EPMVERSION
=
"3.5
7.14
"
EPMVERSION
=
"3.5
8.0
"
# package, single (file), pipe, git
# package, single (file), pipe, git
EPMMODE
=
"package"
EPMMODE
=
"package"
...
@@ -1783,20 +1783,25 @@ pkgvendor()
...
@@ -1783,20 +1783,25 @@ pkgvendor()
# TODO: in more appropriate way
# TODO: in more appropriate way
#which pkcon 2>/dev/null >/dev/null && info "You can run $ PMTYPE=packagekit epm to use packagekit backend"
#which pkcon 2>/dev/null >/dev/null && info "You can run $ PMTYPE=packagekit epm to use packagekit backend"
# Print package manager (need DISTRIB_ID
var
)
# Print package manager (need DISTRIB_ID
, DISTRIB_RELEASE vars
)
pkgmanager
()
pkgmanager
()
{
{
local
CMD
local
CMD
# FIXME: some problems with multibased distros (Server Edition on CentOS and Desktop Edition on Ubuntu)
case
$DISTRIB_ID
in
case
$VENDOR_ID
in
ALTLinux|ALTServer
)
alt
)
#which ds-install 2>/dev/null >/dev/null && CMD=deepsolver-rpm
echo
"apt-rpm"
&&
return
#which pkcon 2>/dev/null >/dev/null && CMD=packagekit-rpm
CMD
=
"apt-rpm"
;;
;;
ALTServer
)
arch
|
manjaro
)
CMD
=
"apt-rpm"
echo
"pacman"
&&
return
;;
;;
debian
)
echo
"apt-dpkg"
&&
return
;;
esac
# FIXME: some problems with multibased distros (Server Edition on CentOS and Desktop Edition on Ubuntu)
case
$DISTRIB_ID
in
PCLinux
)
PCLinux
)
CMD
=
"apt-rpm"
CMD
=
"apt-rpm"
;;
;;
...
@@ -1877,11 +1882,6 @@ case $DISTRIB_ID in
...
@@ -1877,11 +1882,6 @@ case $DISTRIB_ID in
CMD
=
"xbps"
CMD
=
"xbps"
;;
;;
*
)
*
)
# try detect firstly
if
grep
-q
"ID_LIKE=debian"
/etc/os-release 2>/dev/null
;
then
echo
"apt-dpkg"
&&
return
fi
if
is_command
"rpm"
&&
[
-s
/var/lib/rpm/Name
]
||
[
-s
/var/lib/rpm/rpmdb.sqlite
]
;
then
if
is_command
"rpm"
&&
[
-s
/var/lib/rpm/Name
]
||
[
-s
/var/lib/rpm/rpmdb.sqlite
]
;
then
is_command
"zypper"
&&
echo
"zypper-rpm"
&&
return
is_command
"zypper"
&&
echo
"zypper-rpm"
&&
return
is_command
"dnf"
&&
echo
"dnf-rpm"
&&
return
is_command
"dnf"
&&
echo
"dnf-rpm"
&&
return
...
@@ -1895,7 +1895,7 @@ case $DISTRIB_ID in
...
@@ -1895,7 +1895,7 @@ case $DISTRIB_ID in
is_command
"apt-get"
&&
echo
"apt-dpkg"
&&
return
is_command
"apt-get"
&&
echo
"apt-dpkg"
&&
return
fi
fi
echo
"pkgmanager(): We don't support yet DISTRIB_ID
$DISTRIB_ID
"
>
&2
echo
"pkgmanager(): We don't support yet DISTRIB_ID
$DISTRIB_ID
(VENDOR_ID
$VENDOR_ID
)
"
>
&2
;;
;;
esac
esac
echo
"
$CMD
"
echo
"
$CMD
"
...
@@ -1904,6 +1904,13 @@ echo "$CMD"
...
@@ -1904,6 +1904,13 @@ echo "$CMD"
# Print pkgtype (need DISTRIB_ID var)
# Print pkgtype (need DISTRIB_ID var)
pkgtype
()
pkgtype
()
{
{
case
$VENDOR_ID
in
arch
|
manjaro
)
echo
"pkg.tar.xz"
&&
return
;;
esac
# TODO: try use generic names
# TODO: try use generic names
case
$(
pkgvendor
)
in
case
$(
pkgvendor
)
in
freebsd
)
echo
"tbz"
;;
freebsd
)
echo
"tbz"
;;
...
@@ -1962,6 +1969,9 @@ normalize_name()
...
@@ -1962,6 +1969,9 @@ normalize_name()
"Debian GNU/Linux"
)
"Debian GNU/Linux"
)
echo
"Debian"
echo
"Debian"
;;
;;
"Liya GNU/Linux"
)
echo
"LiyaLinux"
;;
"CentOS Linux"
)
"CentOS Linux"
)
echo
"CentOS"
echo
"CentOS"
;;
;;
...
@@ -2035,11 +2045,13 @@ if distro os-release ; then
...
@@ -2035,11 +2045,13 @@ if distro os-release ; then
DISTRIB_RELEASE_ORIG
=
"
$VERSION_ID
"
DISTRIB_RELEASE_ORIG
=
"
$VERSION_ID
"
DISTRIB_RELEASE
=
"
$VERSION_ID
"
DISTRIB_RELEASE
=
"
$VERSION_ID
"
[
-n
"
$DISTRIB_RELEASE
"
]
||
DISTRIB_RELEASE
=
"CUR"
[
-n
"
$DISTRIB_RELEASE
"
]
||
DISTRIB_RELEASE
=
"CUR"
[
"
$BUILD_ID
"
=
"rolling"
]
&&
DISTRIB_RELEASE
=
"rolling"
[
-n
"
$BUG_REPORT_URL
"
]
||
BUG_REPORT_URL
=
"
$HOME_URL
"
# set by os-release:
# set by os-release:
#PRETTY_NAME
#PRETTY_NAME
VENDOR_ID
=
"
$ID
"
VENDOR_ID
=
"
$ID
"
case
"
$VENDOR_ID
"
in
case
"
$VENDOR_ID
"
in
ubuntu|reld|rhel|astra
)
ubuntu|reld|rhel|astra
|manjaro
)
;;
;;
*
)
*
)
[
-n
"
$ID_LIKE
"
]
&&
VENDOR_ID
=
"
$(
echo
"
$ID_LIKE
"
|
cut
-d
" "
-f1
)
"
[
-n
"
$ID_LIKE
"
]
&&
VENDOR_ID
=
"
$(
echo
"
$ID_LIKE
"
|
cut
-d
" "
-f1
)
"
...
@@ -2141,7 +2153,7 @@ case "$DISTRIB_ID" in
...
@@ -2141,7 +2153,7 @@ case "$DISTRIB_ID" in
esac
esac
[
-n
"
$DISTRIB_ID
"
]
&&
return
[
-n
"
$DISTRIB_ID
"
]
&&
[
-n
"
$DISTRIB_RELEASE
"
]
&&
return
# check via obsoleted ways
# check via obsoleted ways
...
@@ -2527,7 +2539,7 @@ get_service_manager()
...
@@ -2527,7 +2539,7 @@ get_service_manager()
[
-d
/run/systemd/system
]
&&
echo
"systemd"
&&
return
[
-d
/run/systemd/system
]
&&
echo
"systemd"
&&
return
# TODO
# TODO
#[ -d /usr/share/upstart ] && echo "upstart" && return
#[ -d /usr/share/upstart ] && echo "upstart" && return
is_command systemctl
&&
echo
"systemd"
&&
return
is_command systemctl
&&
cat
/proc/1/comm |
grep
-q
'systemd$'
&&
echo
"systemd"
&&
return
[
-d
/etc/init.d
]
&&
echo
"sysvinit"
&&
return
[
-d
/etc/init.d
]
&&
echo
"sysvinit"
&&
return
echo
"(unknown)"
echo
"(unknown)"
}
}
...
...
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