Commit 2eea0cdd authored by Vitaly Lipatov's avatar Vitaly Lipatov

backported to M60P as 0.9.6-alt0.M60P.1 (with rpmbph script)

parents 1d7e2436 6cc7962e
1. Разобраться с поиском по локальным пакетам
2. Дописать таблицу на вики и по ней справку
4. Проверить, что в общем всё работает
6. rpmqf, если не найдёт в локальной базе, могла бы искать в глобальной (search_file)
7. Дописать начатый reinstall (повторную установку), с --force при установке пакета
2. Дописать таблицу на вики на основании реализованных команд.
Отказаться от distr_vendor в rpm-build-altlinux-compat и использовать distr_info отсюда.
Replace rpmU with epmi
Возможность вывода/возврата команды, планируемой к выполнению
(префикс $OUTPUT перед всеми командами?)
test requies делать перед сборкой! :)
......@@ -22,7 +22,7 @@ distro()
has()
{
[ -n "$DISTROFILE" ] || exit 1
grep "$1" "$DISTROFILE" >/dev/null 2>&1
grep "$*" "$DISTROFILE" >/dev/null 2>&1
}
# Translate DISTRIB_ID to vendor name (like %_vendor does)
......@@ -93,7 +93,6 @@ if distro altlinux-release ; then
elif has "ALT Linux 4.1" ; then DISTRIB_RELEASE="4.1"
elif has Walnut ; then DISTRIB_RELEASE="4.0"
elif has 5.0 ; then DISTRIB_RELEASE="5.0"
elif has Desktop ; then DISTRIB_RELEASE="4.0"
elif has 5.1 ; then DISTRIB_RELEASE="5.1"
elif has Ziziphora ; then DISTRIB_RELEASE="5.1"
elif has "ALT Linux p5" ; then DISTRIB_RELEASE="p5"
......
......@@ -138,7 +138,7 @@ check_command()
-qf|which|belongs) # HELPCMD: query package(s) owning file
epm_cmd=query_file
;;
filesearch) # HELPCMD: search in which package a file is included
-sf|filesearch|search_file) # HELPCMD: search in which package a file is included
epm_cmd=search_file
;;
-ql|filelist) # HELPCMD: print package file list
......
......@@ -121,10 +121,10 @@ epm_install_files()
[ -z "$1" ] && return
case $PMTYPE in
apt-rpm)
apt-rpm|urpm-rpm)
docmd $SUDO rpm -Uvh --force $nodeps $@ && return
docmd $SUDO apt-get install $@
return ;;
# use install_names
;;
apt-dpkg)
docmd $SUDO dpkg -i $@
docmd $SUDO apt-get -f install
......@@ -142,9 +142,6 @@ epm_install_files()
slackpkg)
docmd $SUDO installpkg $@
return ;;
*)
fatal "Do not known appropriate install command for $PMTYPE"
;;
esac
# other systems can install file package via ordinary command
......
......@@ -18,6 +18,8 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
#
load_helper epm-packages
# TODO: combine with -qa (the difference only in return status now)
epm_query()
......@@ -36,7 +38,7 @@ case $PMTYPE in
#return
;;
*)
fatal "Do not known command for $PMTYPE"
epm_packages $pkg_filenames | grep "$pkg_filenames"
;;
esac
......
......@@ -18,6 +18,8 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
#
load_helper epm-search_file
# copied from etersoft-build-utils/bin/rpmqf
# use and modify TOFILE recursively
......@@ -85,7 +87,7 @@ __do_query()
fatal "Do not known query command for $PMTYPE"
;;
esac
docmd $CMD $@
}
......@@ -97,7 +99,7 @@ epm_query_file()
for i in $pkg_filenames ; do
real_file "$i"
__do_query $FULLFILEPATH
__do_query $FULLFILEPATH || pkg_filenames=$i epm_search_file
done
}
......@@ -38,27 +38,8 @@ epm_remove_low()
slackpkg)
docmd $SUDO removepkg $@
return ;;
*)
fatal "Do not known command for $PMTYPE"
;;
esac
return 1
}
epm_remove()
{
[ -n "$pkg_filenames" ] || fatal "Run remove without args"
epm_remove_low $pkg_filenames && return
if [ -n "$non_interactive" ] ; then
epm_remove_nonint $pkg_filenames
local RET=$?
# if not separate command, use usual command
[ "$RET" = "5" ] || return $RET
fi
epm_remove_names $pkg_filenames
}
epm_remove_names()
......@@ -122,10 +103,23 @@ epm_remove_nonint()
slackpkg)
docmd $SUDO slackpkg -batch=on -default_answer=yes remove $@
return ;;
*)
fatal "Do not known command for $PMTYPE"
;;
esac
return 5
}
epm_remove()
{
[ -n "$pkg_filenames" ] || fatal "Run remove without args"
epm_remove_low $pkg_filenames && return
if [ -n "$non_interactive" ] ; then
epm_remove_nonint $pkg_filenames
local RET=$?
# if not separate command, use usual command
[ "$RET" = "5" ] || return $RET
fi
epm_remove_names $pkg_filenames
}
......@@ -25,7 +25,7 @@ print_apt_sources_list()
#echo
#echo "$i:"
grep -v "^#" $i
done | grep -v "^$"
done | grep -v "^ *\$"
}
epm_repolist()
......
......@@ -18,12 +18,36 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
#
# https://bugzilla.altlinux.org/show_bug.cgi?id=14449
local_content_search()
{
local SYSARCH
SYSARCH=$(uname -m)
[ "$SYSARCH" = "x86_64" ] || SYSARCH=i586
local REPODIR=/var/ftp/pub/ALTLinux/Sisyphus
local CI=$REPODIR/$SYSARCH/base/contents_index
local CINOA=$REPODIR/noarch/base/contents_index
local OUTCMD="less"
[ -n "$USETTY" ] || OUTCMD="cat"
test -r $CI && test -r $CINOA || fatal "Can't locate $CI or $CINOA"
{
[ -n "$USETTY" ] && echo "Search in $CI and $CINOA for $1..."
grep -h ".*$1.*\t" $CI $CINOA | sed -e "s|\(.*\)\t\(.*\)|\2: \1|g"
} | $OUTCMD
}
epm_search_file()
{
[ -n "$pkg_filenames" ] || fatal "Run search without names"
case $PMTYPE in
apt-rpm|apt-dpkg)
apt-rpm)
local_content_search $pkg_filenames
return ;;
apt-dpkg)
docmd $SUDO apt-file update
docmd apt-file search $pkg_filenames
return ;;
......
......@@ -23,11 +23,11 @@ load_helper epm-install
epm_simulate()
{
local CMD
[ -n "$pkg_filenames" ] || fatal "Run $epm_cmd without packages"
[ -z "$pkg_filenames" ] && echo "Skip empty list" && return 0
local filenames="$(echo $pkg_filenames | filter_out_installed_packages)"
# FIXME: can't correct receive status 2 in mandriva?
[ -z "$filenames" ] && echo "Skip empty simulate list" && return 0 #&& return 2
[ -z "$filenames" ] && echo "All packages are already installed" && return 0 #&& return 2
case $PMTYPE in
apt-rpm|apt-dpkg)
......
......@@ -32,8 +32,8 @@ epm_upgrade()
CMD="yum update"
;;
urpm-rpm)
# or --auto-select
CMD="urpmi --auto-update --replace-files"
# or --auto-select --replace-files
CMD="urpmi --auto-update"
;;
zypper-rpm)
CMD="zypper dist-upgrade"
......
# This spec is backported to ALTLinux p6 automatically by rpmbph script. Do not edit it.
#
Name: eepm
Version: 0.9.5
Version: 0.9.6
Release: alt0.M60P.1
Summary: Etersoft EPM package manager
......@@ -47,9 +47,17 @@ with various distros.
%_bindir/distr_info
%changelog
* Sat Aug 04 2012 Vitaly Lipatov <lav@altlinux.ru> 0.9.5-alt0.M60P.1
* Mon Aug 06 2012 Vitaly Lipatov <lav@altlinux.ru> 0.9.6-alt0.M60P.1
- backport to ALTLinux p6 (by rpmbph script)
* Mon Aug 06 2012 Vitaly Lipatov <lav@altlinux.ru> 0.9.6-alt1
- query: default realization via epm package list
- simulate: it is ok to run with empty list
- query_file: try search in global base if failed in installed
- search_file: realize search_file on ALT Linux via grep local contents_index
- remove: allow fallback to next level if target does not supported
- install files: allow fallback to hilevel install, add urpm support
* Sat Aug 04 2012 Vitaly Lipatov <lav@altlinux.ru> 0.9.5-alt1
- epm-install: add show-command-only support
- epm: update commands variations
......
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