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. Дописать таблицу на вики на основании реализованных команд.
2. Дописать таблицу на вики и по ней справку
4. Проверить, что в общем всё работает
6. rpmqf, если не найдёт в локальной базе, могла бы искать в глобальной (search_file)
7. Дописать начатый reinstall (повторную установку), с --force при установке пакета
Отказаться от distr_vendor в rpm-build-altlinux-compat и использовать distr_info отсюда.
Replace rpmU with epmi
Возможность вывода/возврата команды, планируемой к выполнению
(префикс $OUTPUT перед всеми командами?)
test requies делать перед сборкой! :)
...@@ -22,7 +22,7 @@ distro() ...@@ -22,7 +22,7 @@ distro()
has() has()
{ {
[ -n "$DISTROFILE" ] || exit 1 [ -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) # Translate DISTRIB_ID to vendor name (like %_vendor does)
...@@ -93,7 +93,6 @@ if distro altlinux-release ; then ...@@ -93,7 +93,6 @@ if distro altlinux-release ; then
elif has "ALT Linux 4.1" ; then DISTRIB_RELEASE="4.1" elif has "ALT Linux 4.1" ; then DISTRIB_RELEASE="4.1"
elif has Walnut ; then DISTRIB_RELEASE="4.0" elif has Walnut ; then DISTRIB_RELEASE="4.0"
elif has 5.0 ; then DISTRIB_RELEASE="5.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 5.1 ; then DISTRIB_RELEASE="5.1"
elif has Ziziphora ; then DISTRIB_RELEASE="5.1" elif has Ziziphora ; then DISTRIB_RELEASE="5.1"
elif has "ALT Linux p5" ; then DISTRIB_RELEASE="p5" elif has "ALT Linux p5" ; then DISTRIB_RELEASE="p5"
......
...@@ -138,7 +138,7 @@ check_command() ...@@ -138,7 +138,7 @@ check_command()
-qf|which|belongs) # HELPCMD: query package(s) owning file -qf|which|belongs) # HELPCMD: query package(s) owning file
epm_cmd=query_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 epm_cmd=search_file
;; ;;
-ql|filelist) # HELPCMD: print package file list -ql|filelist) # HELPCMD: print package file list
......
...@@ -121,10 +121,10 @@ epm_install_files() ...@@ -121,10 +121,10 @@ epm_install_files()
[ -z "$1" ] && return [ -z "$1" ] && return
case $PMTYPE in case $PMTYPE in
apt-rpm) apt-rpm|urpm-rpm)
docmd $SUDO rpm -Uvh --force $nodeps $@ && return docmd $SUDO rpm -Uvh --force $nodeps $@ && return
docmd $SUDO apt-get install $@ # use install_names
return ;; ;;
apt-dpkg) apt-dpkg)
docmd $SUDO dpkg -i $@ docmd $SUDO dpkg -i $@
docmd $SUDO apt-get -f install docmd $SUDO apt-get -f install
...@@ -142,9 +142,6 @@ epm_install_files() ...@@ -142,9 +142,6 @@ epm_install_files()
slackpkg) slackpkg)
docmd $SUDO installpkg $@ docmd $SUDO installpkg $@
return ;; return ;;
*)
fatal "Do not known appropriate install command for $PMTYPE"
;;
esac esac
# other systems can install file package via ordinary command # other systems can install file package via ordinary command
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # 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) # TODO: combine with -qa (the difference only in return status now)
epm_query() epm_query()
...@@ -36,7 +38,7 @@ case $PMTYPE in ...@@ -36,7 +38,7 @@ case $PMTYPE in
#return #return
;; ;;
*) *)
fatal "Do not known command for $PMTYPE" epm_packages $pkg_filenames | grep "$pkg_filenames"
;; ;;
esac esac
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
# #
load_helper epm-search_file
# copied from etersoft-build-utils/bin/rpmqf # copied from etersoft-build-utils/bin/rpmqf
# use and modify TOFILE recursively # use and modify TOFILE recursively
...@@ -85,7 +87,7 @@ __do_query() ...@@ -85,7 +87,7 @@ __do_query()
fatal "Do not known query command for $PMTYPE" fatal "Do not known query command for $PMTYPE"
;; ;;
esac esac
docmd $CMD $@ docmd $CMD $@
} }
...@@ -97,7 +99,7 @@ epm_query_file() ...@@ -97,7 +99,7 @@ epm_query_file()
for i in $pkg_filenames ; do for i in $pkg_filenames ; do
real_file "$i" real_file "$i"
__do_query $FULLFILEPATH __do_query $FULLFILEPATH || pkg_filenames=$i epm_search_file
done done
} }
...@@ -38,27 +38,8 @@ epm_remove_low() ...@@ -38,27 +38,8 @@ epm_remove_low()
slackpkg) slackpkg)
docmd $SUDO removepkg $@ docmd $SUDO removepkg $@
return ;; return ;;
*)
fatal "Do not known command for $PMTYPE"
;;
esac esac
return 1 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() epm_remove_names()
...@@ -122,10 +103,23 @@ epm_remove_nonint() ...@@ -122,10 +103,23 @@ epm_remove_nonint()
slackpkg) slackpkg)
docmd $SUDO slackpkg -batch=on -default_answer=yes remove $@ docmd $SUDO slackpkg -batch=on -default_answer=yes remove $@
return ;; return ;;
*)
fatal "Do not known command for $PMTYPE"
;;
esac esac
return 5 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() ...@@ -25,7 +25,7 @@ print_apt_sources_list()
#echo #echo
#echo "$i:" #echo "$i:"
grep -v "^#" $i grep -v "^#" $i
done | grep -v "^$" done | grep -v "^ *\$"
} }
epm_repolist() epm_repolist()
......
...@@ -18,12 +18,36 @@ ...@@ -18,12 +18,36 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # 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() epm_search_file()
{ {
[ -n "$pkg_filenames" ] || fatal "Run search without names" [ -n "$pkg_filenames" ] || fatal "Run search without names"
case $PMTYPE in case $PMTYPE in
apt-rpm|apt-dpkg) apt-rpm)
local_content_search $pkg_filenames
return ;;
apt-dpkg)
docmd $SUDO apt-file update docmd $SUDO apt-file update
docmd apt-file search $pkg_filenames docmd apt-file search $pkg_filenames
return ;; return ;;
......
...@@ -23,11 +23,11 @@ load_helper epm-install ...@@ -23,11 +23,11 @@ load_helper epm-install
epm_simulate() epm_simulate()
{ {
local CMD 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)" local filenames="$(echo $pkg_filenames | filter_out_installed_packages)"
# FIXME: can't correct receive status 2 in mandriva? # 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 case $PMTYPE in
apt-rpm|apt-dpkg) apt-rpm|apt-dpkg)
......
...@@ -32,8 +32,8 @@ epm_upgrade() ...@@ -32,8 +32,8 @@ epm_upgrade()
CMD="yum update" CMD="yum update"
;; ;;
urpm-rpm) urpm-rpm)
# or --auto-select # or --auto-select --replace-files
CMD="urpmi --auto-update --replace-files" CMD="urpmi --auto-update"
;; ;;
zypper-rpm) zypper-rpm)
CMD="zypper dist-upgrade" CMD="zypper dist-upgrade"
......
# This spec is backported to ALTLinux p6 automatically by rpmbph script. Do not edit it. # This spec is backported to ALTLinux p6 automatically by rpmbph script. Do not edit it.
# #
Name: eepm Name: eepm
Version: 0.9.5 Version: 0.9.6
Release: alt0.M60P.1 Release: alt0.M60P.1
Summary: Etersoft EPM package manager Summary: Etersoft EPM package manager
...@@ -47,9 +47,17 @@ with various distros. ...@@ -47,9 +47,17 @@ with various distros.
%_bindir/distr_info %_bindir/distr_info
%changelog %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) - 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 * Sat Aug 04 2012 Vitaly Lipatov <lav@altlinux.ru> 0.9.5-alt1
- epm-install: add show-command-only support - epm-install: add show-command-only support
- epm: update commands variations - 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