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
140052af
Commit
140052af
authored
Jul 14, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
distr_info: use VENDOR_ID for detect pkgmanager
parent
b60e3944
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
16 deletions
+20
-16
distr_info
bin/distr_info
+20
-16
No files found.
bin/distr_info
View file @
140052af
...
...
@@ -120,20 +120,25 @@ pkgvendor()
# TODO: in more appropriate way
#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
()
{
local
CMD
# FIXME: some problems with multibased distros (Server Edition on CentOS and Desktop Edition on Ubuntu)
case
$DISTRIB_ID
in
ALTLinux|ALTServer
)
#which ds-install 2>/dev/null >/dev/null && CMD=deepsolver-rpm
#which pkcon 2>/dev/null >/dev/null && CMD=packagekit-rpm
CMD
=
"apt-rpm"
case
$VENDOR_ID
in
alt
)
echo
"apt-rpm"
&&
return
;;
ALTServer
)
CMD
=
"apt-rpm"
arch
|
manjaro
)
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
)
CMD
=
"apt-rpm"
;;
...
...
@@ -214,11 +219,6 @@ case $DISTRIB_ID in
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
is_command
"zypper"
&&
echo
"zypper-rpm"
&&
return
is_command
"dnf"
&&
echo
"dnf-rpm"
&&
return
...
...
@@ -232,7 +232,7 @@ case $DISTRIB_ID in
is_command
"apt-get"
&&
echo
"apt-dpkg"
&&
return
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
echo
"
$CMD
"
...
...
@@ -299,6 +299,9 @@ normalize_name()
"Debian GNU/Linux"
)
echo
"Debian"
;;
"Liya GNU/Linux"
)
echo
"LiyaLinux"
;;
"CentOS Linux"
)
echo
"CentOS"
;;
...
...
@@ -372,11 +375,12 @@ if distro os-release ; then
DISTRIB_RELEASE_ORIG
=
"
$VERSION_ID
"
DISTRIB_RELEASE
=
"
$VERSION_ID
"
[
-n
"
$DISTRIB_RELEASE
"
]
||
DISTRIB_RELEASE
=
"CUR"
[
"
$BUILD_ID
"
=
"rolling"
]
&&
DISTRIB_RELEASE
=
"rolling"
# set by os-release:
#PRETTY_NAME
VENDOR_ID
=
"
$ID
"
case
"
$VENDOR_ID
"
in
ubuntu|reld|rhel|astra
)
ubuntu|reld|rhel|astra
|manjaro
)
;;
*
)
[
-n
"
$ID_LIKE
"
]
&&
VENDOR_ID
=
"
$(
echo
"
$ID_LIKE
"
|
cut
-d
" "
-f1
)
"
...
...
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