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
0917c066
Commit
0917c066
authored
2 years ago
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm print: fix print name/version/release by string
parent
87632daf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
4 deletions
+22
-4
epm-print
bin/epm-print
+18
-4
test_get_shortname.sh
tests/test_get_shortname.sh
+4
-0
No files found.
bin/epm-print
View file @
0917c066
...
@@ -140,28 +140,42 @@ print_binpkgfilelist()
...
@@ -140,28 +140,42 @@ print_binpkgfilelist()
# TODO: need try detect more strict
# TODO: need try detect more strict
# TODO: package name mask for every system
# TODO: package name mask for every system
# TODO: broken for all systems
#PKGNAMEMASK1="\(.*\)-\([^0-9].*[^0-9]\)-\(.*[0-9].*\)"
#PKGNAMEMASK1="\(.*\)-\([^0-9].*[^0-9]\)-\(.*[0-9].*\)"
# mask to parse package name
# mask to parse package name
# TODO: с хвоста, сначала релиз, потом версию, остаётся пакет.
# всё равно остаются неоднозначности: libname-1.0 где 1.0 то ли версия, то ли часть названия.
# возможно, нужно ориентироваться только на выделение в полном имени/
# libpq5.2-9.0eter-9.0.4-alt14
# nx-libs-3.5.99.26.1-eter2astra:amd64
PKGNAMEMASK4
=
"6
\(
.*
\)
[_-]
\(
[^_-]*
\)
[_-]
\(
.*[0-9].*
\)
:
\(
.*
\)
$"
# nx-libs-3.5.99.26.1-eter2astra
PKGNAMEMASK3
=
"^
\(
.*
\)
[_-]
\(
[^_-]*
\)
[_-]
\(
.*[0-9].*
\)
$"
# nx-libs-3.5.99.26.1
#PKGNAMEMASK2="^\(.*\)[_-]\([0-9].*\)$"
PKGNAMEMASK
=
"
\(
.*
\)
-
\(
[0-9].*
\)
-
\(
.*[0-9].*
\)\.\(
.*
\)\.\(
.*
\)
"
PKGNAMEMASK
=
"
\(
.*
\)
-
\(
[0-9].*
\)
-
\(
.*[0-9].*
\)\.\(
.*
\)\.\(
.*
\)
"
print_name
()
print_name
()
{
{
echo
"
$@
"
| xargs
-n1
echo
|
sed
-e
"s|
$PKGNAMEMASK
|
\1
|g
"
echo
"
$@
"
| xargs
-n1
echo
|
sed
-e
"s|
$PKGNAMEMASK
4
|
\1
-
\2
-
\3
|"
-e
"s|
$PKGNAMEMASK3
|
\1
|
"
}
}
print_version
()
print_version
()
{
{
echo
"
$1
"
| xargs
-n1
echo
|
sed
-e
"s|
$PKGNAMEMASK
|
\2
|g
"
echo
"
$1
"
| xargs
-n1
echo
|
sed
-e
"s|
$PKGNAMEMASK
4
|
\1
-
\2
-
\3
|"
-e
"s|
$PKGNAMEMASK3
|
\2
|
"
}
}
print_release
()
print_release
()
{
{
echo
"
$1
"
| xargs
-n1
echo
|
sed
-e
"s|
$PKGNAMEMASK
|
\3
|g
"
echo
"
$1
"
| xargs
-n1
echo
|
sed
-e
"s|
$PKGNAMEMASK
4
|
\1
-
\2
-
\3
|"
-e
"s|
$PKGNAMEMASK3
|
\3
|
"
}
}
print_version_release
()
print_version_release
()
{
{
echo
"
$1
"
| xargs
-n1
echo
|
sed
-e
"s|
$PKGNAMEMASK
|
\2
-
\3
|g
"
echo
"
$1
"
| xargs
-n1
echo
|
sed
-e
"s|
$PKGNAMEMASK
4
|
\1
-
\2
-
\3
|"
-e
"s|
$PKGNAMEMASK3
|
\2
-
\3
|
"
}
}
# get package name only by package filename
# get package name only by package filename
...
...
This diff is collapsed.
Click to expand it.
tests/test_get_shortname.sh
View file @
0917c066
...
@@ -62,6 +62,10 @@ check_pkg rootfiles-alt-alt11 rootfiles
...
@@ -62,6 +62,10 @@ check_pkg rootfiles-alt-alt11 rootfiles
check_pkg git-bzr-1.1_48_g61d6007-alt1.1 git-bzr
check_pkg git-bzr-1.1_48_g61d6007-alt1.1 git-bzr
check_pkg liblz4-r127-alt1.svn20141224 liblz4
check_pkg liblz4-r127-alt1.svn20141224 liblz4
check_pkg libijs-0.35_9.15-alt1 libijs
check_pkg libijs-0.35_9.15-alt1 libijs
check_pkg nx-libs-3.5.99.26.1-eter2astra:amd64 nx-libs
check_pkg nx-libs-3.5.99.26.1-eter2astra nx-libs
check_pkg nx-libs_3.5.99.26.1_eter2astra:amd64 nx-libs
check_pkg nx-libs_3.5.99.26.1_eter2astra nx-libs
echo
echo
echo
"check_pkg"
echo
"check_pkg"
...
...
This diff is collapsed.
Click to expand it.
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