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
67995600
Commit
67995600
authored
Aug 12, 2022
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
distr_info: add --codename support
parent
46464fbd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
distr_info
bin/distr_info
+12
-1
No files found.
bin/distr_info
View file @
67995600
...
...
@@ -6,7 +6,7 @@
# You can set ROOTDIR to root system dir
#ROOTDIR=
PROGVERSION
=
"20220
719
"
PROGVERSION
=
"20220
812
"
# TODO: check /etc/system-release
...
...
@@ -211,6 +211,10 @@ pkgtype()
esac
}
print_codename
()
{
echo
"
$DISTRIB_CODENAME
"
}
get_var
()
{
...
...
@@ -280,6 +284,7 @@ if distro os-release ; then
VENDOR_ID
=
"
$ID
"
DISTRIB_FULL_RELEASE
=
$DISTRIB_RELEASE
DISTRIB_RELEASE
=
$(
echo
"
$DISTRIB_RELEASE
"
|
sed
-e
"s/
\.
[0-9]
$/
/g"
)
DISTRIB_CODENAME
=
"
$VERSION_CODENAME
"
elif
distro lsb-release
;
then
DISTRIB_ID
=
$(
cat
$DISTROFILE
| get_var DISTRIB_ID
)
...
...
@@ -744,6 +749,7 @@ Total system information:
System memory size (MB) (-m):
$(
get_memory_size
)
Base OS name (-o):
$(
get_base_os_name
)
Base distro (vendor) name (-s|-n):
$(
pkgvendor
)
Version codename (--codename):
$(
print_codename
)
(run with -h to get help)
EOF
...
...
@@ -764,6 +770,7 @@ case "$1" in
echo
" -a - print hardware architecture (--distro-arch for distro depended name)"
echo
" -b - print size of arch bit (32/64)"
echo
" -c - print number of CPU cores"
echo
" --codename - print distro codename (focal for Ubuntu 20.04)"
echo
" -z - print current CPU MHz"
echo
" -d - print distro name"
echo
" -e - print full name of distro with version"
...
...
@@ -809,6 +816,10 @@ case "$1" in
override_distrib
"
$2
"
echo
$DISTRIB_ID
;;
--codename
)
override_distrib
"
$2
"
print_codename
;;
-a
)
override_distrib
"
$2
"
[
-n
"
$DIST_ARCH
"
]
&&
echo
"
$DIST_ARCH
"
&&
exit
0
...
...
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