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
a35c00b6
Commit
a35c00b6
authored
Sep 16, 2013
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rewrite epm_requires and epm_provides
parent
17477ad5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
44 deletions
+57
-44
epm-provides
bin/epm-provides
+28
-19
epm-requires
bin/epm-requires
+29
-25
No files found.
bin/epm-provides
View file @
a35c00b6
...
...
@@ -19,27 +19,29 @@
load_helper epm-query
epm_provides
()
epm_provides
_files
()
{
local
CMD
[
-n
"
$pkg_filenames
"
]
||
fatal
"Run query without names"
[
-n
"
$pkg_files
"
]
||
return
# by package file
case
$PMTYPE
in
*
-rpm
)
CMD
=
"rpm -q --provides -p"
;;
# apt-dpkg)
# showcmd dpkg -s $pkg_files
# a= dpkg -s $pkg_names | grep "^Depends:" | sed "s|^Depends:||g"
# return
# ;;
*
)
fatal
"Have no suitable command for
$PMTYPE
"
;;
esac
case
$(
get_package_type
$pkg_files
)
in
rpm
)
docmd
"rpm -q --provides -p"
;;
# deb)
# a= docmd dpkg -s $pkg_names | grep "^Depends:" | sed "s|^Depends:||g"
# return
# ;;
*
)
fatal
"Have no suitable command for
$PMTYPE
"
;;
esac
}
[
-n
"
$pkg_files
"
]
&&
docmd
$CMD
$pkg_files
epm_provides_names
()
{
local
CMD
[
-n
"
$pkg_names
"
]
||
return
# by package name
case
$PMTYPE
in
...
...
@@ -83,6 +85,13 @@ case $PMTYPE in
;;
esac
[
-n
"
$pkg_names
"
]
&&
docmd
$CMD
$pkg_names
docmd
$CMD
$pkg_names
}
epm_provides
()
{
[
-n
"
$pkg_filenames
"
]
||
fatal
"Run query without names"
epm_provides_files
epm_provides_names
}
bin/epm-requires
View file @
a35c00b6
...
...
@@ -19,36 +19,33 @@
load_helper epm-query
epm_requires
()
epm_requires_files
()
{
local
CMD
[
-n
"
$pkg_filenames
"
]
||
fatal
"Run query without names"
[
-n
"
$pkg_files
"
]
||
return
# TODO: Здесь выбирать команду по расширению, а не по системному менеджеру
# В других таких случаях тоже
# В списке пакетов на установку проверять, что пакеты имеют соответствующее расширение
# by package file
case
$PMTYPE
in
apt-rpm|urpm-rpm|zypper-rpm|yum-rpm
)
CMD
=
"rpm -q --requires -p"
;;
apt-dpkg
)
if
[
-n
"
$pkg_files
"
]
;
then
case
$(
get_package_type
$pkg_files
)
in
rpm
)
docmd
"rpm -q --requires -p"
;;
deb
)
if
[
-n
"
$pkg_files
"
]
;
then
# FIXME: need package base
showcmd dpkg
-s
$pkg_files
a
=
dpkg
-s
$pkg_files
|
grep
"^Depends:"
|
sed
"s|^Depends:||g"
# FIXME: need dpkg base. some other method?
a
=
d
ocmd d
pkg
-s
$pkg_files
|
grep
"^Depends:"
|
sed
"s|^Depends:||g"
# FIXME: we need execute package name section too
# TODO: separate to two section
return
fi
;;
*
)
fatal
"Have no suitable command for
$PMTYPE
"
;;
esac
fi
;;
*
)
fatal
"Have no suitable command for
$PMTYPE
"
;;
esac
}
[
-n
"
$pkg_files
"
]
&&
docmd
$CMD
$pkg_files
epm_requires_names
()
{
local
CMD
[
-n
"
$pkg_names
"
]
||
return
# by package name
case
$PMTYPE
in
...
...
@@ -95,6 +92,13 @@ case $PMTYPE in
esac
[
-n
"
$pkg_names
"
]
&&
docmd
$CMD
$pkg_names
docmd
$CMD
$pkg_names
}
epm_requires
()
{
[
-n
"
$pkg_filenames
"
]
||
fatal
"Run query without names"
epm_requires_files
epm_requires_names
}
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