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
Vladislav
eepm
Commits
adf404f9
Commit
adf404f9
authored
Mar 28, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
distr_info: rearrange default output
parent
e42126bd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
15 deletions
+18
-15
distr_info
bin/distr_info
+18
-15
No files found.
bin/distr_info
View file @
adf404f9
#!/bin/sh
#!/bin/sh
# 2007-202
2
(c) Vitaly Lipatov <lav@etersoft.ru>
# 2007-202
3
(c) Vitaly Lipatov <lav@etersoft.ru>
# 2007-202
2
(c) Etersoft
# 2007-202
3
(c) Etersoft
# 2007-202
2
Public domain
# 2007-202
3
Public domain
# You can set ROOTDIR to root system dir
# You can set ROOTDIR to root system dir
#ROOTDIR=
#ROOTDIR=
PROGVERSION
=
"202
20812
"
PROGVERSION
=
"202
30328
"
# TODO: check /etc/system-release
# TODO: check /etc/system-release
...
@@ -56,6 +56,7 @@ override_distrib()
...
@@ -56,6 +56,7 @@ override_distrib()
DISTRIB_RELEASE
=
"
$(
echo
"
$name
"
|
sed
-e
's|.*/||'
)
"
DISTRIB_RELEASE
=
"
$(
echo
"
$name
"
|
sed
-e
's|.*/||'
)
"
[
"
$DISTRIB_ID
"
=
"
$DISTRIB_RELEASE
"
]
&&
DISTRIB_RELEASE
=
''
[
"
$DISTRIB_ID
"
=
"
$DISTRIB_RELEASE
"
]
&&
DISTRIB_RELEASE
=
''
DISTRIB_CODENAME
=
''
DISTRIB_CODENAME
=
''
DISTRIB_FULL_RELEASE
=
"
$DISTRIB_RELEASE
"
}
}
...
@@ -816,21 +817,22 @@ print_pretty_name()
...
@@ -816,21 +817,22 @@ print_pretty_name()
print_total_info
()
print_total_info
()
{
{
local
orig
=
''
[
-n
"
$BUILD_ID
"
]
&&
orig
=
"
$BUILD_ID
"
cat
<<
EOF
cat
<<
EOF
distro_info v
$PROGVERSION
: Copyright © 2007-2023 Etersoft
distro_info v
$PROGVERSION
: Copyright © 2007-2023 Etersoft
Total system information:
Pretty distro name (--pretty):
$(
print_pretty_name
)
Pretty distro name (--pretty):
$(
print_pretty_name
)
Distro name (-d) and version (-v) (-e):
$(
print_name_version
)
Distro name / version:
$DISTRO_NAME
/
$DISTRIB_FULL_RELEASE$orig
Base distro name (-d) / version (-v):
$(
print_name_version
)
Base distro name (-s) / Repo name (-r):
$(
pkgvendor
)
/
$(
print_repo_name
)
Package manager/type (-g/-p):
$(
pkgmanager
)
/
$(
pkgtype
)
Package manager/type (-g/-p):
$(
pkgmanager
)
/
$(
pkgtype
)
Running service manager (-y):
$(
get_service_manager
)
Base OS name (-o) / CPU arch (-a):
$(
get_base_os_name
)
$(
get_arch
)
CPU norm register size (-b):
$(
get_bit_size
)
Virtualization (-i):
$(
get_virt
)
Virtualization (-i):
$(
get_virt
)
CPU Cores/MHz (-c/-z):
$(
get_core_count
)
/
$(
get_core_mhz
)
MHz
CPU Cores/MHz (-c/-z):
$(
get_core_count
)
/
$(
get_core_mhz
)
MHz
CPU Architecture (-a):
$(
get_arch
)
CPU norm register size (-b):
$(
get_bit_size
)
System memory size (MB) (-m):
$(
get_memory_size
)
System memory size (MB) (-m):
$(
get_memory_size
)
Base OS name (-o):
$(
get_base_os_name
)
Running service manager (-y):
$(
get_service_manager
)
Base distro (vendor) name (-s|-n):
$(
pkgvendor
)
Version codename (--codename):
$(
print_codename
)
(run with -h to get help)
(run with -h to get help)
EOF
EOF
...
@@ -858,7 +860,7 @@ case "$1" in
...
@@ -858,7 +860,7 @@ case "$1" in
echo
" -z - print current CPU MHz"
echo
" -z - print current CPU MHz"
echo
" --glibc-version - print system glibc version"
echo
" --glibc-version - print system glibc version"
echo
echo
echo
" -d
| --distro-name - print distro name
"
echo
" -d
|--base-distro-name - print distro id (short distro name)
"
echo
" -e - print full name of distro with version"
echo
" -e - print full name of distro with version"
echo
" -o | --os-name - print base OS name"
echo
" -o | --os-name - print base OS name"
echo
" -p | package-type - print type of the packaging system"
echo
" -p | package-type - print type of the packaging system"
...
@@ -867,6 +869,7 @@ case "$1" in
...
@@ -867,6 +869,7 @@ case "$1" in
echo
" --pretty|--pretty-name - print pretty distro name"
echo
" --pretty|--pretty-name - print pretty distro name"
echo
" -v | --base-version - print version of the distro"
echo
" -v | --base-version - print version of the distro"
echo
" --distro-name - print distro name"
echo
" --distro-name - print distro name"
echo
" --distro-version - print full version of the distro"
echo
" --full-version - print full version of the distro"
echo
" --full-version - print full version of the distro"
echo
" --codename (obsoleted) - print distro codename (focal for Ubuntu 20.04)"
echo
" --codename (obsoleted) - print distro codename (focal for Ubuntu 20.04)"
echo
" --repo-name - print repository name (focal for Ubuntu 20.04)"
echo
" --repo-name - print repository name (focal for Ubuntu 20.04)"
...
@@ -904,7 +907,7 @@ case "$1" in
...
@@ -904,7 +907,7 @@ case "$1" in
get_glibc_version
get_glibc_version
exit
0
exit
0
;;
;;
-d
|
--distro-name
)
-d
|
--
base-
distro-name
)
override_distrib
"
$2
"
override_distrib
"
$2
"
echo
$DISTRIB_ID
echo
$DISTRIB_ID
;;
;;
...
@@ -949,7 +952,7 @@ case "$1" in
...
@@ -949,7 +952,7 @@ case "$1" in
override_distrib
"
$2
"
override_distrib
"
$2
"
echo
"
$DISTRIB_RELEASE
"
echo
"
$DISTRIB_RELEASE
"
;;
;;
--full-version
)
--full-version
|
--distro-version
)
override_distrib
"
$2
"
override_distrib
"
$2
"
echo
"
$DISTRIB_FULL_RELEASE
"
echo
"
$DISTRIB_FULL_RELEASE
"
;;
;;
...
...
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