Commit 972e9692 authored by Vitaly Lipatov's avatar Vitaly Lipatov

backported to p8 as 2.4.4-alt0.M80P.1 (with rpmbph script)

parents cf9310bf 6d4e4977
......@@ -420,6 +420,7 @@ esac
echo "$DIST_BIT"
}
# TODO: check before calc
get_memory_size() {
local detected=0
local DIST_OS=$(get_base_os_name)
......@@ -431,7 +432,7 @@ get_memory_size() {
detected=$((`sysctl hw.physmem | sed s/"hw.physmem: "//`/1024/1024))
elif [ $DIST_OS = "linux" ]
then
detected=$((`cat /proc/meminfo | grep MemTotal | awk '{print $2}'`/1024))
[ -r /proc/meminfo ] && detected=$((`cat /proc/meminfo | grep MemTotal | awk '{print $2}'`/1024))
fi
# Exit codes only support values between 0 and 255. So use stdout.
echo $detected
......
......@@ -41,7 +41,7 @@ filter_out_installed_packages()
for i in $(cat) ; do
is_installed "$(__print_with_arch_suffix $i .x86_64)" && continue
is_installed "$(__print_with_arch_suffix $i .noarch)" && continue
is_installed $i || echo $i
echo $i
done
else
__fast_hack_for_filter_out_installed_rpm
......@@ -144,10 +144,10 @@ epm_install_names()
sudocmd aura -A $force $nodeps $@
return ;;
yum-rpm)
sudocmd yum $YUMOPTIONS install $@
sudocmd yum $YUMOPTIONS install $(echo "$*" | exp_with_arch_suffix)
return ;;
dnf-rpm)
sudocmd dnf install $@
sudocmd dnf install $(echo "$*" | exp_with_arch_suffix)
return ;;
snappy)
sudocmd snappy install $@
......@@ -217,10 +217,10 @@ epm_ni_install_names()
sudocmd aptitude -y install $@
return ;;
yum-rpm)
sudocmd yum -y $YUMOPTIONS install $@
sudocmd yum -y $YUMOPTIONS install $(echo "$*" | exp_with_arch_suffix)
return ;;
dnf-rpm)
sudocmd dnf -y $YUMOPTIONS install $@
sudocmd dnf -y $YUMOPTIONS install $(echo "$*" | exp_with_arch_suffix)
return ;;
urpm-rpm)
sudocmd urpmi --auto $URPMOPTIONS $@
......
......@@ -26,10 +26,10 @@ __print_with_arch_suffix()
local pkg="$1"
local suffix="$2"
# do not change if some suffix already exists
echo "$pkg" | grep -q "(x86-32)$" && echo "$pkg" | sed -e "s|(x86-32)$|.i686|" && return
echo "$pkg" | grep "\.x86_64$" && return
echo "$pkg" | grep "\.noarch$" && return
echo "$pkg" | grep "\.i[56]86$" && return
echo "$pkg" | grep -q "(x86-32)$" && echo "$pkg" | sed -e "s|(x86-32)$|.i686|" && return 1
echo "$pkg" | grep "\.x86_64$" && return 1
echo "$pkg" | grep "\.noarch$" && return 1
echo "$pkg" | grep "\.i[56]86$" && return 1
echo "$pkg$suffix"
}
......@@ -54,7 +54,11 @@ exp_with_arch_suffix()
# TODO: use estrlist or some function to do it
local pkg
for pkg in $(cat) ; do
__print_with_arch_suffix $pkg $suffix
# check only packages without arch
local p="$(__print_with_arch_suffix "$pkg" .i686)" || { echo "$pkg" ; continue ; }
# add arch suffix only if arch package already installed (otherwise we don't know package arch)
is_installed "$p" || { echo "$pkg" ; continue ; }
echo "$pkg.x86_64"
done
}
......@@ -90,6 +94,7 @@ _shortquery_via_packages_list()
short=1 pkg_filenames=$pkg epm_packages 2>/dev/null | grep -- "$grepexp" || res=1
done
# TODO: print in query (for user): 'warning: package $pkg is not installed'
return $res
}
......
......@@ -256,8 +256,8 @@ epm_remove()
pkg_files=''
[ -n "$pkg_names" ] || fatal "Remove: missing package(s) name."
# TODO: remove only according current arch (if x86_64)
#pkg_names="$(echo $pkg_names | exp_with_arch_suffix)"
# remove according current arch (if x86_64) by default
pkg_names="$(echo $pkg_names | exp_with_arch_suffix)"
if [ -n "$dryrun" ] ; then
info "Packages for removing:"
......
......@@ -84,7 +84,12 @@ case $PMTYPE in
slackpkg)
# FIXME
echo "Note: case sensitive search"
CMD="/usr/sbin/slackpkg search"
if [ -n "$verbose" ] ; then
CMD="/usr/sbin/slackpkg search"
else
LANG=C docmd /usr/sbin/slackpkg search $string | grep " - " | sed -e 's|.* - ||g'
return
fi
;;
homebrew)
CMD="brew search"
......@@ -167,6 +172,18 @@ __epm_search_make_grep()
fi
}
__epm_search_internal()
{
[ -n "$pkg_filenames" ] || fatal "Search: missing search argument(s)"
# it is useful for first time running
update_repo_if_needed soft
warmup_bases
__epm_search_output $(get_firstarg $pkg_filenames) | grep "$pkg_filenames"
}
# copied from korinf/tools/run-script/scripts/search
epm_search()
......
......@@ -20,9 +20,9 @@
is_warmup_allowed()
{
local MEM
MEM=$($DISTRVENDOR -m)
MEM="$($DISTRVENDOR -m)"
# disable warm if have no enough memory
[ $MEM -le 1024 ] && return 1
[ "$MEM" -le 1024 ] && return 1
return 0
}
......
......@@ -120,8 +120,11 @@ EOF
for pkg in $filenames ; do
# FIXME: -[0-0] does not work in search!
# FIXME: we need strict search here (not find gst-plugins-base if search for gst-plugins
pkg_filenames="$pkg-[0-9]" epm_search | grep -E "(installed|upgrade)" && continue
pkg_filenames="$pkg" epm_search | grep -E "(installed|upgrade)" && continue
# TODO: use short?
# use verbose for get package status
#pkg_filenames="$pkg-[0-9]" verbose=--verbose __epm_search_internal | egrep "(installed|upgrade)" && continue
#pkg_filenames="$pkg" verbose=--verbose __epm_search_internal | egrep "(installed|upgrade)" && continue
pkg_filenames="$pkg" __epm_search_internal | grep -q "^$pkg-[0-9]" && continue
res=1
info "Package '$pkg' does not found in repository."
done
......
# This spec is backported to ALTLinux p8 automatically by rpmbph script from etersoft-build-utils.
#
Name: eepm
Version: 2.4.1
Version: 2.4.4
Release: alt0.M80P.1
Summary: Etersoft EPM package manager
......@@ -90,9 +90,22 @@ rm -f %buildroot%_datadir/%name/tools_eget
%_sysconfdir/bash_completion.d/cerv
%changelog
* Tue Dec 12 2017 Vitaly Lipatov <lav@altlinux.ru> 2.4.1-alt0.M80P.1
* Fri Dec 22 2017 Vitaly Lipatov <lav@altlinux.ru> 2.4.4-alt0.M80P.1
- backport to ALTLinux p8 (by rpmbph script)
* Fri Dec 22 2017 Vitaly Lipatov <lav@altlinux.ru> 2.4.4-alt1
- distr_info: check if proc exists before use
- repack: add duplicati support
* Thu Dec 14 2017 Vitaly Lipatov <lav@altlinux.ru> 2.4.3-alt1
- implement __epm_search_internal
- full search output for Slackware only with --verbose
- fix simulate for Slackware
* Tue Dec 12 2017 Vitaly Lipatov <lav@altlinux.ru> 2.4.2-alt1
- epm-install: fix --skip-install with dnf/yum
- dnf/yum: fix install/remove current arch packages (https://bugzilla.redhat.com/show_bug.cgi?id=1525164)
* Tue Dec 12 2017 Vitaly Lipatov <lav@altlinux.ru> 2.4.1-alt1
- add teamviewer.sh for repack (ALT bug 34318)
......
#!/bin/sh -x
# It will run with two args: buildroot spec
BUILDROOT="$1"
SPEC="$2"
REQUIRES="mono-full,libgtk-sharp2"
subst "s|^\(Name: .*\)$|# Converted from original package requires\nRequires:$REQUIRES\n\1|g" $SPEC
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