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
a751f52d
Commit
a751f52d
authored
Aug 19, 2022
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
distr_info: use more strong normalize distro versions
parent
332de905
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
5 deletions
+35
-5
distr_info
bin/distr_info
+35
-5
No files found.
bin/distr_info
View file @
a751f52d
...
...
@@ -262,6 +262,25 @@ normalize_name()
esac
}
# 1.2.3.4.5 -> 1
normalize_version1
()
{
echo
"
$1
"
|
sed
-e
"s|
\.
.*||"
}
# 1.2.3.4.5 -> 1.2
normalize_version2
()
{
echo
"
$1
"
|
sed
-e
"s|^
\(
[^.][^.]*
\.
[^.][^.]*
\)\.
.*|
\1
|"
}
# 1.2.3.4.5 -> 1.2.3
normalize_version3
()
{
echo
"
$1
"
|
sed
-e
"s|^
\(
[^.][^.]*
\.
[^.][^.]*
\.
[^.][^.]*
\)\.
.*|
\1
|"
}
fill_distr_info
()
{
# Default values
...
...
@@ -276,27 +295,30 @@ if distro os-release ; then
# shellcheck disable=SC1090
.
$DISTROFILE
DISTRIB_ID
=
"
$(
normalize_name
"
$NAME
"
)
"
# DISTRIB_ID="$(firstupper "$ID")
"
DISTRIB_RELEASE_ORIG
=
"
$VERSION_ID
"
DISTRIB_RELEASE
=
"
$VERSION_ID
"
[
-n
"
$DISTRIB_RELEASE
"
]
||
DISTRIB_RELEASE
=
"CUR"
# set by os-release:
#PRETTY_NAME
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
)
DISTRIB_RELEASE
=
$(
cat
$DISTROFILE
| get_var DISTRIB_RELEASE
)
DISTRIB_RELEASE_ORIG
=
"
$DISTRIB_RELEASE
"
DISTRIB_CODENAME
=
$(
cat
$DISTROFILE
| get_var DISTRIB_CODENAME
)
PRETTY_NAME
=
$(
cat
$DISTROFILE
| get_var DISTRIB_DESCRIPTION
)
fi
DISTRIB_RELEASE
=
$(
normalize_version2
"
$DISTRIB_RELEASE
"
)
case
"
$VENDOR_ID
"
in
"alt"
|
"altlinux"
)
DISTRIB_RELEASE
=
$(
echo
"
$DISTRIB_RELEASE
"
|
sed
-e
"s/
\.
[0-9].*//g"
)
# 2.4.5.99 -> 2
DISTRIB_RELEASE
=
$(
normalize_version1
"
$DISTRIB_RELEASE_ORIG
"
)
case
"
$DISTRIB_ID
"
in
"ALTServer"
|
"ALTSPWorkstation"
|
"Sisyphus"
)
;;
...
...
@@ -306,7 +328,9 @@ case "$VENDOR_ID" in
esac
;;
"astra"
)
DISTRIB_RELEASE
=
"
$VERSION_CODENAME
"
DISTRIB_RELEASE
=
$(
normalize_version3
"
$DISTRIB_RELEASE_ORIG
"
|
sed
-e
's|_.*||'
)
#[ "$DISTRIB_RELEASE" = "1.17" ] && DISTRIB_RELEASE="$VERSION_ID"
#DISTRIB_RELEASE="$VERSION_CODENAME"
;;
esac
...
...
@@ -326,8 +350,14 @@ case "$DISTRIB_ID" in
case
"
$DISTRIB_FULL_RELEASE
"
in
8.0|8.1
)
;;
8.2|8.3
)
DISTRIB_RELEASE
=
"c9f1"
;;
8.4
)
DISTRIB_RELEASE
=
"c9f2"
;;
8.
*
)
DISTRIB_RELEASE
=
"c9"
DISTRIB_RELEASE
=
"c9
f3
"
;;
esac
# DISTRIB_RELEASE=$(echo $DISTRIB_RELEASE | sed -e "s/\..*//g")
...
...
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