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
Nurlan
eepm
Commits
c5d83942
Commit
c5d83942
authored
Jan 06, 2021
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move package manager detection to distr_info
parent
af76dd2f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
96 additions
and
82 deletions
+96
-82
distr_info
bin/distr_info
+94
-2
epm-sh-functions
bin/epm-sh-functions
+1
-79
eepm.spec
eepm.spec
+1
-1
No files found.
bin/distr_info
View file @
c5d83942
...
...
@@ -53,6 +53,7 @@ rpmvendor()
[
"
$DISTRIB_ID
"
=
"TinyCoreLinux"
]
&&
echo
"tcl"
&&
return
[
"
$DISTRIB_ID
"
=
"VoidLinux"
]
&&
echo
"void"
&&
return
[
"
$DISTRIB_ID
"
=
"OpenSUSE"
]
&&
echo
"suse"
&&
return
[
-n
"
$VENDOR_ID
"
]
&&
echo
"
$VENDOR_ID
"
&&
return
tolower
"
$DISTRIB_ID
"
}
...
...
@@ -89,6 +90,90 @@ pkgtype()
esac
}
# 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)
pkgmanager
()
{
local
CMD
# FIXME: some problems with multibased distros (Server Edition on CentOS and Desktop Edition on Ubuntu)
case
$DISTRIB_ID
in
ALTLinux
)
CMD
=
"apt-rpm"
#which ds-install 2>/dev/null >/dev/null && CMD=deepsolver-rpm
#which pkcon 2>/dev/null >/dev/null && CMD=packagekit-rpm
;;
PCLinux
)
CMD
=
"apt-rpm"
;;
Ubuntu|Debian|Mint|AstraLinux|Elbrus
)
CMD
=
"apt-dpkg"
#which aptitude 2>/dev/null >/dev/null && CMD=aptitude-dpkg
which snappy 2>/dev/null
>
/dev/null
&&
CMD
=
snappy
;;
Mandriva|ROSA
)
CMD
=
"urpm-rpm"
;;
FreeBSD|NetBSD|OpenBSD|Solaris
)
CMD
=
"pkgsrc"
which pkg 2>/dev/null
>
/dev/null
&&
CMD
=
pkgng
;;
Gentoo
)
CMD
=
"emerge"
;;
ArchLinux
)
CMD
=
"pacman"
;;
Fedora|LinuxXP|ASPLinux|CentOS|RHEL|Scientific|GosLinux|Amzn|RedOS
)
CMD
=
"dnf-rpm"
which dnf 2>/dev/null
>
/dev/null
||
CMD
=
yum-rpm
;;
Slackware
)
CMD
=
"slackpkg"
;;
SUSE|SLED|SLES
)
CMD
=
"zypper-rpm"
;;
ForesightLinux|rPathLinux
)
CMD
=
"conary"
;;
Windows
)
CMD
=
"appget"
which
$CMD
2>/dev/null
>
/dev/null
||
CMD
=
"chocolatey"
which
$CMD
2>/dev/null
>
/dev/null
||
CMD
=
"winget"
;;
MacOS
)
CMD
=
"homebrew"
;;
OpenWrt
)
CMD
=
"opkg"
;;
GNU/Linux/Guix
)
CMD
=
"guix"
;;
Android
)
CMD
=
"android"
;;
Cygwin
)
CMD
=
"aptcyg"
;;
alpine
)
CMD
=
"apk"
;;
TinyCoreLinux
)
CMD
=
"tce"
;;
VoidLinux
)
CMD
=
"xbps"
;;
*
)
fatal
"Have no suitable DISTRIB_ID
$DISTRIB_ID
"
;;
esac
echo
"
$CMD
"
}
get_var
()
{
# get first variable and print it out, drop quotes if exists
...
...
@@ -561,11 +646,11 @@ print_pretty_name()
print_total_info
()
{
cat
<<
EOF
distro_info v
$PROGVERSION
: Copyright © 2007-202
0
Etersoft
distro_info v
$PROGVERSION
: Copyright © 2007-202
1
Etersoft
==== Total system information:
Pretty distro name (--pretty):
$(
print_pretty_name
)
Distro name and version (-e):
$(
print_name_version
)
Packaging system (-p):
$(
pkgtype
)
Package manager/type (-g/-p):
$(
pkgmanager
)
/
$(
pkgtype
)
Running service manager (-y):
$(
get_service_manager
)
Virtualization (-i):
$(
get_virt
)
CPU Cores (-c):
$(
get_core_count
)
...
...
@@ -597,6 +682,7 @@ case $1 in
echo
" -n [SystemName] - print vendor name (as _vendor macros in rpm)"
echo
" -o - print base OS name"
echo
" -p [SystemName] - print type of the packaging system"
echo
" -g [SystemName] - print name of the packaging system"
echo
" -s [SystemName] - print name of distro for build system (like in the package release name)"
echo
" -y - print running service manager"
echo
" --pretty - print pretty distro name"
...
...
@@ -611,6 +697,12 @@ case $1 in
pkgtype
exit
0
;;
-g
)
# override DISTRIB_ID
test
-n
"
$2
"
&&
DISTRIB_ID
=
"
$2
"
pkgmanager
exit
0
;;
--pretty
)
print_pretty_name
;;
...
...
bin/epm-sh-functions
View file @
c5d83942
...
...
@@ -529,85 +529,7 @@ if [ -n "$FORCEPM" ] ; then
return
fi
# TODO: in more appropriate way
#which pkcon 2>/dev/null >/dev/null && info "You can run $ PMTYPE=packagekit epm to use packagekit backend"
# TODO: move it in distr_vendor?
# FIXME: some problems with multibased distros (Server Edition on CentOS and Desktop Edition on Ubuntu)
case
$DISTRNAME
in
ALTLinux
)
CMD
=
"apt-rpm"
#which ds-install 2>/dev/null >/dev/null && CMD=deepsolver-rpm
#which pkcon 2>/dev/null >/dev/null && CMD=packagekit-rpm
;;
PCLinux
)
CMD
=
"apt-rpm"
;;
Ubuntu|Debian|Mint|AstraLinux|Elbrus
)
CMD
=
"apt-dpkg"
#which aptitude 2>/dev/null >/dev/null && CMD=aptitude-dpkg
which snappy 2>/dev/null
>
/dev/null
&&
CMD
=
snappy
;;
Mandriva|ROSA
)
CMD
=
"urpm-rpm"
;;
FreeBSD|NetBSD|OpenBSD|Solaris
)
CMD
=
"pkgsrc"
which pkg 2>/dev/null
>
/dev/null
&&
CMD
=
pkgng
;;
Gentoo
)
CMD
=
"emerge"
;;
ArchLinux
)
CMD
=
"pacman"
;;
Fedora|LinuxXP|ASPLinux|CentOS|RHEL|Scientific|GosLinux|Amzn
)
CMD
=
"dnf-rpm"
which dnf 2>/dev/null
>
/dev/null
||
CMD
=
yum-rpm
;;
Slackware
)
CMD
=
"slackpkg"
;;
SUSE|SLED|SLES
)
CMD
=
"zypper-rpm"
;;
ForesightLinux|rPathLinux
)
CMD
=
"conary"
;;
Windows
)
CMD
=
"appget"
which
$CMD
2>/dev/null
>
/dev/null
||
CMD
=
"chocolatey"
which
$CMD
2>/dev/null
>
/dev/null
||
CMD
=
"winget"
;;
MacOS
)
CMD
=
"homebrew"
;;
OpenWrt
)
CMD
=
"opkg"
;;
GNU/Linux/Guix
)
CMD
=
"guix"
;;
Android
)
CMD
=
"android"
;;
Cygwin
)
CMD
=
"aptcyg"
;;
alpine
)
CMD
=
"apk"
;;
TinyCoreLinux
)
CMD
=
"tce"
;;
VoidLinux
)
CMD
=
"xbps"
;;
*
)
fatal
"Have no suitable DISTRNAME
$DISTRNAME
"
;;
esac
PMTYPE
=
$CMD
PMTYPE
=
"
$(
$DISTRVENDOR
-g
$DISTRNAME
)
"
}
is_active_systemd
()
...
...
eepm.spec
View file @
c5d83942
...
...
@@ -21,7 +21,7 @@ Provides: epm = %EVR
%if %_vendor == "alt"
# FIXHERE: Replace with target platform package manager
Requires: apt rpm
Requires: distro_info >= 1.
7
Requires: distro_info >= 1.
8
%endif
%description
...
...
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