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
etersoft
eepm
Commits
924d3192
Commit
924d3192
authored
Apr 30, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
distr_info: rewrite overrides, add support for DISTRNAME/DISTRVERSION/DISTRARCH
parent
35f6a4ec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
9 deletions
+27
-9
distr_info
bin/distr_info
+27
-9
No files found.
bin/distr_info
View file @
924d3192
...
...
@@ -73,17 +73,30 @@ print_bug_report_url()
echo
"
$BUG_REPORT_URL
"
}
# allows x86_64/Distro/Version
override_distrib
()
{
[
-n
"
$1
"
]
||
return
if
[
-n
"
$1
"
]
;
then
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
=
''
else
if
[
-z
"
$DISTRNAME
"
]
;
then
return
fi
# if predefined DISTRNAME and possible DISTRVERSION
DISTRIB_ID
=
"
$DISTRNAME
"
[
-n
"
$DISTRVERSION
"
]
&&
DISTRIB_RELEASE
=
"
$DISTRVERSION
"
[
-n
"
$DISTRARCH
"
]
&&
DIST_ARCH
=
"
$DISTRARCH
"
# export DISTRCONTROL="$(get_service_manager)"
fi
VENDOR_ID
=
''
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|/.*||'
)
"
PRETTY_NAME
=
"
$DISTRIB_ID
"
DISTRO_NAME
=
"
$DISTRIB_ID
"
DISTRIB_RELEASE
=
"
$(
echo
"
$name
"
|
sed
-e
's|.*/||'
)
"
[
"
$DISTRIB_ID
"
=
"
$DISTRIB_RELEASE
"
]
&&
DISTRIB_RELEASE
=
''
DISTRIB_CODENAME
=
"
$DISTRIB_RELEASE
"
DISTRIB_FULL_RELEASE
=
"
$DISTRIB_RELEASE
"
...
...
@@ -631,7 +644,7 @@ echo "$DIST_OS"
get_arch
()
{
local
DIST_ARCH
[
-n
"
$DIST_ARCH
"
]
&&
return
0
# Resolve the architecture
DIST_ARCH
=
"
$(
get_uname
-m
)
"
case
"
$DIST_ARCH
"
in
...
...
@@ -926,6 +939,11 @@ print_help()
echo
"Run without args to print all information."
}
if
[
-n
"
$DISTRNAME
"
]
;
then
override_distrib
fi
if
[
-n
"
$*
"
]
;
then
eval
lastarg
=
\$
{
$#}
case
"
$lastarg
"
in
...
...
@@ -940,7 +958,7 @@ if [ -n "$*" ] ; then
fi
# if without override
if
[
-z
"
$DISTRIB_ID
"
]
;
then
if
[
-z
"
$DISTRIB_ID
"
]
&&
[
-z
"
$DISTRNAME
"
]
;
then
fill_distr_info
[
-n
"
$DISTRIB_ID
"
]
||
DISTRIB_ID
=
"Generic"
fi
...
...
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