Commit c8bae544 authored by Vitaly Lipatov's avatar Vitaly Lipatov

backported to p7 as 1.4.5-alt0.M70P.1 (with rpmbph script)

parents efc1a899 0944371e
......@@ -303,14 +303,18 @@ check_filenames()
quoted_args="$quoted_args \"$opt\""
}
FLAGENDOPTS=
for opt in "$@" ; do
check_command $opt && continue
check_option $opt && continue
[ "$opt" = "--" ] && FLAGENDOPTS=1 && continue
if [ -z "$FLAGENDOPTS" ] ; then
check_command $opt && continue
check_option $opt && continue
fi
check_filenames $opt
done
# if input is not console, get pkg from it too
if ! tty -s ; then
if ! inputisatty ; then
for opt in $(cat) ; do
check_filenames $opt
done
......
......@@ -17,12 +17,32 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
__epm_autoremove_altrpm()
{
local pkg
local flag=
load_helper epm-packages
echo
echo "Just remove all non -devel libs packages not need by anything"
for pkg in $(short=1 pkg_filenames= epm_packages | grep -- "^lib" | grep -v -- "-devel$" | grep -v -- ^libreoffice ) ; do
sudocmd rpm -v -e $pkg && flag=1
done
# call again for next cycle until all libs will removed
[ -n "$flag" ] && __epm_autoremove_altrpm
return 0
}
epm_autoremove()
{
case $PMTYPE in
apt-rpm)
assure_exists remove-old-kernels
# ALT Linux only
__epm_autoremove_altrpm
# ALT Linux only
sudocmd remove-old-kernels
;;
apt-dpkg)
......
......@@ -78,8 +78,7 @@ __epm_filelist_file()
;;
esac
# TODO: add less
docmd $CMD $@
docmd $CMD $@ | less
}
__epm_filelist_name()
......@@ -108,7 +107,7 @@ __epm_filelist_name()
CMD="conary query --ls"
;;
pacman)
docmd pacman -Ql $pkg_names | sed -e "s|.* ||g"
docmd pacman -Ql $pkg_names | sed -e "s|.* ||g" | less
return
;;
emerge)
......@@ -117,7 +116,7 @@ __epm_filelist_name()
;;
slackpkg)
is_installed $pkg_names || fatal "Query filelist for non installed packages does not realized"
docmd awk 'BEGIN{desk=1}{if(/^FILE LIST:$/){desk=0} else if (desk==0) {print}}' /var/log/packages/${pkg_filenames}*
docmd awk 'BEGIN{desk=1}{if(/^FILE LIST:$/){desk=0} else if (desk==0) {print}}' /var/log/packages/${pkg_filenames}* | less
return
;;
*)
......
......@@ -25,7 +25,7 @@ epm_provides_files()
case $(get_package_type $pkg_files) in
rpm)
docmd "rpm -q --provides -p"
docmd rpm -q --provides -p $pkg_files
;;
deb)
# FIXME: will we provide ourself?
......
......@@ -24,7 +24,8 @@ epm_query_package()
{
[ -n "$pkg_filenames" ] || fatal "Please, use search with some argument or run epmqa for get all packages."
# FIXME: do it better
local MGS=$(eval __epm_search_make_grep $quoted_args)
local MGS
MGS=$(eval __epm_search_make_grep $quoted_args)
EXTRA_SHOWDOCMD=$MGS
eval "pkg_filenames= epm_packages \"$(eval get_firstarg $quoted_args)\" $MGS"
}
......@@ -25,7 +25,7 @@ epm_requires_files()
case $(get_package_type $pkg_files) in
rpm)
docmd "rpm -q --requires -p"
docmd rpm -q --requires -p $pkg_files
;;
deb)
a= docmd dpkg -I $pkg_files | grep "^ *Depends:" | sed "s|^ *Depends:||g"
......
......@@ -131,7 +131,8 @@ epm_search()
{
[ -n "$pkg_filenames" ] || fatal "Please, use search with some argument"
# FIXME: do it better
local MGS=$(eval __epm_search_make_grep $quoted_args)
local MGS
MGS=$(eval __epm_search_make_grep $quoted_args)
EXTRA_SHOWDOCMD="$MGS"
eval "__epm_search_output \"$(eval get_firstarg $quoted_args)\" $MGS"
}
......@@ -18,18 +18,33 @@
#
# copied from /etc/init.d/outformat (ALT Linux)
inputisatty()
{
# check stdin
tty -s
}
isatty()
{
# Set a sane TERM required for tput
[ -n "$TERM" ] || TERM=dumb
export TERM
# check stdout
test -t 1
}
isatty2()
{
# check stderr
test -t 2
}
check_tty()
{
isatty || return
isatty2 || return
# Set a sane TERM required for tput
[ -n "$TERM" ] || TERM=dumb
export TERM
which tput >/dev/null 2>/dev/null || return
# FreeBSD does not support tput -S
echo | tput -S >/dev/null 2>/dev/null || return
......@@ -230,7 +245,7 @@ set_eatmydata()
# use if possible
which eatmydata >/dev/null 2>/dev/null || return
SUDO="$SUDO eatmydata"
tty -s && echo "Uwaga! eatmydata is installed, we will use it for disable all sync operations." >&2
isatty && echo "Uwaga! eatmydata is installed, we will use it for disable all sync operations." >&2
return 0
}
......
# This spec is backported to ALTLinux p7 automatically by rpmbph script. Do not edit it.
#
Name: eepm
Version: 1.4.4
Version: 1.4.5
Release: alt0.M70P.1
Summary: Etersoft EPM package manager
......@@ -63,9 +63,17 @@ chmod a+x %buildroot%_datadir/%name/{serv-,epm-}*
%_sysconfdir/bash_completion.d/cerv
%changelog
* Tue Oct 22 2013 Vitaly Lipatov <lav@altlinux.ru> 1.4.4-alt0.M70P.1
* Tue Oct 29 2013 Vitaly Lipatov <lav@altlinux.ru> 1.4.5-alt0.M70P.1
- backport to ALTLinux p7 (by rpmbph script)
* Tue Oct 29 2013 Vitaly Lipatov <lav@altlinux.ru> 1.4.5-alt1
- epm: check for -- after options
- fix bashisms
- epm provides/requires: fix for rpm files
- separate check input and output
- epm-filelist: add less
- realize autoremove orphaned packages (unused libs*)
* Tue Oct 22 2013 Vitaly Lipatov <lav@altlinux.ru> 1.4.4-alt1
- epm: get package names from stdin if it is pipe
- fix stderr issues
......
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