Commit 10bc7fb2 authored by Vitaly Lipatov's avatar Vitaly Lipatov

rpmU, rpmqf - put redirect to eepm

parent 7a59d995
#!/bin/sh
# 2004-2005,2010 (c) Etersoft www.etersoft.ru
# Author: Vitaly Lipatov <lav@etersoft.ru>
# Public domain
ALLOW_ROOT_USER=1
# load common functions, compatible with local and installed script
. `dirname $0`/../share/eterbuild/functions/common
load_mod gettext
if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
echog "rpmU - the same as [sudo] rpm -Uvh - update package"
echog "Usage: rpmU [package(s)]"
exit 0
fi
is_alt && FANCYPERCENT=--fancypercent
docmd $SUDO rpm -Uvh $FANCYPERCENT "$@"
echo "Use epmu from epm package manager (eepm) instead"
exec epmu "$@"
#!/bin/sh
# 2003-2006, 2009, 2011 (c) Etersoft www.etersoft.ru
# Author: Vitaly Lipatov <lav@etersoft.ru>
# Public domain
#
# Выводит, к какому пакету относится указанный файл, находимый через which
# Параметры:
# - название файл
# TODO not -i only, we need any key
echo "Use epmqf from epm package manager (eepm) instead"
exec epmqf "$@"
# 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
fi
if [ "$1" = "-i" ]; then
ARG=$1
shift
fi
[ -n "$1" ] || fatal "Run with command name. See $0 -h also."
# use and modify TOFILE recursively
real_file()
{
local LINKTO1 LINKTO
local TOFILE
# get canonical path
if [ -e "$1" ] ; then
TOFILE=$1
else
TOFILE=`which $1 2>/dev/null || echo $1`
if [ "$TOFILE" != "$1" ] ; then
echo "Note: $1 is placed as $TOFILE"
fi
fi
# get value of symbolic link
if [ -L "$TOFILE" ] ; then
LINKTO=`readlink "$TOFILE"`
echo "Note: $TOFILE is link to $LINKTO"
real_file "$LINKTO"
fi
FULLFILEPATH=`readlink -f $TOFILE`
}
real_file "$1"
parse_cmd_pre "" "$@"
case $PKGFORMAT 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
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