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
38cd4049
Commit
38cd4049
authored
Oct 22, 2015
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm print: add support for installed (or file) package
parent
007e2089
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
6 deletions
+19
-6
epm-print
bin/epm-print
+19
-6
No files found.
bin/epm-print
View file @
38cd4049
...
@@ -83,6 +83,7 @@ __epm_print()
...
@@ -83,6 +83,7 @@ __epm_print()
local
WHAT
=
"
$1
"
local
WHAT
=
"
$1
"
shift
shift
local
FNFLAG
=
local
FNFLAG
=
local
PKFLAG
=
[
"
$1
"
=
"from"
]
&&
shift
[
"
$1
"
=
"from"
]
&&
shift
[
"
$1
"
=
"for"
]
&&
shift
[
"
$1
"
=
"for"
]
&&
shift
[
"
$1
"
=
"in"
]
&&
shift
[
"
$1
"
=
"in"
]
&&
shift
...
@@ -91,19 +92,25 @@ __epm_print()
...
@@ -91,19 +92,25 @@ __epm_print()
shift
shift
fi
fi
if
[
"
$1
"
=
"package"
]
;
then
PKFLAG
=
"
$1
"
shift
fi
case
"
$WHAT
"
in
case
"
$WHAT
"
in
""
)
""
)
fatal
"Use epm print help for get help."
fatal
"Use epm print help for get help."
;;
;;
"-h"
|
"--help"
|
"help"
)
"-h"
|
"--help"
|
"help"
)
cat
<<
EOF
cat
<<
EOF
epm print name [from filename] NN print only name of package name or package file
Examples:
epm print version [from filename] NN print only version of package name or package file
epm print name [from filename|for package] NN print only name of package name or package file
epm print release [from filename] NN print only release 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 field FF for package NN print field of the package
epm print field FF for package NN print field of the package
epm print pkgname from filename NN print package name for package file
epm print pkgname from filename NN print package name for package file
epm print srcname from filename NN print source name for package file
epm print srcname from filename NN print source name for package file
epm print srcpkgname from
filename
NN print source package name for the binary package file
epm print srcpkgname from
[filename|package]
NN print source package name for the binary package file
epm print binpkgfilelist in DIR for NN list binary package(s) filename(s) from DIR for the source package file
epm print binpkgfilelist in DIR for NN list binary package(s) filename(s) from DIR for the source package file
EOF
EOF
;;
;;
...
@@ -111,6 +118,8 @@ EOF
...
@@ -111,6 +118,8 @@ EOF
[
-n
"
$1
"
]
||
fatal
"Arg is missed"
[
-n
"
$1
"
]
||
fatal
"Arg is missed"
if
[
-n
"
$FNFLAG
"
]
;
then
if
[
-n
"
$FNFLAG
"
]
;
then
print_name
$(
print_pkgname
"
$@
"
)
print_name
$(
print_pkgname
"
$@
"
)
elif
[
-n
"
$PKFLAG
"
]
;
then
query_package_field
"name"
"
$@
"
else
else
print_name
"
$@
"
print_name
"
$@
"
fi
fi
...
@@ -119,6 +128,8 @@ EOF
...
@@ -119,6 +128,8 @@ EOF
[
-n
"
$1
"
]
||
fatal
"Arg is missed"
[
-n
"
$1
"
]
||
fatal
"Arg is missed"
if
[
-n
"
$FNFLAG
"
]
;
then
if
[
-n
"
$FNFLAG
"
]
;
then
print_version
$(
print_pkgname
"
$@
"
)
print_version
$(
print_pkgname
"
$@
"
)
elif
[
-n
"
$PKFLAG
"
]
;
then
query_package_field
"version"
"
$@
"
else
else
print_version
"
$@
"
print_version
"
$@
"
fi
fi
...
@@ -127,6 +138,8 @@ EOF
...
@@ -127,6 +138,8 @@ EOF
[
-n
"
$1
"
]
||
fatal
"Arg is missed"
[
-n
"
$1
"
]
||
fatal
"Arg is missed"
if
[
-n
"
$FNFLAG
"
]
;
then
if
[
-n
"
$FNFLAG
"
]
;
then
print_release
$(
print_pkgname
"
$@
"
)
print_release
$(
print_pkgname
"
$@
"
)
elif
[
-n
"
$PKFLAG
"
]
;
then
query_package_field
"release"
"
$@
"
else
else
print_release
"
$@
"
print_release
"
$@
"
fi
fi
...
@@ -136,7 +149,7 @@ EOF
...
@@ -136,7 +149,7 @@ EOF
local
FIELD
=
"
$1
"
local
FIELD
=
"
$1
"
shift
shift
[
"
$1
"
=
"for"
]
&&
shift
[
"
$1
"
=
"for"
]
&&
shift
query_package_field
$FIELD
"
$@
"
query_package_field
"
$FIELD
"
"
$@
"
;;
;;
"pkgname"
)
"pkgname"
)
[
-n
"
$FNFLAG
"
]
||
fatal
"print
$WHAT
works only for filename(s)"
[
-n
"
$FNFLAG
"
]
||
fatal
"print
$WHAT
works only for filename(s)"
...
@@ -150,7 +163,7 @@ EOF
...
@@ -150,7 +163,7 @@ EOF
print_srcname
"
$@
"
print_srcname
"
$@
"
;;
;;
"srcpkgname"
)
"srcpkgname"
)
[
-n
"
$FNFLAG
"
]
||
fatal
"print
$WHAT
works only for filename(s)"
[
-n
"
$FNFLAG
"
]
||
[
-n
"
$PKFLAG
"
]
||
fatal
"print
$WHAT
works only for filename(s)"
[
-n
"
$1
"
]
||
fatal
"Arg is missed"
[
-n
"
$1
"
]
||
fatal
"Arg is missed"
print_srcpkgname
"
$@
"
print_srcpkgname
"
$@
"
;;
;;
...
...
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