Multiple improvements for XBPS_PREFER_BINPKG_DEPS.
- Added a new var XBPS_REPO_LIST for the conf file, to specify a list of remote repositories to be used in a masterdir. - Install all required binpkgs in one pass, if that fails install one of them at every pass. - Fixed xbps-src-chroot-helper to properly catch SIG{INT,QUIT} when -m is specified. - Misc cosmetics improvements. --HG-- extra : convert_revision : 0ad7d559477ccc1fc04ab09deb791343ee453de6
This commit is contained in:
parent
da63915397
commit
522437b90f
5 changed files with 60 additions and 20 deletions
|
@ -39,9 +39,12 @@ XBPS_COMPRESS_CMD=xz
|
||||||
|
|
||||||
#
|
#
|
||||||
# Install required build time dependencies from binary packages,
|
# Install required build time dependencies from binary packages,
|
||||||
# XBPS_PACKAGESDIR will be used in the chroot to resolve builddeps.
|
# Local repository associated with the masterdir at <masterdir>/pkg-binpkgs,
|
||||||
|
# and remote repositories specified in XBPS_REPO_LIST will be used
|
||||||
|
# to resolve build dependencies.
|
||||||
#
|
#
|
||||||
#XBPS_PREFER_BINPKG_DEPS=yes
|
#XBPS_PREFER_BINPKG_DEPS=yes
|
||||||
|
#XBPS_REPO_LIST="http://xbps.nopcode.org/repos/stable"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Build packages with your unprivileged user in the chroot thanks
|
# Build packages with your unprivileged user in the chroot thanks
|
||||||
|
|
|
@ -24,9 +24,6 @@
|
||||||
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#-
|
#-
|
||||||
|
|
||||||
# Umount stuff if SIGINT or SIGQUIT was caught
|
|
||||||
trap umount_chroot_fs INT QUIT
|
|
||||||
|
|
||||||
HANDLER="$1"
|
HANDLER="$1"
|
||||||
|
|
||||||
. @@XBPS_INSTALL_ETCDIR@@/xbps-src.conf
|
. @@XBPS_INSTALL_ETCDIR@@/xbps-src.conf
|
||||||
|
@ -35,6 +32,9 @@ if [ -n "${MASTERDIR}" ]; then
|
||||||
export XBPS_MASTERDIR="${MASTERDIR}"
|
export XBPS_MASTERDIR="${MASTERDIR}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Umount stuff if SIGINT or SIGQUIT was caught
|
||||||
|
trap umount_chroot_fs INT QUIT
|
||||||
|
|
||||||
REQFS="sys proc dev xbps"
|
REQFS="sys proc dev xbps"
|
||||||
|
|
||||||
mount_chroot_fs()
|
mount_chroot_fs()
|
||||||
|
|
|
@ -78,7 +78,7 @@ install_pkg_deps()
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -n "$XBPS_PREFER_BINPKG_DEPS" ]; then
|
if [ -n "$XBPS_PREFER_BINPKG_DEPS" ]; then
|
||||||
install_pkg_with_binpkg ${curpkg}
|
install_pkg_with_binpkg "${curpkg}"
|
||||||
if [ $? -eq 255 ]; then
|
if [ $? -eq 255 ]; then
|
||||||
# xbps-bin returned unexpected error
|
# xbps-bin returned unexpected error
|
||||||
return $?
|
return $?
|
||||||
|
@ -97,7 +97,7 @@ install_pkg_deps()
|
||||||
#
|
#
|
||||||
install_dependencies_pkg()
|
install_dependencies_pkg()
|
||||||
{
|
{
|
||||||
local pkg="$1"
|
local pkg="$1" rval pkgdep_list
|
||||||
local lpkgname=$(${XBPS_PKGDB_CMD} getpkgname ${pkg})
|
local lpkgname=$(${XBPS_PKGDB_CMD} getpkgname ${pkg})
|
||||||
local i pkgn iver reqver notinstalled_deps lver
|
local i pkgn iver reqver notinstalled_deps lver
|
||||||
|
|
||||||
|
@ -129,13 +129,32 @@ install_dependencies_pkg()
|
||||||
|
|
||||||
[ -z "$notinstalled_deps" ] && return 0
|
[ -z "$notinstalled_deps" ] && return 0
|
||||||
|
|
||||||
|
if [ -n "$XBPS_PREFER_BINPKG_DEPS" ]; then
|
||||||
|
for i in ${notinstalled_deps}; do
|
||||||
|
pkgdeplist="${pkgdeplist} \"${i}\" "
|
||||||
|
done
|
||||||
|
msg_normal "Installing required build dependencies from binpkgs..."
|
||||||
|
${fakeroot_cmd} ${fakeroot_cmd_args} ${XBPS_BIN_CMD} \
|
||||||
|
-y install ${pkgdeplist}
|
||||||
|
rval=$?
|
||||||
|
if [ $rval -eq 255 ]; then
|
||||||
|
# xbps-bin returned unexpected error (-1)
|
||||||
|
return $?
|
||||||
|
elif [ $rval -eq 0 ]; then
|
||||||
|
# Install successfully
|
||||||
|
echo
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
for i in ${notinstalled_deps}; do
|
for i in ${notinstalled_deps}; do
|
||||||
if [ -n "$XBPS_PREFER_BINPKG_DEPS" ]; then
|
if [ -n "$XBPS_PREFER_BINPKG_DEPS" ]; then
|
||||||
install_pkg_with_binpkg ${i}
|
install_pkg_with_binpkg "${i}"
|
||||||
if [ $? -eq 255 ]; then
|
rval=$?
|
||||||
|
if [ $rval -eq 255 ]; then
|
||||||
# xbps-bin returned unexpected error (-1)
|
# xbps-bin returned unexpected error (-1)
|
||||||
return $?
|
return $?
|
||||||
elif [ $? -eq 0 ]; then
|
elif [ $rval -eq 0 ]; then
|
||||||
# installed successfully
|
# installed successfully
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
@ -149,11 +168,12 @@ install_dependencies_pkg()
|
||||||
if [ $? -eq 1 ]; then
|
if [ $? -eq 1 ]; then
|
||||||
msg_normal "Installing $lpkgname dependency: $pkgn."
|
msg_normal "Installing $lpkgname dependency: $pkgn."
|
||||||
if [ -n "$XBPS_PREFER_BINPKG_DEPS" ]; then
|
if [ -n "$XBPS_PREFER_BINPKG_DEPS" ]; then
|
||||||
install_pkg_with_binpkg ${i}
|
install_pkg_with_binpkg "${i}"
|
||||||
if [ $? -eq 255 ]; then
|
rval=$?
|
||||||
|
if [ $rval -eq 255 ]; then
|
||||||
# xbps-bin returned unexpected error
|
# xbps-bin returned unexpected error
|
||||||
return $?
|
return $?
|
||||||
elif [ $? -eq 0 ]; then
|
elif [ $rval -eq 0 ]; then
|
||||||
# installed successfully
|
# installed successfully
|
||||||
continue
|
continue
|
||||||
else
|
else
|
||||||
|
|
|
@ -29,7 +29,8 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
# Umount stuff if SIGINT or SIGQUIT was caught
|
# Umount stuff if SIGINT or SIGQUIT was caught
|
||||||
trap "${sudo_cmd} @@XBPS_INSTALL_LIBEXECDIR@@/xbps-src-chroot-helper umount && exit $?" INT QUIT
|
trap "MASTERDIR=${XBPS_MASTERDIR} ${sudo_cmd} \
|
||||||
|
@@XBPS_INSTALL_LIBEXECDIR@@/xbps-src-chroot-helper umount && exit $?" INT QUIT
|
||||||
|
|
||||||
[ -n "$base_chroot" ] && return 0
|
[ -n "$base_chroot" ] && return 0
|
||||||
|
|
||||||
|
@ -150,12 +151,24 @@ create_binsh_symlink()
|
||||||
|
|
||||||
prepare_binpkg_repos()
|
prepare_binpkg_repos()
|
||||||
{
|
{
|
||||||
|
local repo
|
||||||
|
|
||||||
if [ ! -f "$XBPS_MASTERDIR/.xbps_added_local_repo" ]; then
|
if [ ! -f "$XBPS_MASTERDIR/.xbps_added_local_repo" ]; then
|
||||||
msg_normal "Registering local binpkg repo..."
|
if [ ! -f ${XBPS_PACKAGESDIR}/${xbps_machine}/pkg-index.plist ]; then
|
||||||
${chroot_cmd} $XBPS_MASTERDIR \
|
:
|
||||||
${XBPS_REPO_CMD} add /xbps_packagesdir
|
else
|
||||||
[ $? -eq 0 ] && touch -f $XBPS_MASTERDIR/.xbps_added_local_repo
|
msg_normal "Registering local binpkg repo..."
|
||||||
|
${chroot_cmd} $XBPS_MASTERDIR \
|
||||||
|
${XBPS_REPO_CMD} add /xbps_packagesdir 2>/dev/null
|
||||||
|
[ $? -eq 0 ] && touch -f \
|
||||||
|
$XBPS_MASTERDIR/.xbps_added_local_repo
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
for repo in ${XBPS_REPO_LIST}; do
|
||||||
|
${chroot_cmd} ${XBPS_MASTERDIR} ${XBPS_REPO_CMD} \
|
||||||
|
add ${repo} 2>/dev/null
|
||||||
|
[ $? -eq 0 ] && msg_normal "Registered remote repository: ${repo}"
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
create_busybox_links()
|
create_busybox_links()
|
||||||
|
@ -189,7 +202,7 @@ install_xbps_utils()
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -n "$needed" ]; then
|
if [ -n "$needed" ]; then
|
||||||
echo "=> Installing the required XBPS utils."
|
echo "=> Installing static XBPS utils into masterdir."
|
||||||
for f in bin repo uhelper; do
|
for f in bin repo uhelper; do
|
||||||
_cmd=$(which xbps-${f}.static 2>/dev/null)
|
_cmd=$(which xbps-${f}.static 2>/dev/null)
|
||||||
if [ -z "${_cmd}" ]; then
|
if [ -z "${_cmd}" ]; then
|
||||||
|
@ -233,9 +246,11 @@ xbps_chroot_handler()
|
||||||
|
|
||||||
# Reinstall xbps-src in the chroot
|
# Reinstall xbps-src in the chroot
|
||||||
if [ ! -f $XBPS_MASTERDIR/usr/local/sbin/xbps-src ]; then
|
if [ ! -f $XBPS_MASTERDIR/usr/local/sbin/xbps-src ]; then
|
||||||
|
msg_normal "Installing xbps-src in the masterdir..."
|
||||||
env in_chroot=yes LANG=C PATH=$path \
|
env in_chroot=yes LANG=C PATH=$path \
|
||||||
${chroot_cmd} $XBPS_MASTERDIR sh -c \
|
${chroot_cmd} $XBPS_MASTERDIR sh -c \
|
||||||
"cd /xbps/xbps-src && make IN_CHROOT=1 install clean"
|
"cd /xbps/xbps-src && make IN_CHROOT=1 install clean" \
|
||||||
|
2>&1 >/dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$action" = "chroot" ]; then
|
if [ "$action" = "chroot" ]; then
|
||||||
|
@ -251,6 +266,7 @@ xbps_chroot_handler()
|
||||||
${lenv} ${chroot_cmd} $XBPS_MASTERDIR sh -c \
|
${lenv} ${chroot_cmd} $XBPS_MASTERDIR sh -c \
|
||||||
"cd /xbps/srcpkgs/$pkg && xbps-src $action"
|
"cd /xbps/srcpkgs/$pkg && xbps-src $action"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
msg_normal "Exiting from the chroot on $XBPS_MASTERDIR."
|
msg_normal "Exiting from the chroot on $XBPS_MASTERDIR."
|
||||||
MASTERDIR="${XBPS_MASTERDIR}" ${sudo_cmd} \
|
MASTERDIR="${XBPS_MASTERDIR}" ${sudo_cmd} \
|
||||||
@@XBPS_INSTALL_LIBEXECDIR@@/xbps-src-chroot-helper umount
|
@@XBPS_INSTALL_LIBEXECDIR@@/xbps-src-chroot-helper umount
|
||||||
|
|
|
@ -65,6 +65,7 @@ install_pkg()
|
||||||
#
|
#
|
||||||
if [ -z "$doing_deps" ]; then
|
if [ -z "$doing_deps" ]; then
|
||||||
install_dependencies_pkg $pkg
|
install_dependencies_pkg $pkg
|
||||||
|
[ $? -ne 0 ] && return $?
|
||||||
#
|
#
|
||||||
# At this point all required deps are installed, and
|
# At this point all required deps are installed, and
|
||||||
# only remaining is the origin package; install it.
|
# only remaining is the origin package; install it.
|
||||||
|
@ -123,7 +124,7 @@ install_pkg_with_binpkg()
|
||||||
|
|
||||||
msg_normal "Installing binary pkg: $pkgpattern"
|
msg_normal "Installing binary pkg: $pkgpattern"
|
||||||
${fakeroot_cmd} ${fakeroot_cmd_args} ${XBPS_BIN_CMD} \
|
${fakeroot_cmd} ${fakeroot_cmd_args} ${XBPS_BIN_CMD} \
|
||||||
-y install "$pkgpattern"
|
-y install \""$pkgpattern\""
|
||||||
return $?
|
return $?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue