Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-build-utils
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
korinf
etersoft-build-utils
Commits
bf8d03ef
Commit
bf8d03ef
authored
Feb 19, 2011
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpmqf: add deb support
parent
e2431896
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
2 deletions
+24
-2
rpmqf
bin/rpmqf
+24
-2
No files found.
bin/rpmqf
View file @
bf8d03ef
#!/bin/sh
# 2003-2006, 2009 (c) Etersoft www.etersoft.ru
# 2003-2006, 2009
, 2011
(c) Etersoft www.etersoft.ru
# Author: Vitaly Lipatov <lav@etersoft.ru>
# Public domain
#
...
...
@@ -8,6 +8,12 @@
# - название файл
# TODO not -i only, we need any key
# load common functions, compatible with local and installed script
.
`
dirname
$0
`
/../share/eterbuild/functions/common
load_mod spec rpm
if
[
"
$1
"
=
"-h"
]
;
then
echo
"rpmqf - the same as rpm -qf, but use which for search command place"
exit
0
...
...
@@ -18,6 +24,8 @@ if [ "$1" = "-i" ]; then
shift
fi
[
-n
"
$1
"
]
||
fatal
"Run with command name. See
$0
-h also."
# use and modify TOFILE recursively
real_file
()
{
...
...
@@ -45,4 +53,18 @@ real_file()
real_file
"
$1
"
rpmquery
-f
$ARG
"
$FULLFILEPATH
"
case
"
$(
$DISTRVENDOR
-p
)
"
in
"rpm"
)
rpmquery
-f
$ARG
"
$FULLFILEPATH
"
;;
"deb"
)
DPKG
=
dpkg
PACKAGE
=
$(
$DPKG
-S
"
$FULLFILEPATH
"
2>/dev/null |
head
-n1
|
sed
-e
"s|:.*||"
)
[
-n
"
$PACKAGE
"
]
||
fatal
"Can't find package for
$FULLFILEPATH
"
VERSION
=
$(
$DPKG
-s
"
$PACKAGE
"
2>/dev/null |
grep
"Version:"
|
sed
-e
"s|Version: ||g"
)
[
-n
"
$VERSION
"
]
&&
echo
"
$PACKAGE
-
$VERSION
"
||
fatal
"Can't extract version for
$PACKAGE
package"
;;
*
)
fatal
"Unsupported package system"
;;
esac
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