Commit c4ee6403 authored by Vitaly Lipatov's avatar Vitaly Lipatov

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

parents a1107eb8 b6bed3c3
Загрузку конфига
Проверить всё с кавычками
Неверно передаёт кавычки:
__separate_sudocmd()
А другие?
readlink -f — что делать и нужен ли
Нужен realfullpath
Установку пакета по URL
Использование | less теряет код возврата команды. Нужно сделать nobash решение, которое сохранит статус
Команда
......
......@@ -238,7 +238,7 @@ check_command()
simulate) # HELPCMD: simulate install with check requires
epm_cmd=simulate
;;
checkpkg|integrity) # HELPCMD: check package file integrity (checksum)
-V|checkpkg|integrity) # HELPCMD: check package file integrity (checksum)
epm_cmd=checkpkg
;;
......
......@@ -22,24 +22,20 @@ load_helper epm-query
# TODO: port or rewrite apt-file
# https://bugzilla.altlinux.org/show_bug.cgi?id=14449
# see also epm-search-file
local_content_filelist()
__alt_local_content_filelist()
{
local SYSARCH
SYSARCH=$(uname -m)
[ "$SYSARCH" = "x86_64" ] || SYSARCH=i586
load_helper epm-sh-altlinux
local REPODIR=/var/ftp/pub/ALTLinux/Sisyphus
local CI=$REPODIR/$SYSARCH/base/contents_index
local CINOA=$REPODIR/noarch/base/contents_index
local CI="$(get_local_alt_contents_index)"
# TODO: safe way to use less
#local OUTCMD="less"
#[ -n "$USETTY" ] || OUTCMD="cat"
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$" $CI $CINOA | sed -e "s|\(.*\)\t\(.*\)|\1|g"
[ -n "$USETTY" ] && echo "Search in $CI for $1..."
grep -h -- ".*$1$" $CI | sed -e "s|\(.*\)\t\(.*\)|\1|g"
} | $OUTCMD
}
......@@ -51,7 +47,7 @@ __epm_filelist_remote()
case $PMTYPE in
apt-rpm)
# TODO: use RESTful interface to prometeus? See ALT bug #29496
docmd_foreach local_content_filelist $@
docmd_foreach __alt_local_content_filelist $@
;;
*)
fatal "Query filelist for non installed packages does not realized"
......
......@@ -23,7 +23,9 @@ epm_provides_files()
{
[ -n "$pkg_files" ] || return
case $(get_package_type $pkg_files) in
local PKGTYPE="$(get_package_type $pkg_files)"
case $PKGTYPE in
rpm)
docmd rpm -q --provides -p $pkg_files
;;
......
......@@ -25,7 +25,8 @@ epm_reinstall_names()
[ -n "$1" ] || return
case $PMTYPE in
apt-rpm|apt-dpkg)
sudocmd apt-get --reinstall install $@
local APTOPTIONS="$(subst_option non_interactive -y)"
sudocmd apt-get --reinstall $APTOPTIONS install $@
return ;;
aptitude-dpkg)
sudocmd aptitude reinstall $@
......
......@@ -23,7 +23,7 @@ epm_requires_files()
{
[ -n "$pkg_files" ] || return
local PKGTYPE="$(case $(get_package_type $pkg_files))"
local PKGTYPE="$(get_package_type $pkg_files)"
case "$PKGTYPE" in
rpm)
......
......@@ -17,28 +17,19 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# TODO: port or rewrite apt-file
# https://bugzilla.altlinux.org/show_bug.cgi?id=14449
local_content_search()
__alt_local_content_search()
{
# TODO: use global get_sysarch function
local SYSARCH
SYSARCH=$(uname -m)
[ "$SYSARCH" = "x86_64" ] || SYSARCH=i586
load_helper epm-sh-altlinux
local CI="$(get_local_alt_contents_index)"
# FIXME: use config or/and web url
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"
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"
[ -n "$USETTY" ] && echo "Search in $CI for $1..."
grep -h -- ".*$1.*\t" $CI | sed -e "s|\(.*\)\t\(.*\)|\2: \1|g"
} | $OUTCMD
}
......@@ -49,7 +40,7 @@ epm_search_file()
case $PMTYPE in
apt-rpm)
local_content_search $pkg_filenames
__alt_local_content_search $pkg_filenames
return ;;
apt-dpkg|aptitude-dpkg)
assure_exists apt-file
......
#!/bin/sh
#
# Copyright (C) 2014 Etersoft
# Copyright (C) 2014 Vitaly Lipatov <lav@etersoft.ru>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# TODO: port or rewrite apt-file
# https://bugzilla.altlinux.org/show_bug.cgi?id=14449
get_local_alt_contents_index()
{
load_helper epm-repolist
epm_repolist | grep "rpm file:/" | sed -e "s|^rpm file:||g" | while read URL ARCH other ; do
test -d "$URL/$ARCH" || continue # fatal "Local mirror is not accessible via $URL/$ARCH"
FILE="$URL/$ARCH/base/contents_index"
if [ -r "$FILE" ] ; then
echo "$FILE"
else
info "TODO for girar server: There is no $(basename $FILE) file in $(dirname $FILE)"
fi
done
}
......@@ -4,4 +4,4 @@
# https://wiki.ubuntu.com/DashAsBinSh
checkbashisms -f bin/*
checkbashisms -f Makefile eepm.spec
checkbashisms -f Makefile
# This spec is backported to ALTLinux p7 automatically by rpmbph script. Do not edit it.
#
Name: eepm
Version: 1.5.1
Version: 1.5.2
Release: alt0.M70P.1
Summary: Etersoft EPM package manager
......@@ -66,9 +66,14 @@ chmod a+x %buildroot%_datadir/%name/{serv-,epm-}*
%_sysconfdir/bash_completion.d/cerv
%changelog
* Wed Mar 05 2014 Vitaly Lipatov <lav@altlinux.ru> 1.5.1-alt0.M70P.1
* Tue Mar 25 2014 Vitaly Lipatov <lav@altlinux.ru> 1.5.2-alt0.M70P.1
- backport to ALTLinux p7 (by rpmbph script)
* Tue Mar 25 2014 Vitaly Lipatov <lav@altlinux.ru> 1.5.2-alt1
- use repolist for get local repo path
- support --auto for reinstall
- epm-requires: fix typo
* Wed Mar 05 2014 Vitaly Lipatov <lav@altlinux.ru> 1.5.1-alt1
- epm: check real file detection
- checkpkg: use assure for erc
......
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