Commit aa21e88f authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-install: add support for direct install ebuild

parent bf78b9f2
......@@ -41,6 +41,72 @@ filter_out_installed_packages()
esac | sed -e "s|rpm-build-altlinux-compat[^ ]*||g" | filter_strip_spaces
}
# http://ru.gentoo-wiki.com/wiki/Portage_Overlay
# http://kb.etersoft.ru/Gentoo:_Установка_продуктов_Etersoft
# http://linuxreviews.org/gentoo/ebuilds/
#
# install one ebuild
__emerge_install_ebuild()
{
local EBUILD="$1"
[ -s "$EBUILD" ] || fatal ".ebuild file '$EBUILD' is missing"
# load ebuild and get vars
. $EBUILD
[ -n "$SRC_URI" ] || fatal "Can't load SRC_URI from $EBUILD"
# try to detect tarballs
local TARBALLS=
local BASEDIR=$(dirname $EBUILD)
for i in $SRC_URI ; do
[ -s "$BASEDIR/$(basename $i)" ] || continue
TARBALLS="$TARBALLS $BASEDIR/$(basename $i)"
done
local PORTAGENAME=epm
local LP=/usr/local/portage/$PORTAGENAME
sudocmd mkdir -p $LP/
if ! grep -v "^#" /etc/make.conf | grep -q $LP ; then
sudocmd echo 'PORTDIR_OVERLAY="$LP \${PORTDIR_OVERLAY}"' >>/etc/make.conf
# Overlay name
sudocmd mkdir -p $LP/profiles/
sudocmd echo "$PORTAGENAME" > $LP/profiles/repo_name
fi
# copy tarballs
local DDIR=/usr/portage/distfiles
[ -d /var/calculate/remote/distfiles ] && DDIR=/var/calculate/remote/distfiles
sudocmd cp -f $TARBALLS $DDIR/ || return
# copy ebuild
sudocmd cp -f $EBUILD $LP/ || return
cd $LP
sudocmd ebuild $(basename $EBUILD) digest
cd -
# FIXME: more correcty get name
local PKGNAME=$(echo $EBUILD | sed -e "s|-[0-9].*||g")
sudocmd emerge -av $PKGNAME || return
}
# install ebuild list
__emerge_install()
{
local EBUILD=
#local TARBALLS=
local i
# search ebuild in the args
for i in $* ; do
if echo $i | grep -q ebuild ; then
[ -s "$EBUILD" ] || fatal "Can't find .ebuild file in $*"
__emerge_install_ebuild $i
continue
# else
# TARBALLS="$TARBALLS $i"
fi
done
}
# copied from etersoft-build-utils/share/eterbuild/functions/rpmpkg
epm_install_names()
......@@ -227,6 +293,9 @@ epm_install_files()
pkgsrc)
sudocmd pkg_add $@
return ;;
emerge)
__emerge_install $@
return ;;
pacman)
sudocmd pacman -U --noconfirm $force $nodeps $@ && return
[ -n "$nodeps" ] && return
......
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