Commit 84dd9d6f authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm provides: add --short support for apt, separate requires by lines

parent f060d337
......@@ -30,7 +30,11 @@ epm_provides_files()
case $PKGTYPE in
rpm)
assure_exists rpm
if [ -n "$short" ] ; then
docmd rpm -q --provides -p $pkg_files | sed -e 's| .*||'
else
docmd rpm -q --provides -p $pkg_files
fi
;;
deb)
assure_exists dpkg
......@@ -59,7 +63,11 @@ case $PMTYPE in
CMD="rpm -q --provides"
else
EXTRA_SHOWDOCMD=' | grep "Provides:"'
docmd apt-cache show $pkg_names | grep "Provides:"
if [ -n "$short" ] ; then
docmd apt-cache show $pkg_names | grep "Provides:" | sed -e 's|, |\n|g' -e 's|Provides: ||' -e 's| .*||'
else
docmd apt-cache show $pkg_names | grep "Provides:" | sed -e 's|, |\n|g' -e 's|Provides: ||'
fi
return
fi
;;
......@@ -118,7 +126,11 @@ case $PMTYPE in
;;
esac
docmd $CMD $pkg_names
if [ -n "$short" ] ; then
docmd $CMD $pkg_names | sed -e 's| .*||'
else
docmd $CMD $pkg_names
fi
}
......
......@@ -81,9 +81,9 @@ case $PMTYPE in
CMD="apt-cache depends"
else
if [ -n "$short" ] ; then
LANG=C docmd apt-cache depends $pkg_names | grep "Depends:" | sed -e "s|.*Depends: ||" -e "s|<\(.*\)>|\1|" | __epm_filter_out_base_alt_reqs | sed -e "s| .*||"
LANG=C docmd apt-cache depends $pkg_names | grep "Depends:" | sed -e 's|, |\n|g' -e "s|.*Depends: ||" -e "s|<\(.*\)>|\1|" | __epm_filter_out_base_alt_reqs | sed -e "s| .*||"
else
LANG=C docmd apt-cache depends $pkg_names | grep "Depends:" | sed -e "s|.*Depends: ||" -e "s|<\(.*\)>|\1|" | __epm_filter_out_base_alt_reqs
LANG=C docmd apt-cache depends $pkg_names | grep "Depends:" | sed -e 's|, |\n|g' -e "s|.*Depends: ||" -e "s|<\(.*\)>|\1|" | __epm_filter_out_base_alt_reqs
fi
return
fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment