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
57d5b396
Commit
57d5b396
authored
Aug 15, 2018
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm-print: fix release output, add version-release support
parent
06b54a3e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
epm-print
bin/epm-print
+19
-3
No files found.
bin/epm-print
View file @
57d5b396
#!/bin/sh
#
# Copyright (C) 2015, 2016 Etersoft
# Copyright (C) 2008, 2015, 2016 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2015, 2016
, 2018
Etersoft
# Copyright (C) 2008, 2015, 2016
, 2018
Vitaly Lipatov <lav@etersoft.ru>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
...
...
@@ -48,7 +48,7 @@ print_binpkgfilelist()
# TODO: package name mask for every system
#PKGNAMEMASK1="\(.*\)-\([^0-9].*[^0-9]\)-\(.*[0-9].*\)"
# mask to parse package name
PKGNAMEMASK
=
"
\(
.*
\)
-
\(
[0-9].*
\)
-
\(
.*[0-9].*
\)
"
PKGNAMEMASK
=
"
\(
.*
\)
-
\(
[0-9].*
\)
-
\(
.*[0-9].*
\)
\.\(
.*
\)\.\(
.*
\)
"
print_name
()
{
...
...
@@ -65,6 +65,11 @@ print_release()
echo
"
$1
"
| xargs
-n1
echo
|
sed
-e
"s|
$PKGNAMEMASK
|
\3
|g"
}
print_version_release
()
{
echo
"
$1
"
| xargs
-n1
echo
|
sed
-e
"s|
$PKGNAMEMASK
|
\2
-
\3
|g"
}
print_pkgname
()
{
local
i
...
...
@@ -125,6 +130,7 @@ cat <<EOF
epm print name [from filename|for package] NN print only name of package name or package file
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
epm print field FF for package NN print field of the package
epm print pkgname from filename NN print package name for the package file
epm print srcname from filename NN print source name for the package file
...
...
@@ -164,6 +170,16 @@ EOF
print_release
"
$@
"
fi
;;
"version-release"
)
[
-n
"
$1
"
]
||
fatal
"Arg is missed"
if
[
-n
"
$FNFLAG
"
]
;
then
print_version_release
"
$(
print_pkgname
"
$@
"
)
"
elif
[
-n
"
$PKFLAG
"
]
;
then
echo
"
$(
query_package_field
"version"
"
$@
"
)
-
$(
query_package_field
"release"
"
$@
"
)
"
else
print_version_release
"
$@
"
fi
;;
"field"
)
[
-n
"
$1
"
]
||
fatal
"Arg is missed"
local
FIELD
=
"
$1
"
...
...
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