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
cd98fc6e
Commit
cd98fc6e
authored
Feb 28, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm-print: add hack for shortname
parent
2864a997
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
epm-print
bin/epm-print
+14
-0
test_get_shortname.sh
tests/test_get_shortname.sh
+3
-1
No files found.
bin/epm-print
View file @
cd98fc6e
...
...
@@ -160,11 +160,20 @@ PKGNAMEMASK="\(.*\)-\([0-9].*\)-\(.*[0-9].*\)\.\(.*\)\.\(.*\)"
print_name
()
{
# FIXME:
# don't change name (false cases)
#echo "$@" | xargs -n1 echo | sed -e "s|$PKGNAMEMASK4|\1-\2-\3|" -e "s|$PKGNAMEMASK3|\1|"
echo
"
$@
"
| xargs
-n1
echo
}
# as hack for print_name
print_shortname
()
{
#if [ "$
#echo "$@" | xargs -n1 echo | sed -e "s|$PKGNAMEMASK4|\1-\2-\3|" -e "s|$PKGNAMEMASK3|\1|"
echo
"
$@
"
| xargs
-n1
echo
|
sed
-e
"s|
$PKGNAMEMASK3
|
\1
|"
}
print_version
()
{
echo
"
$1
"
| xargs
-n1
echo
|
sed
-e
"s|
$PKGNAMEMASK4
|
\1
-
\2
-
\3
|"
-e
"s|
$PKGNAMEMASK3
|
\2
|"
...
...
@@ -262,6 +271,7 @@ cat <<EOF
Examples:
epm print info [args] print system and distro info (via distro_info command)
epm print name [from filename|for package] NN print only name of package name or package file
epm print shortname [for package] NN print only short name of package name
epm print version [from filename|for package] NN print only version of package name or package file
epm print release [from filename|for package] NN print only release of package name or package file
epm print version-release [from filename|for package] NN print only release-release of package name or package file
...
...
@@ -333,6 +343,10 @@ epm_print()
print_release
"
$@
"
fi
;;
"shortname"
)
[
-n
"
$1
"
]
||
exit
0
#fatal "Arg is missed"
print_shortname
"
$@
"
;;
"version-release"
)
[
-n
"
$1
"
]
||
fatal
"Arg is missed"
if
[
-n
"
$FNFLAG
"
]
;
then
...
...
tests/test_get_shortname.sh
View file @
cd98fc6e
...
...
@@ -24,7 +24,7 @@ check_pkgfile()
check_pkg
()
{
get_numdelim
"
$1
"
check
"
$1
"
"
$2
"
$(
../bin/epm print name
"
$1
"
)
check
"
$1
"
"
$2
"
$(
../bin/epm print
short
name
"
$1
"
)
}
echo
"check_file"
...
...
@@ -66,6 +66,8 @@ 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
check_pkg pngquant-2.17.0-alt1_0 pngquant
check_pkg java-1.8.0-openjdk-headless-0:1.8.0.362.b09 java-1.8.0-openjdk-headless
echo
echo
"check_pkg"
...
...
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