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
7cebd564
Commit
7cebd564
authored
Jul 19, 2022
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
distr_info: improve override support
parent
0309402c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
7 deletions
+19
-7
distr_info
bin/distr_info
+19
-7
No files found.
bin/distr_info
View file @
7cebd564
...
...
@@ -6,7 +6,7 @@
# You can set ROOTDIR to root system dir
#ROOTDIR=
PROGVERSION
=
"2022071
8
"
PROGVERSION
=
"2022071
9
"
# TODO: check /etc/system-release
...
...
@@ -48,8 +48,13 @@ override_distrib()
{
[
-n
"
$1
"
]
||
return
VENDOR_ID
=
''
DISTRIB_ID
=
"
$(
echo
"
$1
"
|
sed
-e
's|/.*||'
)
"
DISTRIB_RELEASE
=
"
$(
echo
"
$1
"
|
sed
-e
's|.*/||'
)
"
PRETTY_NAME
=
''
local
name
=
"
$(
echo
"
$1
"
|
sed
-e
's|x86_64/||'
)
"
[
"
$name
"
=
"
$1
"
]
&&
DIST_ARCH
=
"x86"
||
DIST_ARCH
=
"x86_64"
DISTRIB_ID
=
"
$(
echo
"
$name
"
|
sed
-e
's|/.*||'
)
"
DISTRIB_RELEASE
=
"
$(
echo
"
$name
"
|
sed
-e
's|.*/||'
)
"
[
"
$DISTRIB_ID
"
=
"
$DISTRIB_RELEASE
"
]
&&
DISTRIB_RELEASE
=
''
}
# Translate DISTRIB_ID to vendor name (like %_vendor does or package release name uses), uses VENDOR_ID by default
...
...
@@ -455,10 +460,6 @@ fi
fill_distr_info
[
-n
"
$DISTRIB_ID
"
]
||
DISTRIB_ID
=
"Generic"
if
[
-z
"
$PRETTY_NAME
"
]
;
then
PRETTY_NAME
=
"
$DISTRIB_ID
$DISTRIB_RELEASE
"
fi
get_uname
()
{
tolower
$(
uname
$1
)
|
tr
-d
"
\t\r\n
"
...
...
@@ -710,6 +711,10 @@ get_service_manager()
print_pretty_name
()
{
if
[
-z
"
$PRETTY_NAME
"
]
;
then
PRETTY_NAME
=
"
$DISTRIB_ID
$DISTRIB_RELEASE
"
fi
echo
"
$PRETTY_NAME
"
}
...
...
@@ -771,6 +776,7 @@ case $1 in
exit
0
;;
--pretty
)
override_distrib
"
$2
"
print_pretty_name
;;
--distro-arch
)
...
...
@@ -784,9 +790,12 @@ case $1 in
exit
0
;;
-d
)
override_distrib
"
$2
"
echo
$DISTRIB_ID
;;
-a
)
override_distrib
"
$2
"
[
-n
"
$DIST_ARCH
"
]
&&
echo
"
$DIST_ARCH
"
&&
exit
0
get_arch
;;
-b
)
...
...
@@ -808,6 +817,7 @@ case $1 in
get_base_os_name
;;
-v
)
override_distrib
"
$2
"
echo
$DISTRIB_RELEASE
;;
-s
|
-n
)
...
...
@@ -823,9 +833,11 @@ case $1 in
exit
0
;;
-e
)
override_distrib
"
$2
"
print_name_version
;;
*
)
override_distrib
"
$1
"
print_total_info
;;
esac
...
...
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