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