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
97417082
Commit
97417082
authored
Jul 23, 2018
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use hascommand instead which
parent
acdbe859
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
distr_info
bin/distr_info
+10
-4
No files found.
bin/distr_info
View file @
97417082
...
...
@@ -25,6 +25,12 @@ has()
grep
"
$*
"
"
$DISTROFILE
"
>
/dev/null 2>&1
}
# Has a system the specified command?
hascommand
()
{
which
$1
2>/dev/null
>
/dev/null
}
firstupper
()
{
echo
"
$*
"
|
sed
's/.*/\u&/'
...
...
@@ -146,19 +152,19 @@ elif distro slackware-version ; then
DISTRIB_ID
=
"Slackware"
DISTRIB_RELEASE
=
"
$(
grep
-Eo
'[0-9]+\.[0-9]+'
$DISTROFILE
)
"
elif
distro os-release
&&
which apk 2>/dev/null
>
/dev/null
;
then
elif
distro os-release
&&
hascommand apk
;
then
# shellcheck disable=SC1090
.
$ROOTDIR
/etc/os-release
DISTRIB_ID
=
"
$(
firstupper
"
$ID
"
)
"
DISTRIB_RELEASE
=
"
$VERSION_ID
"
elif
distro os-release
&&
which tce-ab 2>/dev/null
>
/dev/null
;
then
elif
distro os-release
&&
hascommand tce-ab
;
then
# shellcheck disable=SC1090
.
$ROOTDIR
/etc/os-release
DISTRIB_ID
=
"TinyCoreLinux"
DISTRIB_RELEASE
=
"
$VERSION_ID
"
elif
distro os-release
&&
which xbps-query 2>/dev/null
>
/dev/null
;
then
elif
distro os-release
&&
hascommand xbps-query
;
then
# shellcheck disable=SC1090
.
$ROOTDIR
/etc/os-release
DISTRIB_ID
=
"VoidLinux"
...
...
@@ -313,7 +319,7 @@ elif [ "$(uname -s 2>/dev/null)" = "Darwin" ] ; then
DISTRIB_RELEASE
=
$(
uname
-r
)
# fixme: move to up
elif
[
"
$(
uname
)
"
=
"Linux"
]
&&
which guix 2>/dev/null
>
/dev/null
;
then
elif
[
"
$(
uname
)
"
=
"Linux"
]
&&
hascommand guix
;
then
DISTRIB_ID
=
"GNU/Linux/Guix"
DISTRIB_RELEASE
=
$(
uname
-r
)
...
...
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