aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--common/hooks/do-pkg/00-gen-pkg.sh8
-rw-r--r--common/hooks/pre-pkg/04-generate-runtime-deps.sh41
-rw-r--r--common/hooks/pre-pkg/99-pkglint.sh4
-rwxr-xr-xcommon/xbps-src/libexec/build.sh4
-rw-r--r--common/xbps-src/shutils/build_dependencies.sh486
-rw-r--r--common/xbps-src/shutils/bulk.sh40
-rw-r--r--common/xbps-src/shutils/chroot.sh21
-rw-r--r--common/xbps-src/shutils/common.sh16
-rw-r--r--common/xbps-src/shutils/cross.sh13
-rw-r--r--common/xbps-src/shutils/pkgtarget.sh4
-rw-r--r--common/xbps-src/shutils/show.sh41
-rwxr-xr-xxbps-src324
13 files changed, 602 insertions, 401 deletions
diff --git a/.gitignore b/.gitignore
index 591b3507593..acc6bf33479 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,4 +7,3 @@ masterdir*
hostdir*
etc/conf
etc/virtual
-.xbps-checkvers.plist
diff --git a/common/hooks/do-pkg/00-gen-pkg.sh b/common/hooks/do-pkg/00-gen-pkg.sh
index c0ed088da9d..78ec2a1422a 100644
--- a/common/hooks/do-pkg/00-gen-pkg.sh
+++ b/common/hooks/do-pkg/00-gen-pkg.sh
@@ -32,16 +32,16 @@ genpkg() {
_preserve=${preserve:+-p}
if [ -s ${PKGDESTDIR}/rdeps ]; then
- _deps="$(<${PKGDESTDIR}/rdeps)"
+ _deps="$(cat ${PKGDESTDIR}/rdeps)"
fi
if [ -s ${PKGDESTDIR}/shlib-provides ]; then
- _shprovides="$(<${PKGDESTDIR}/shlib-provides)"
+ _shprovides="$(cat ${PKGDESTDIR}/shlib-provides)"
fi
if [ -s ${PKGDESTDIR}/shlib-requires ]; then
- _shrequires="$(<${PKGDESTDIR}/shlib-requires)"
+ _shrequires="$(cat ${PKGDESTDIR}/shlib-requires)"
fi
if [ -s ${XBPS_STATEDIR}/gitrev ]; then
- _gitrevs="$(<${XBPS_STATEDIR}/gitrev)"
+ _gitrevs="$(cat ${XBPS_STATEDIR}/gitrev)"
fi
# Stripping whitespaces
diff --git a/common/hooks/pre-pkg/04-generate-runtime-deps.sh b/common/hooks/pre-pkg/04-generate-runtime-deps.sh
index 6e45b7dd3c3..62077022711 100644
--- a/common/hooks/pre-pkg/04-generate-runtime-deps.sh
+++ b/common/hooks/pre-pkg/04-generate-runtime-deps.sh
@@ -5,7 +5,7 @@
# - Generates shlib-requires file for xbps-create(1)
add_rundep() {
- local dep="$1" i= rpkgdep= _depname= found=
+ local dep="$1" i= rpkgdep= _depname= _rdeps= found=
_depname="$($XBPS_UHELPER_CMD getpkgdepname ${dep} 2>/dev/null)"
if [ -z "${_depname}" ]; then
@@ -68,19 +68,26 @@ hook() {
exec < $depsftmp
while read f; do
lf=${f#${PKGDESTDIR}}
- if [ "${skiprdeps/${lf}/}" != "${skiprdeps}" ]; then
- msg_normal "Skipping dependency scan for ${lf}\n"
- continue
- fi
+ if [ "${skiprdeps/${lf}/}" != "${skiprdeps}" ]; then
+ msg_normal "Skipping dependency scan for ${lf}\n"
+ continue
+ fi
case "$(file -bi "$f")" in
application/x-*executable*|application/x-sharedlib*)
for nlib in $($OBJDUMP -p "$f"|grep NEEDED|awk '{print $2}'); do
- [ -z "$verify_deps" ] && verify_deps="$nlib" && continue
- found=0
+ if [ -z "$verify_deps" ]; then
+ verify_deps="$nlib"
+ continue
+ fi
for j in ${verify_deps}; do
- [[ $j == $nlib ]] && found=1 && break
+ [ "$j" != "$nlib" ] && continue
+ found_dup=1
+ break
done
- [[ $found -eq 0 ]] && verify_deps="$verify_deps $nlib"
+ if [ -z "$found_dup" ]; then
+ verify_deps="$verify_deps $nlib"
+ fi
+ unset found_dup
done
;;
esac
@@ -90,13 +97,13 @@ hook() {
#
# Add required run time packages by using required shlibs resolved
- # above, the mapping is done thru the common/shlibs file.
+ # above, the mapping is done thru the mapping_shlib_binpkg.txt file.
#
for f in ${verify_deps}; do
unset _f j rdep _rdep rdepcnt soname _pkgname _rdepver found
_f=$(echo "$f"|sed -E 's|\+|\\+|g')
- rdep="$(grep -E "^${_f}[[:blank:]]+.*$" $mapshlibs|cut -d ' ' -f2)"
- rdepcnt="$(grep -E "^${_f}[[:blank:]]+.*$" $mapshlibs|cut -d ' ' -f2|wc -l)"
+ rdep="$(grep -E "^${_f}[[:blank:]]+.*$" $mapshlibs|awk '{print $2}')"
+ rdepcnt="$(grep -E "^${_f}[[:blank:]]+.*$" $mapshlibs|awk '{print $2}'|wc -l)"
if [ -z "$rdep" ]; then
# Ignore libs by current pkg
soname=$(find ${PKGDESTDIR} -name "$f")
@@ -114,9 +121,15 @@ hook() {
_pkgname=$($XBPS_UHELPER_CMD getpkgname "$j")
# if there's a SONAME matching pkgname, use it.
for x in ${pkgname} ${subpackages}; do
- [[ $_pkgname == $x ]] && found=1 && break
+ if [ "${_pkgname}" = "${x}" ]; then
+ found=1
+ break
+ fi
done
- [[ $found ]] && _rdep=$j && break
+ if [ -n "$found" ]; then
+ _rdep=$j
+ break
+ fi
done
if [ -z "${_rdep}" ]; then
# otherwise pick up the first one.
diff --git a/common/hooks/pre-pkg/99-pkglint.sh b/common/hooks/pre-pkg/99-pkglint.sh
index ab2b215508e..7ae183ae8e8 100644
--- a/common/hooks/pre-pkg/99-pkglint.sh
+++ b/common/hooks/pre-pkg/99-pkglint.sh
@@ -119,7 +119,7 @@ hook() {
msg_red "${pkgver}: SONAME bump detected: ${libname}.so.${conflictRev} -> ${libname}.so.${rev}\n"
msg_red "${pkgver}: please update common/shlibs with this line: \"${libname}.so.${rev} ${pkgver}\"\n"
msg_red "${pkgver}: all reverse dependencies should also be revbumped to be rebuilt against ${libname}.so.${rev}:\n"
- _revdeps=$($XBPS_QUERY_XCMD -Rs ${libname}.so -p shlib-requires|cut -d ' ' -f1)
+ _revdeps=$($XBPS_QUERY_XCMD -Rs ${libname}.so -p shlib-requires|awk '{print $1}')
for x in ${_revdeps}; do
msg_red " ${x%:}\n"
done
@@ -128,7 +128,7 @@ hook() {
# Try to match provided shlibs in virtual packages.
for f in ${provides}; do
_vpkgname="$($XBPS_UHELPER_CMD getpkgname ${f} 2>/dev/null)"
- _spkgname="$(grep "^${filename}" $mapshlibs | cut -d ' ' -f2)"
+ _spkgname="$(grep "^${filename}" $mapshlibs | awk '{print $2}')"
_libpkgname="$($XBPS_UHELPER_CMD getpkgname ${_spkgname} 2>/dev/null)"
if [ -z "${_spkgname}" -o -z "${_libpkgname}" ]; then
continue
diff --git a/common/xbps-src/libexec/build.sh b/common/xbps-src/libexec/build.sh
index 1f751ca13b9..9908b336957 100755
--- a/common/xbps-src/libexec/build.sh
+++ b/common/xbps-src/libexec/build.sh
@@ -43,6 +43,10 @@ if [ "$PKGNAME" != "$XBPS_TARGET_PKG" -o -z "$XBPS_SKIP_DEPS" ]; then
install_pkg_deps $PKGNAME $XBPS_TARGET_PKG pkg $XBPS_CROSS_BUILD $XBPS_CROSS_PREPARE || exit $?
fi
+if [ -z "$XBPS_CROSS_PREPARE" ]; then
+ install_cross_pkg $XBPS_CROSS_BUILD || exit $?
+fi
+
# Fetch distfiles after installing required dependencies,
# because some of them might be required for do_fetch().
$XBPS_LIBEXECDIR/xbps-src-dofetch.sh $SOURCEPKG $XBPS_CROSS_BUILD || exit 1
diff --git a/common/xbps-src/shutils/build_dependencies.sh b/common/xbps-src/shutils/build_dependencies.sh
index 3c49fc650bc..9bf37cdfc9d 100644
--- a/common/xbps-src/shutils/build_dependencies.sh
+++ b/common/xbps-src/shutils/build_dependencies.sh
@@ -1,9 +1,9 @@
# vim: set ts=4 sw=4 et:
#
setup_pkg_depends() {
- local pkg="$1" out="$2" j _rpkgname _depname foo _deps
+ local pkg="$1" j _pkgdepname _pkgdep _rpkgname _depname _depver _replacement
- if [[ $pkg ]]; then
+ if [ -n "$pkg" ]; then
# subpkg
if declare -f ${pkg}_package >/dev/null; then
${pkg}_package
@@ -13,65 +13,85 @@ setup_pkg_depends() {
for j in ${depends}; do
_rpkgname="${j%\?*}"
_depname="${j#*\?}"
- if [[ ${_rpkgname} == virtual ]]; then
- if [ -s ${XBPS_DISTDIR}/etc/virtual ]; then
- foo=$(egrep "^${_depname}[[:blank:]]" ${XBPS_DISTDIR}/etc/virtual|cut -d ' ' -f2)
- elif [ -s ${XBPS_DISTDIR}/etc/defaults.virtual ]; then
- foo=$(egrep "^${_depname}[[:blank:]]" ${XBPS_DISTDIR}/etc/defaults.virtual|cut -d ' ' -f2)
- fi
- if [ -z "$foo" ]; then
+ _pkgdepname="$($XBPS_UHELPER_CMD getpkgdepname ${_depname} 2>/dev/null)"
+ if [ -z "${_pkgdepname}" ]; then
+ _pkgdepname="$($XBPS_UHELPER_CMD getpkgname ${_depname} 2>/dev/null)"
+ fi
+ if [ -s ${XBPS_DISTDIR}/etc/virtual ]; then
+ _replacement=$(egrep "^${_pkgdepname:-${_depname}}[[:blank:]]" ${XBPS_DISTDIR}/etc/virtual|cut -d ' ' -f2)
+ elif [ -s ${XBPS_DISTDIR}/etc/defaults.virtual ]; then
+ _replacement=$(egrep "^${_pkgdepname:-${_depname}}[[:blank:]]" ${XBPS_DISTDIR}/etc/defaults.virtual|cut -d ' ' -f2)
+ fi
+ if [ "${_rpkgname}" = "virtual" ]; then
+ if [ -z "${_replacement}" ]; then
msg_error "$pkgver: failed to resolve virtual dependency for '$j' (missing from etc/virtual)\n"
fi
- _deps+="$foo "
+ _pkgdepname="$($XBPS_UHELPER_CMD getpkgdepname ${_replacement} 2>/dev/null)"
+ if [ -z "${_pkgdepname}" ]; then
+ _pkgdepname="$($XBPS_UHELPER_CMD getpkgname ${_replacement} 2>/dev/null)"
+ fi
+ if [ -z "${_pkgdepname}" ]; then
+ _pkgdepname="${_replacement}>=0"
+ fi
+ run_depends+=" ${_depname}?${_pkgdepname}"
+ #echo "Adding dependency virtual: ${_depname}?${_pkgdepname}"
else
- foo="$($XBPS_UHELPER_CMD getpkgdepname ${_depname} 2>/dev/null)"
- if [ -z "$foo" ]; then
- foo="$($XBPS_UHELPER_CMD getpkgname ${_depname} 2>/dev/null)"
- [ -z "$foo" ] && foo="${_depname}"
+ if [ -z "${_pkgdepname}" ]; then
+ _pkgdep="${_depname}>=0"
+ else
+ _pkgdep="${_depname}"
fi
- _deps+="$foo "
+ run_depends+=" ${_pkgdep}"
fi
- run_depends+="${_depname} "
done
-
- [[ $out && $_deps ]] && echo "$_deps"
- return 0
+ for j in ${hostmakedepends}; do
+ _depname="${j%\?*}"
+ _depver=$(srcpkg_get_version ${_depname}) || exit $?
+ host_build_depends+=" ${_depname}-${_depver}"
+ done
+ if [ -n "$XBPS_CHECK_PKGS" ]; then
+ for j in ${checkdepends}; do
+ _depname="${j%\?*}"
+ _depver=$(srcpkg_get_version ${_depname}) || exit $?
+ host_check_depends+=" ${_depname}-${_depver}"
+ done
+ fi
+ for j in ${makedepends}; do
+ _depname="${j%\?*}"
+ _depver=$(srcpkg_get_version ${_depname}) || exit $?
+ build_depends+=" ${_depname}-${_depver}"
+ done
}
+# Install a required package dependency, like:
#
-# Install required package dependencies, like:
-#
-# xbps-install -AIy <pkgs>
-#
-# -A automatic mode
-# -I to ignore file conflicts
-# -y yes
+# xbps-install -IAy <pkgname>
#
# Returns 0 if package already installed or installed successfully.
# Any other error number otherwise.
#
-# SUCCESS (0): package installed successfully.
-# ENOENT (2): package missing in repositories.
-# ENXIO (6): package depends on invalid dependencies.
-# EAGAIN (11): package conflicts.
-# EEXIST (17): file conflicts in transaction (XBPS_FLAG_IGNORE_FILE_CONFLICTS unset)
-# ENODEV (19): package depends on missing dependencies.
-# ENOTSUP (95): no repositories registered.
-#
install_pkg_from_repos() {
- local cross="$1" rval tmplogf cmd
- shift
-
- [ $# -eq 0 ] && return 0
+ local pkg="$1" cross="$2" rval= tmplogf=
mkdir -p $XBPS_STATEDIR
tmplogf=${XBPS_STATEDIR}/xbps_${XBPS_TARGET_MACHINE}_bdep_${pkg}.log
- cmd=$XBPS_INSTALL_CMD
- [[ $cross ]] && cmd=$XBPS_INSTALL_XCMD
- $cmd ${XBPS_SKIP_REMOTEREPOS:+-i} -AIy "$@" >$tmplogf 2>&1
+ if [ -n "$cross" ]; then
+ $XBPS_INSTALL_XCMD -IAy "$pkg" >$tmplogf 2>&1
+ else
+ $XBPS_INSTALL_CMD -IAy "$pkg" >$tmplogf 2>&1
+ fi
rval=$?
-
+ # xbps-install can return:
+ #
+ # SUCCESS (0): package installed successfully.
+ # ENOENT (2): package missing in repositories.
+ # ENXIO (6): package depends on invalid dependencies.
+ # EAGAIN (11): package conflicts.
+ # EEXIST (17): file conflicts in transaction (XBPS_FLAG_IGNORE_FILE_CONFLICTS unset)
+ # ENODEV (19): package depends on missing dependencies.
+ # ENOTSUP (95): no repositories registered.
+ #
case "$rval" in
0) # success, check if there are errors.
errortmpf=$(mktemp) || exit 1
@@ -92,6 +112,39 @@ install_pkg_from_repos() {
}
#
+# Returns 0 if pkgpattern in $1 is matched against current installed
+# package, 1 if no match and 2 if not installed.
+#
+check_pkgdep_matched() {
+ local pkg="$1" checkver="$2" cross="$3" uhelper= pkgn= iver=
+
+ [ "$build_style" = "meta" ] && return 2
+ [ -z "$pkg" ] && return 255
+
+ pkgn="$($XBPS_UHELPER_CMD getpkgdepname ${pkg} 2>/dev/null)"
+ if [ -z "$pkgn" ]; then
+ pkgn="$($XBPS_UHELPER_CMD getpkgname ${pkg} 2>/dev/null)"
+ fi
+ [ -z "$pkgn" ] && return 255
+
+ if [ -n "$cross" ]; then
+ uhelper="$XBPS_UHELPER_XCMD"
+ else
+ uhelper="$XBPS_UHELPER_CMD"
+ fi
+
+ iver="$($uhelper $checkver $pkgn)"
+ if [ $? -eq 0 -a -n "$iver" ]; then
+ $XBPS_UHELPER_CMD pkgmatch "${pkgn}-${iver}" "${pkg}"
+ [ $? -eq 1 ] && return 0
+ else
+ return 2
+ fi
+
+ return 1
+}
+
+#
# Returns 0 if pkgpattern in $1 is installed and greater than current
# installed package, otherwise 1.
#
@@ -103,8 +156,12 @@ check_installed_pkg() {
pkgn="$($XBPS_UHELPER_CMD getpkgname ${pkg})"
[ -z "$pkgn" ] && return 2
- uhelper=$XBPS_UHELPER_CMD
- [[ $cross ]] && uhelper=$XBPS_UHELPER_XCMD
+ if [ -n "$cross" ]; then
+ uhelper="$XBPS_UHELPER_XCMD"
+ else
+ uhelper="$XBPS_UHELPER_CMD"
+ fi
+
iver="$($uhelper version $pkgn)"
if [ $? -eq 0 -a -n "$iver" ]; then
$XBPS_CMPVER_CMD "${pkgn}-${iver}" "${pkg}"
@@ -114,20 +171,42 @@ check_installed_pkg() {
return 1
}
+srcpkg_get_version() {
+ local pkg="$1"
+ # Run this in a sub-shell to avoid polluting our env.
+ (
+ unset XBPS_BINPKG_EXISTS
+ setup_pkg $pkg || exit $?
+ echo "${version}_${revision}"
+ ) || msg_error "$pkgver: failed to transform dependency $pkg\n"
+}
+
+srcpkg_get_pkgver() {
+ local pkg="$1"
+ # Run this in a sub-shell to avoid polluting our env.
+ (
+ unset XBPS_BINPKG_EXISTS
+ setup_pkg $pkg || exit $?
+ echo "${sourcepkg}-${version}_${revision}"
+ ) || msg_error "$pkgver: failed to transform dependency $pkg\n"
+}
+
#
-# Build all dependencies required to build and run.
+# Installs all dependencies required by a package.
#
install_pkg_deps() {
local pkg="$1" targetpkg="$2" target="$3" cross="$4" cross_prepare="$5"
- local _vpkg curpkgdepname
- local i j found style
+ local rval _realpkg _vpkg _curpkg curpkgdepname pkgn iver
+ local i j found rundep repo style
- local -a host_binpkg_deps binpkg_deps
- local -a host_missing_deps missing_deps missing_rdeps
+ local -a host_binpkg_deps check_binpkg_deps binpkg_deps
+ local -a host_missing_deps check_missing_deps missing_deps missing_rdeps
[ -z "$pkgname" ] && return 2
- [ -z "$XBPS_CHECK_PKGS" ] && unset checkdepends
- [[ $build_style ]] && style=" [$build_style]"
+
+ setup_pkg_depends
+
+ [ -n "$build_style" ] && style=" [$build_style]"
for s in $build_helper; do
style+=" [$s]"
@@ -139,151 +218,197 @@ install_pkg_deps() {
msg_normal "$pkgver: building${style} ...\n"
fi
+ if [ -z "$build_depends" -a -z "$host_build_depends" -a -z "$host_check_depends" -a -z "$run_depends" ]; then
+ return 0
+ fi
+
#
# Host build dependencies.
#
- if [[ ${hostmakedepends} ]]; then
- while read -r _depname _deprepover _depver _subpkg _repourl; do
- _vpkg=${_subpkg}-${_depver}
- # binary package found in a repo
- if [[ ${_depver} == ${_deprepover} ]]; then
- echo " [host] ${_vpkg}: found (${_repourl})"
- host_binpkg_deps+=("${_vpkg}")
+ for i in ${host_build_depends}; do
+ _realpkg=$($XBPS_UHELPER_CMD getpkgname "$i" 2>/dev/null)
+ check_pkgdep_matched "$i" version
+ local rval=$?
+ if [ $rval -eq 0 ]; then
+ echo " [host] ${i}: installed."
+ continue
+ elif [ $rval -eq 1 ]; then
+ iver=$($XBPS_UHELPER_CMD version ${_realpkg})
+ if [ $? -eq 0 -a -n "$iver" ]; then
+ echo " [host] ${i}: installed $iver (virtualpkg)."
continue
+ else
+ echo " [host] ${i}: unresolved build dependency!"
+ return 1
fi
- # binary package not found
- if [[ $_depname != $_subpkg ]]; then
- # subpkg, check if it's a subpkg of itself
- found=0
- for f in ${subpackages}; do
- if [[ ${_subpkg} == ${f} ]]; then
- found=1
- break
+ else
+ repo=$($XBPS_QUERY_CMD -R -prepository ${i} 2>/dev/null)
+ if [ -n "${repo}" ]; then
+ echo " [host] ${i}: found ($repo)"
+ host_binpkg_deps+=("${i}")
+ continue
+ else
+ echo " [host] ${i}: not found."
+ if [ -z "$cross" ]; then
+ if [ "${_realpkg}" = "$targetpkg" ]; then
+ msg_error "${pkg}: [host] build loop detected: ${_realpkg} <-> ${targetpkg} [depends on itself]\n"
+ elif [ "${_realpkg}" = "$pkg" ]; then
+ msg_error "${pkg}: [host] build loop detected: $pkg <-> ${_realpkg}\n"
fi
- done
- if [[ $found -eq 1 ]]; then
- echo " [host] ${_vpkg}: not found (subpkg, ignored)"
- else
- echo " [host] ${_vpkg}: not found"
- host_missing_deps+=("$_vpkg")
fi
- else
- echo " [host] ${_vpkg}: not found"
- host_missing_deps+=("$_vpkg")
fi
- done < <($XBPS_CHECKVERS_CMD ${XBPS_SKIP_REMOTEREPOS:+-i} -D $XBPS_DISTDIR -sm ${hostmakedepends})
- fi
+ fi
+ host_missing_deps+=("${i}")
+ done
#
# Host check dependencies.
#
- if [[ ${checkdepends} ]] && [[ $XBPS_CHECK_PKGS ]]; then
- while read -r _depname _deprepover _depver _subpkg _repourl; do
- _vpkg=${_subpkg}-${_depver}
- # binary package found in a repo
- if [[ ${_depver} == ${_deprepover} ]]; then
- echo " [check] ${_vpkg}: found (${_repourl})"
- host_binpkg_deps+=("${_vpkg}")
+ for i in ${host_check_depends}; do
+ _realpkg="$($XBPS_UHELPER_CMD getpkgname $i 2>/dev/null)"
+ check_pkgdep_matched "$i" version
+ local rval=$?
+ if [ $rval -eq 0 ]; then
+ echo " [check] ${i}: installed."
+ continue
+ elif [ $rval -eq 1 ]; then
+ iver=$($XBPS_UHELPER_CMD version ${_realpkg})
+ if [ $? -eq 0 -a -n "$iver" ]; then
+ echo " [check] ${i}: installed $iver (virtualpkg)."
continue
+ else
+ echo " [check] ${i}: unresolved check dependency!"
+ return 1
fi
- # binary package not found
- if [[ $_depname != $_subpkg ]]; then
- # subpkg, check if it's a subpkg of itself
- found=0
- for f in ${subpackages}; do
- if [[ ${_subpkg} == ${f} ]]; then
- found=1
- break
- fi
- done
- if [[ $found -eq 1 ]]; then
- echo " [check] ${_vpkg}: not found (subpkg, ignored)"
- else
- echo " [check] ${_vpkg}: not found"
- host_missing_deps+=("$_vpkg")
- fi
+ else
+ repo=$($XBPS_QUERY_CMD -R -prepository ${i} 2>/dev/null)
+ if [ -n "${repo}" ]; then
+ echo " [check] ${i}: found ($repo)"
+ check_binpkg_deps+=("${i}")
+ continue
else
- echo " [check] ${_vpkg}: not found"
- host_missing_deps+=("$_vpkg")
+ echo " [check] ${i}: not found."
+ if [ "${_realpkg}" = "$targetpkg" ]; then
+ msg_error "${pkg}: [check] build loop detected: ${_realpkg} <-> ${targetpkg} [depends on itself]!\n"
+ elif [ "${_realpkg}" = "$pkg" ]; then
+ msg_error "${pkg}: [check] build loop detected: $pkg <-> ${_realpkg}\n"
+ fi
fi
- done < <($XBPS_CHECKVERS_CMD ${XBPS_SKIP_REMOTEREPOS:+-i} -D $XBPS_DISTDIR -sm ${checkdepends})
- fi
+ fi
+ check_missing_deps+=("${i}")
+ done
+
#
# Target build dependencies.
#
- if [[ ${makedepends} ]]; then
- while read -r _depname _deprepover _depver _subpkg _repourl; do
- _vpkg=${_subpkg}-${_depver}
- # binary package found in a repo
- if [[ ${_depver} == ${_deprepover} ]]; then
- echo " [target] ${_vpkg}: found (${_repourl})"
- binpkg_deps+=("${_vpkg}")
+ for i in ${build_depends}; do
+ _realpkg="$($XBPS_UHELPER_CMD getpkgname $i 2>/dev/null)"
+ # Check if dependency is a subpkg, if it is, ignore it.
+ unset found
+ for j in ${subpackages}; do
+ [ "$j" = "${_realpkg}" ] && found=1 && break
+ done
+ [ -n "$found" ] && continue
+ check_pkgdep_matched "${i}" version $cross
+ local rval=$?
+ if [ $rval -eq 0 ]; then
+ echo " [target] ${i}: installed."
+ continue
+ elif [ $rval -eq 1 ]; then
+ iver=$($XBPS_UHELPER_XCMD version ${_realpkg})
+ if [ $? -eq 0 -a -n "$iver" ]; then
+ echo " [target] ${i}: installed $iver (virtualpkg)."
continue
+ else
+ echo " [target] ${i}: unresolved build dependency!"
+ return 1
fi
- # binary package not found
- if [[ $_depname != $_subpkg ]]; then
- # subpkg, check if it's a subpkg of itself
- found=0
- for f in ${subpackages}; do
- if [[ ${_subpkg} == ${f} ]]; then
- found=1
- break
- fi
- done
- if [[ $found -eq 1 ]]; then
- echo " [target] ${_vpkg}: not found (subpkg, ignored)"
- else
- echo " [target] ${_vpkg}: not found"
- missing_deps+=("$_vpkg")
- fi
+ else
+ repo=$($XBPS_QUERY_XCMD -R -prepository ${i} 2>/dev/null)
+ if [ -n "${repo}" ]; then
+ echo " [target] ${i}: found ($repo)"
+ binpkg_deps+=("${i}")
+ continue
else
- echo " [target] ${_vpkg}: not found"
- missing_deps+=("$_vpkg")
+ echo " [target] ${i}: not found."
+ if [ "${_realpkg}" = "$targetpkg" ]; then
+ msg_error "${pkg}: [target] build loop detected: ${_realpkg} <-> ${targetpkg} [depends on itself]\n"
+ elif [ "${_realpkg}" = "$pkg" ]; then
+ msg_error "${pkg}: [target] build loop detected: $pkg <-> ${_realpkg}\n"
+ fi
fi
- done < <($XBPS_CHECKVERS_XCMD ${XBPS_SKIP_REMOTEREPOS:+-i} -D $XBPS_DISTDIR -sm ${makedepends})
- fi
+ fi
+ missing_deps+=("${i}")
+ done
#
# Target run time dependencies
#
- if [[ ${depends} ]]; then
- _deps=$(setup_pkg_depends "" 1)
- while read -r _depname _deprepover _depver _subpkg _repourl; do
- _vpkg=${_subpkg}-${_depver}
- # binary package found in a repo
- if [[ ${_depver} == ${_deprepover} ]]; then
- echo " [runtime] ${_vpkg}: found (${_repourl})"
- continue
+ for i in ${run_depends}; do
+ _realpkg="${i%\?*}"
+ _curpkg="${_realpkg}"
+ _vpkg="${i#*\?}"
+ if [ "${_realpkg}" != "${_vpkg}" ]; then
+ _realpkg="${_vpkg}"
+ else
+ unset _curpkg
+ fi
+ pkgn=$($XBPS_UHELPER_CMD getpkgdepname "${_realpkg}")
+ if [ -z "$pkgn" ]; then
+ pkgn=$($XBPS_UHELPER_CMD getpkgname "${_realpkg}")
+ if [ -z "$pkgn" ]; then
+ msg_error "$pkgver: invalid runtime dependency: ${_realpkg}\n"
fi
- # binary package not found
- if [[ $_depname != $_subpkg ]]; then
- # subpkg, check if it's a subpkg of itself
- found=0
- for f in ${subpackages}; do
- if [[ ${_subpkg} == ${f} ]]; then
- found=1
- break
- fi
- done
- if [[ $found -eq 1 ]]; then
- echo " [runtime] ${_vpkg}: not found (subpkg, ignored)"
+ fi
+ # Check if dependency is a subpkg, if it is, ignore it.
+ unset found
+ for j in ${subpackages}; do
+ [ "$j" = "${pkgn}" ] && found=1 && break
+ done
+ [ -n "$found" ] && continue
+ _props=$($XBPS_QUERY_XCMD -R -ppkgver,repository ${_realpkg} 2>/dev/null)
+ if [ -n "${_props}" ]; then
+ set -- ${_props}
+ $XBPS_UHELPER_CMD pkgmatch ${1} "${_realpkg}"
+ if [ $? -eq 1 ]; then
+ if [ -n "${_curpkg}" ]; then
+ echo " [runtime] ${_curpkg}:${_realpkg} (virtual dependency): found $1 ($2)"
else
- echo " [runtime] ${_vpkg}: not found"
- missing_rdeps+=("$_vpkg")
+ echo " [runtime] ${_realpkg}: found $1 ($2)"
fi
+ shift 2
+ continue
else
- echo " [runtime] ${_vpkg}: not found"
- missing_rdeps+=("$_vpkg")
+ if [ -n "${_curpkg}" ]; then
+ echo " [runtime] ${_curpkg}:${_realpkg} (virtual dependency): not found."
+ else
+ echo " [runtime] ${_realpkg}: not found."
+ fi
fi
- done < <($XBPS_CHECKVERS_XCMD ${XBPS_SKIP_REMOTEREPOS:+-i} -D $XBPS_DISTDIR -sm $_deps)
- unset _deps
- fi
+ shift 2
+ else
+ if [ -n "${_curpkg}" ]; then
+ echo " [runtime] ${_curpkg}:${_realpkg} (virtual dependency): not found."
+ else
+ echo " [runtime] ${_realpkg}: not found."
+ fi
+ fi
+ if [ "${_realpkg}" = "$targetpkg" ]; then
+ msg_error "${pkg}: [run] build loop detected: ${_realpkg} <-> ${targetpkg} [depends on itself]\n"
+ elif [ "${_realpkg}" = "$pkg" ]; then
+ msg_error "${pkg}: [run] build loop detected: $pkg <-> ${_realpkg}\n"
+ fi
+ missing_rdeps+=("${_realpkg}")
+ done
if [ -n "$XBPS_BUILD_ONLY_ONE_PKG" ]; then
for i in ${host_missing_deps[@]}; do
msg_error "dep ${i} not found: -1 passed: instructed not to build\n"
done
+ for i in ${check_missing_deps[@]}; do
+ msg_error "dep ${i} not found: -1 passed: instructed not to build\n"
+ done
for i in ${missing_rdeps[@]}; do
msg_error "dep ${i} not found: -1 passed: instructed not to build\n"
done
@@ -304,6 +429,18 @@ install_pkg_deps() {
host_binpkg_deps+=("$i")
done
+ # Missing check dependencies, build from srcpkgs.
+ for i in ${check_missing_deps[@]}; do
+ # packages not found in repos, install from source.
+ (
+ curpkgdepname=$($XBPS_UHELPER_CMD getpkgname "$i" 2>/dev/null)
+ setup_pkg $curpkgdepname
+ exec env XBPS_DEPENDENCY=1 XBPS_BINPKG_EXISTS=1 \
+ $XBPS_LIBEXECDIR/build.sh $sourcepkg $pkg $target || exit $?
+ ) || exit $?
+ check_binpkg_deps+=("$i")
+ done
+
# Missing target dependencies, build from srcpkgs.
for i in ${missing_deps[@]}; do
# packages not found in repos, install from source.
@@ -334,25 +471,22 @@ install_pkg_deps() {
) || exit $?
done
- if [[ ${host_binpkg_deps} ]]; then
- if [ -z "$XBPS_QUIET" ]; then
- # normal messages in bold
- [[ $NOCOLORS ]] || printf "\033[1m"
- echo "=> $pkgver: installing host dependencies: ${host_binpkg_deps[@]} ..."
- [[ $NOCOLORS ]] || printf "\033[m"
- fi
- install_pkg_from_repos "" "${host_binpkg_deps[@]}"
+ if [ "$pkg" != "$targetpkg" ]; then
+ msg_normal "$pkg: building${style} (dependency of $targetpkg) ...\n"
fi
- if [[ ${binpkg_deps} ]]; then
- if [ -z "$XBPS_QUIET" ]; then
- # normal messages in bold
- [[ $NOCOLORS ]] || printf "\033[1m"
- echo "=> $pkgver: installing target dependencies: ${binpkg_deps[@]} ..."
- [[ $NOCOLORS ]] || printf "\033[m"
- fi
- install_pkg_from_repos "$cross" "${binpkg_deps[@]}"
- fi
+ for i in ${host_binpkg_deps[@]}; do
+ msg_normal "$pkgver: installing host dependency '$i' ...\n"
+ install_pkg_from_repos "${i}"
+ done
- return 0
+ for i in ${check_binpkg_deps[@]}; do
+ msg_normal "$pkgver: installing check dependency '$i' ...\n"
+ install_pkg_from_repos "${i}"
+ done
+
+ for i in ${binpkg_deps[@]}; do
+ msg_normal "$pkgver: installing target dependency '$i' ...\n"
+ install_pkg_from_repos "$i" $cross
+ done
}
diff --git a/common/xbps-src/shutils/bulk.sh b/common/xbps-src/shutils/bulk.sh
index 2d1d612c966..73947965282 100644
--- a/common/xbps-src/shutils/bulk.sh
+++ b/common/xbps-src/shutils/bulk.sh
@@ -1,11 +1,36 @@
# vim: set ts=4 sw=4 et:
+bulk_getlink() {
+ local p="${1##*/}"
+ local target="$(readlink $XBPS_SRCPKGDIR/$p)"
+
+ if [ $? -eq 0 -a -n "$target" ]; then
+ p=$target
+ fi
+ echo $p
+}
+
bulk_sortdeps() {
local _pkgs _pkg pkgs pkg found f x tmpf
- pkgs="$@"
- tmpf=$(mktemp) || exit 1
+ _pkgs="$@"
+ # Iterate over the list and make sure that only real pkgs are
+ # added to our pkglist.
+ for pkg in ${_pkgs}; do
+ found=0
+ f=$(bulk_getlink $pkg)
+ for x in ${pkgs}; do
+ if [ "$x" = "${f}" ]; then
+ found=1
+ break
+ fi
+ done
+ if [ $found -eq 0 ]; then
+ pkgs+="${f} "
+ fi
+ done
+ tmpf=$(mktemp) || exit 1
# Now make the real dependency graph of all pkgs to build.
# Perform a topological sort of all pkgs but only with build dependencies
# that are found in previous step.
@@ -13,11 +38,16 @@ bulk_sortdeps() {
_pkgs="$(./xbps-src show-build-deps $pkg 2>/dev/null)"
found=0
for x in ${_pkgs}; do
+ _pkg=$(bulk_getlink $x)
for f in ${pkgs}; do
- [[ $f == $x ]] && found=1 && echo "${pkg} ${f}" >> $tmpf
+ if [ "${f}" != "${_pkg}" ]; then
+ continue
+ fi
+ found=1
+ echo "${pkg} ${f}" >> $tmpf
done
done
- [[ $found -eq 0 ]] && echo "${pkg} ${pkg}" >> $tmpf
+ [ $found -eq 0 ] && echo "${pkg} ${pkg}" >> $tmpf
done
tsort $tmpf|tac
rm -f $tmpf
@@ -33,7 +63,7 @@ bulk_build() {
msg_error "xbps-src: cannot find xbps-checkvers(8) command!\n"
fi
- bulk_sortdeps "$(xbps-checkvers -f '%n' ${1} --distdir=$XBPS_DISTDIR)"
+ bulk_sortdeps "$(xbps-checkvers ${1} --distdir=$XBPS_DISTDIR | awk '{print $2}')"
}
bulk_update() {
diff --git a/common/xbps-src/shutils/chroot.sh b/common/xbps-src/shutils/chroot.sh
index 7e28f1120dd..17ba9dde6ca 100644
--- a/common/xbps-src/shutils/chroot.sh
+++ b/common/xbps-src/shutils/chroot.sh
@@ -169,7 +169,7 @@ chroot_handler() {
[ -z "$action" -a -z "$pkg" ] && return 1
case "$action" in
- fetch|extract|patch|configure|build|check|install|pkg|bootstrap-update|chroot)
+ fetch|extract|patch|build|check|configure|install|install-destdir|pkg|build-pkg|bootstrap-update|chroot)
chroot_prepare || return $?
chroot_init || return $?
chroot_sync_repos || return $?
@@ -181,13 +181,30 @@ chroot_handler() {
$XBPS_MASTERDIR $XBPS_DISTDIR "$XBPS_HOSTDIR" "$XBPS_CHROOT_CMD_ARGS" /bin/xbps-shell
rv=$?
else
+ [ -n "$XBPS_CROSS_BUILD" ] && arg="$arg -a $XBPS_CROSS_BUILD"
+ [ -n "$XBPS_KEEP_ALL" ] && arg="$arg -C"
+ [ -n "$NOCOLORS" ] && arg="$arg -L"
+ [ -n "$XBPS_BUILD_FORCEMODE" ] && arg="$arg -f"
+ [ -n "$XBPS_MAKEJOBS" ] && arg="$arg -j$XBPS_MAKEJOBS"
+ [ -n "$XBPS_DEBUG_PKGS" ] && arg="$arg -g"
+ [ -n "$XBPS_CHECK_PKGS" ] && arg="$arg -Q"
+ [ -n "$XBPS_BUILD_ONLY_ONE_PKG" ] && arg="$arg -1"
+ [ -n "$XBPS_QUIET" ] && arg="$arg -q"
+ [ -n "$XBPS_SKIP_DEPS" ] && arg="$arg -I"
+ [ -n "$XBPS_ALT_REPOSITORY" ] && arg="$arg -r $XBPS_ALT_REPOSITORY"
+ [ -n "$XBPS_USE_GIT_REVS" ] && arg="$arg -G"
+ [ -n "$XBPS_PKG_OPTIONS" ] && arg="$arg -o $XBPS_PKG_OPTIONS"
+ [ -n "$XBPS_TEMP_MASTERDIR" ] && arg="$arg -t -C"
+ [ -n "$XBPS_BINPKG_EXISTS" ] && arg="$arg -E"
+
+ action="$arg $action"
env -i -- PATH="/usr/bin" SHELL=/bin/sh \
HOME=/tmp IN_CHROOT=1 LC_COLLATE=C LANG=en_US.UTF-8 \
SOURCE_DATE_EPOCH="$SOURCE_DATE_EPOCH" \
XBPS_ALLOW_CHROOT_BREAKOUT="$XBPS_ALLOW_CHROOT_BREAKOUT" \
$XBPS_COMMONDIR/chroot-style/${XBPS_CHROOT_CMD:=uunshare}.sh \
$XBPS_MASTERDIR $XBPS_DISTDIR "$XBPS_HOSTDIR" "$XBPS_CHROOT_CMD_ARGS" \
- /void-packages/xbps-src $XBPS_OPTIONS $action $pkg
+ /void-packages/xbps-src $action $pkg
rv=$?
fi
diff --git a/common/xbps-src/shutils/common.sh b/common/xbps-src/shutils/common.sh
index dea6e2b3bdd..5567619f8f3 100644
--- a/common/xbps-src/shutils/common.sh
+++ b/common/xbps-src/shutils/common.sh
@@ -294,7 +294,7 @@ setup_pkg() {
XBPS_REMOVE_XCMD="env XBPS_TARGET_ARCH=$XBPS_TARGET_MACHINE $XBPS_REMOVE_CMD -r $XBPS_CROSS_BASE"
XBPS_RINDEX_XCMD="env XBPS_TARGET_ARCH=$XBPS_TARGET_MACHINE $XBPS_RINDEX_CMD"
XBPS_UHELPER_XCMD="env XBPS_TARGET_ARCH=$XBPS_TARGET_MACHINE xbps-uhelper -r $XBPS_CROSS_BASE"
- XBPS_CHECKVERS_XCMD="env XBPS_TARGET_ARCH=$XBPS_TARGET_MACHINE xbps-checkvers --repository=$XBPS_REPOSITORY"
+
else
export XBPS_TARGET_MACHINE=${XBPS_ARCH:-$XBPS_MACHINE}
unset XBPS_CROSS_BASE XBPS_CROSS_LDFLAGS XBPS_CROSS_FFLAGS
@@ -307,7 +307,7 @@ setup_pkg() {
XBPS_REMOVE_XCMD="$XBPS_REMOVE_CMD"
XBPS_RINDEX_XCMD="$XBPS_RINDEX_CMD"
XBPS_UHELPER_XCMD="$XBPS_UHELPER_CMD"
- XBPS_CHECKVERS_XCMD="$XBPS_CHECKVERS_CMD"
+
fi
export XBPS_INSTALL_XCMD XBPS_QUERY_XCMD XBPS_RECONFIGURE_XCMD \
@@ -402,7 +402,7 @@ setup_pkg() {
arch="$XBPS_TARGET_MACHINE"
fi
if [ -n "$XBPS_BINPKG_EXISTS" ]; then
- if [ "$($XBPS_QUERY_XCMD -i -R -ppkgver $pkgver 2>/dev/null)" = "$pkgver" ]; then
+ if [ "$($XBPS_QUERY_XCMD -R -ppkgver $pkgver 2>/dev/null)" = "$pkgver" ]; then
exit_and_cleanup
fi
fi
@@ -556,17 +556,17 @@ setup_pkg() {
wrksrc="$XBPS_BUILDDIR/$wrksrc"
fi
- if [ "$cross" -a "$nocross" -a "$show_problems" != "ignore-problems" ]; then
+ if [ "$cross" -a "$nocross" -a "z$show_problems" != "zignore-problems" ]; then
msg_red "$pkgver: cannot be cross compiled, exiting...\n"
msg_red "$pkgver: $nocross\n"
exit 2
- elif [ "$broken" -a "$show_problems" != "ignore-problems" ]; then
+ elif [ "$broken" -a "z$show_problems" != "zignore-problems" ]; then
msg_red "$pkgver: cannot be built, it's currently broken; see the build log:\n"
msg_red "$pkgver: $broken\n"
exit 2
fi
- if [ -n "$restricted" -a -z "$XBPS_ALLOW_RESTRICTED" -a "$show_problems" != "ignore-problems" ]; then
+ if [ -n "$restricted" -a -z "$XBPS_ALLOW_RESTRICTED" -a "z$show_problems" != "zignore-problems" ]; then
msg_red "$pkgver: does not allow redistribution of sources/binaries (restricted license).\n"
msg_red "If you really need this software, run 'echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf'\n"
exit 2
@@ -575,7 +575,9 @@ setup_pkg() {
export XBPS_STATEDIR="${XBPS_BUILDDIR}/.xbps-${sourcepkg}"
export XBPS_WRAPPERDIR="${XBPS_STATEDIR}/wrappers"
- mkdir -p $XBPS_STATEDIR $XBPS_WRAPPERDIR
+ if [ -n "$bootstrap" -a -z "$CHROOT_READY" -o -n "$IN_CHROOT" ]; then
+ mkdir -p $XBPS_WRAPPERDIR
+ fi
source_file $XBPS_COMMONDIR/environment/build-style/${build_style}.sh
diff --git a/common/xbps-src/shutils/cross.sh b/common/xbps-src/shutils/cross.sh
index e72100986dd..12c9efa9b49 100644
--- a/common/xbps-src/shutils/cross.sh
+++ b/common/xbps-src/shutils/cross.sh
@@ -24,12 +24,11 @@ remove_pkg_cross_deps() {
prepare_cross_sysroot() {
local cross="$1"
- local statefile="$XBPS_MASTERDIR/.xbps-${cross}-done"
- [ -z "$cross" -o "$cross" = "" -o -f $statefile ] && return 0
+ [ -z "$cross" -o "$cross" = "" ] && return 0
# Check for cross-vpkg-dummy available for the target arch, otherwise build it.
- pkg_available 'cross-vpkg-dummy>=0.31_1' $cross
+ pkg_available 'cross-vpkg-dummy>=0.30_1' $cross
if [ $? -eq 0 ]; then
$XBPS_LIBEXECDIR/build.sh cross-vpkg-dummy cross-vpkg-dummy pkg $cross init || return $?
fi
@@ -41,7 +40,7 @@ prepare_cross_sysroot() {
errlog=$(mktemp) || exit 1
$XBPS_INSTALL_XCMD -Syfd cross-vpkg-dummy &>$errlog
rval=$?
- if [ $rval -ne 0 ]; then
+ if [ $rval -ne 0 -a $rval -ne 17 ]; then
msg_red "failed to install cross-vpkg-dummy (error $rval)\n"
cat $errlog
rm -f $errlog
@@ -49,15 +48,11 @@ prepare_cross_sysroot() {
fi
rm -f $errlog
# Create top level symlinks in sysroot.
- XBPS_ARCH=$XBPS_TARGET_MACHINE xbps-reconfigure -r $XBPS_CROSS_BASE -f base-files &>/dev/null
+ XBPS_ARCH=$XBPS_TARGET_MACHINE xbps-reconfigure -r $XBPS_CROSS_BASE -f base-directories base-files &>/dev/null
# Create a sysroot/include and sysroot/lib symlink just in case.
ln -s usr/include ${XBPS_CROSS_BASE}/include
ln -s usr/lib ${XBPS_CROSS_BASE}/lib
- install_cross_pkg $cross || return 1
-
- touch -f $statefile
-
return 0
}
diff --git a/common/xbps-src/shutils/pkgtarget.sh b/common/xbps-src/shutils/pkgtarget.sh
index 7d3ed1c78f4..a7be624173e 100644
--- a/common/xbps-src/shutils/pkgtarget.sh
+++ b/common/xbps-src/shutils/pkgtarget.sh
@@ -54,10 +54,6 @@ remove_pkg_autodeps() {
$XBPS_RECONFIGURE_CMD -a >> $tmplogf 2>&1
echo yes | $XBPS_REMOVE_CMD -Ryod >> $tmplogf 2>&1
rval=$?
- if [ $rval -eq 0 ]; then
- echo yes | $XBPS_REMOVE_CMD -Ryod >> $tmplogf 2>&1
- rval=$?
- fi
if [ $rval -ne 0 ]; then
msg_red "${pkgver:-xbps-src}: failed to remove autodeps: (returned $rval)\n"
diff --git a/common/xbps-src/shutils/show.sh b/common/xbps-src/shutils/show.sh
index 67b2ec14810..e2fc956514e 100644
--- a/common/xbps-src/shutils/show.sh
+++ b/common/xbps-src/shutils/show.sh
@@ -61,22 +61,44 @@ show_avail() {
}
show_pkg_build_depends() {
- local f x _pkgname _srcpkg found result
+ local f x _pkgname _srcpkg _dep found result
local _deps="$1"
result=$(mktemp) || exit 1
# build time deps
for f in ${_deps}; do
+ # ignore virtual deps
+ local _rpkg="${f%\?*}"
+ local _vpkg="${f#*\?}"
+
# ignore virtual dependencies
- [[ ${f%\?*} != ${f#*\?} ]] && f=${f#*\?}
+ if [ "${_rpkg}" != "${_vpkg}" ]; then
+ f="${_vpkg}"
+ fi
unset found
# check for subpkgs
for x in ${subpackages}; do
- [[ $f == $x ]] && found=1 && break
+ _pkgname="$($XBPS_UHELPER_CMD getpkgdepname $f 2>/dev/null)"
+ if [ -z "${_pkgname}" ]; then
+ _pkgname="$($XBPS_UHELPER_CMD getpkgname $f 2>/dev/null)"
+ fi
+ if [ "${_pkgname}" = "$x" ]; then
+ found=1
+ break
+ fi
done
- [[ $found ]] && continue
- _pkgname=${f/-32bit}
+ if [ -n "$found" ]; then
+ continue
+ fi
+ _pkgname="$($XBPS_UHELPER_CMD getpkgdepname $f 2>/dev/null)"
+ if [ -z "${_pkgname}" ]; then
+ _pkgname="$($XBPS_UHELPER_CMD getpkgname $f 2>/dev/null)"
+ fi
+ if [ -z "${_pkgname}" ]; then
+ _pkgname="$f"
+ fi
+ _pkgname=${_pkgname/-32bit}
_srcpkg=$(readlink -f ${XBPS_SRCPKGDIR}/${_pkgname})
_srcpkg=${_srcpkg##*/}
echo "${_srcpkg}" >> $result
@@ -86,15 +108,18 @@ show_pkg_build_depends() {
}
show_pkg_build_deps() {
- show_pkg_build_depends "${hostmakedepends} ${makedepends} $(setup_pkg_depends '' 1)"
+ setup_pkg_depends
+ show_pkg_build_depends "${host_build_depends} ${build_depends} ${run_depends}"
}
show_pkg_hostmakedepends() {
- show_pkg_build_depends "${hostmakedepends}"
+ setup_pkg_depends
+ show_pkg_build_depends "${host_build_depends}"
}
show_pkg_makedepends() {
- show_pkg_build_depends "${makedepends}"
+ setup_pkg_depends
+ show_pkg_build_depends "${build_depends}"
}
show_pkg_build_options() {
diff --git a/xbps-src b/xbps-src
index f72cc7002c9..23d6164b18a 100755
--- a/xbps-src
+++ b/xbps-src
@@ -1,6 +1,8 @@
#!/bin/bash
# vim: set ts=4 sw=4 et:
+readonly PROGNAME="${0##*/}"
+
print_cross_targets() {
local f
for f in common/cross-profiles/*.sh; do
@@ -208,7 +210,7 @@ _EOF
check_reqhost_utils() {
local broken
- [ "$IN_CHROOT" ] && return 0
+ [ -n "$IN_CHROOT" ] && return 0
for f in ${REQHOST_UTILS}; do
if ! command -v ${f} &>/dev/null; then
@@ -216,7 +218,7 @@ check_reqhost_utils() {
broken=1
fi
done
- [ "$broken" ] && exit 1
+ [ -n "$broken" ] && exit 1
[ -z "$1" ] && return 0
for f in ${REQHOST_UTILS_BOOTSTRAP}; do
@@ -225,7 +227,24 @@ check_reqhost_utils() {
broken=1
fi
done
- [ "$broken" ] && exit 1
+ [ -n "$broken" ] && exit 1
+}
+
+check_config_vars() {
+ if [ -s "$XBPS_CONFIG_FILE" ]; then
+ . $XBPS_CONFIG_FILE &>/dev/null
+ fi
+ if [ -z "$XBPS_MASTERDIR" ]; then
+ export XBPS_MASTERDIR="${XBPS_DISTDIR}/masterdir"
+ fi
+ if [ -z "$XBPS_HOSTDIR" ]; then
+ export XBPS_HOSTDIR="${XBPS_DISTDIR}/hostdir"
+ [ ! -d $XBPS_HOSTDIR ] && mkdir -p $XBPS_HOSTDIR
+ fi
+ if [ -d "$XBPS_MASTERDIR" -a ! -w "$XBPS_MASTERDIR" ]; then
+ echo "ERROR: not enough perms for masterdir $XBPS_MASTERDIR."
+ exit 1
+ fi
}
check_build_requirements() {
@@ -245,42 +264,20 @@ check_build_requirements() {
fi
}
-chroot_check() {
- if [ -f $XBPS_MASTERDIR/.xbps_chroot_init -o "$XBPS_CHROOT_CMD" = "ethereal" ]; then
- export CHROOT_READY=1
- fi
-}
-
-check_native_arch() {
- if [ "$CHROOT_READY" ]; then
- if [ -s $XBPS_MASTERDIR/.xbps_chroot_init ]; then
- export XBPS_ARCH=$(<$XBPS_MASTERDIR/.xbps_chroot_init)
- else
- export XBPS_ARCH=$(xbps-uhelper arch)
- fi
- else
- LDD=$(ldd --version 2>&1|head -1)
- if [[ $LDD == *musl* ]]; then
- export XBPS_ARCH=${XBPS_MACHINE%-musl}-musl
- else
- # XBPS_ARCH == $(uname -m)
- export XBPS_ARCH=$(uname -m)
- fi
- fi
-}
-
install_bbootstrap() {
- [ "$CHROOT_READY" ] && return
+ [ -n "$CHROOT_READY" ] && return
if [ "$1" = "bootstrap" ]; then
unset XBPS_TARGET_PKG XBPS_INSTALL_ARGS
else
XBPS_TARGET_PKG="$1"
fi
- [ "$XBPS_SKIP_REMOTEREPOS" ] && unset XBPS_INSTALL_ARGS
+ if [ -n "$XBPS_SKIP_REMOTEREPOS" ]; then
+ unset XBPS_INSTALL_ARGS
+ fi
# binary bootstrap
msg_normal "Installing bootstrap from binary package repositories...\n"
# XBPS_TARGET_PKG == arch
- if [ "$XBPS_TARGET_PKG" ]; then
+ if [ -n "$XBPS_TARGET_PKG" ]; then
_bootstrap_arch="env XBPS_TARGET_ARCH=$XBPS_TARGET_PKG"
if [ "${XBPS_TARGET_PKG}" != "${XBPS_TARGET_PKG#*-}" ]; then
_subarch="-${XBPS_TARGET_PKG#*-}"
@@ -311,15 +308,17 @@ reconfigure_bootstrap_pkgs() {
# Reconfigure ca-certificates.
msg_normal "Reconfiguring bootstrap packages...\n"
for f in ${pkgs}; do
- if $XBPS_QUERY_CMD $f &>/dev/null; then
- $XBPS_RECONFIGURE_CMD -f $f
+ if xbps-query $f &>/dev/null; then
+ xbps-reconfigure -f $f
fi
done
touch -f $statefile
}
bootstrap_update() {
- [ -z "$CHROOT_READY" ] && return
+ if [ -z "$CHROOT_READY" ]; then
+ return
+ fi
remove_pkg_autodeps
msg_normal "xbps-src: cleaning up masterdir...\n"
rm -rf $XBPS_MASTERDIR/builddir $XBPS_MASTERDIR/destdir
@@ -348,7 +347,7 @@ masterdir_zap() {
exit_func() {
wait
- if [ "$sourcepkg" ]; then
+ if [ -n "$sourcepkg" ]; then
remove_pkg $XBPS_CROSS_BUILD
fi
if [ -z "$IN_CHROOT" ]; then
@@ -391,17 +390,14 @@ setup_distfiles_mirror() {
done
}
-#
-# main()
-#
-readonly PROGNAME="${0##*/}"
readonly XBPS_VERSION_REQ="0.55"
-XBPS_VERSION=$(xbps-uhelper -V)
-XBPS_VERSION=${XBPS_VERSION%%API*}
-XBPS_VERSION=${XBPS_VERSION##*:}
+readonly XBPS_VERSION=$(xbps-uhelper -V|awk '{print $2}')
readonly XBPS_SRC_VERSION="113"
-export XBPS_MACHINE=$(xbps-uhelper -C /dev/null arch)
+export XBPS_MACHINE=$(xbps-uhelper arch)
+#
+# main()
+#
XBPS_OPTIONS=
XBPS_OPTSTRING="1a:CEfgGhH:iIj:Lm:No:qQr:tV"
@@ -411,26 +407,26 @@ eval set -- $(getopt "$XBPS_OPTSTRING" "$@");
while getopts "$XBPS_OPTSTRING" opt; do
case $opt in
1) export XBPS_BUILD_ONLY_ONE_PKG=yes; XBPS_OPTIONS+=" -1";;
- a) export XBPS_CROSS_BUILD="$OPTARG"; XBPS_OPTIONS+=" -a $OPTARG";;
- C) export XBPS_KEEP_ALL=1; XBPS_OPTIONS+=" -C";;
+ a) readonly XBPS_CROSS_BUILD="$OPTARG"; XBPS_OPTIONS+=" -a $OPTARG";;
+ C) readonly XBPS_KEEP_ALL=1; XBPS_OPTIONS+=" -C";;
E) export XBPS_BINPKG_EXISTS=1; XBPS_OPTIONS+=" -E";;
- f) export XBPS_BUILD_FORCEMODE=1; XBPS_OPTIONS+=" -f";;
- G) export XBPS_USE_GIT_REVS=1; XBPS_OPTIONS+=" -G";;
- g) export XBPS_DEBUG_PKGS=1; XBPS_OPTIONS+=" -g";;
- H) export XBPS_HOSTDIR="$(readlink -f $OPTARG 2>/dev/null)"; XBPS_OPTIONS+=" -H $XBPS_HOSTDIR";;
+ f) readonly XBPS_BUILD_FORCEMODE=1; XBPS_OPTIONS+=" -f";;
+ G) readonly XBPS_USE_GIT_REVS=1; XBPS_OPTIONS+=" -G";;
+ g) readonly XBPS_DEBUG_PKGS=1; XBPS_OPTIONS+=" -g";;
+ H) readonly XBPS_HOSTDIR="$(readlink -f $OPTARG 2>/dev/null)"; XBPS_OPTIONS+=" -H $XBPS_HOSTDIR";;
h) usage && exit 0;;
i) export XBPS_INFORMATIVE_RUN=1; XBPS_OPTIONS+=" -i";;
- I) export XBPS_SKIP_DEPS=1; XBPS_OPTIONS+=" -I";;
+ I) readonly XBPS_SKIP_DEPS=1; XBPS_OPTIONS+=" -I";;
j) export XBPS_MAKEJOBS="$OPTARG"; XBPS_OPTIONS+=" -j $OPTARG";;
L) export NOCOLORS=1; XBPS_OPTIONS+=" -L";;
- m) export XBPS_MASTERDIR=$(readlink -f $OPTARG 2>/dev/null); XBPS_OPTIONS+=" -m $XBPS_MASTERDIR";;
- N) export XBPS_SKIP_REMOTEREPOS=1; XBPS_OPTIONS+=" -N";;
- o) export XBPS_PKG_OPTIONS="$OPTARG"; XBPS_OPTIONS+=" -o $OPTARG";;
+ m) readonly XBPS_MASTERDIR=$(readlink -f $OPTARG 2>/dev/null); XBPS_OPTIONS+=" -m $XBPS_MASTERDIR";;
+ N) readonly XBPS_SKIP_REMOTEREPOS=1; XBPS_OPTIONS+=" -N";;
+ o) readonly XBPS_PKG_OPTIONS="$OPTARG"; XBPS_OPTIONS+=" -o $OPTARG";;
q) export XBPS_QUIET=1; XBPS_OPTIONS+=" -q";;
Q) export XBPS_CHECK_PKGS=1; XBPS_OPTIONS+=" -Q";;
- r) export XBPS_ALT_REPOSITORY="$OPTARG"; XBPS_OPTIONS+=" -r $OPTARG";;
+ r) readonly XBPS_ALT_REPOSITORY="$OPTARG"; XBPS_OPTIONS+=" -r $OPTARG";;
t) export XBPS_TEMP_MASTERDIR=1; XBPS_OPTIONS+=" -t -C";;
- V) echo "xbps-src-$XBPS_SRC_VERSION $(xbps-uhelper -V)" && exit 0;;
+ V) echo $XBPS_SRC_VERSION && exit 0;;
--) shift; break;;
esac
done
@@ -441,11 +437,10 @@ shift $(($OPTIND - 1))
# Check if stdout is a tty; if false disable colors.
test -t 1 || export NOCOLORS=1
# http://no-color.org
-if [ "${NO_COLOR+x}" ]; then
+if [ -n "${NO_COLOR+x}" ]; then
export NOCOLORS=1
fi
-# sane umask
umask 022
#
@@ -461,13 +456,22 @@ readonly REQHOST_UTILS="xbps-install xbps-query xbps-rindex xbps-uhelper \
check_reqhost_utils
-#
-# Set XBPS_CONFIG_FILE, XBPS_DISTDIR, XBPS_MASTERDIR
-# and XBPS_HOSTDIR.
-#
-if [ "$IN_CHROOT" ]; then
+# Try using chroot-git then git from the host system
+if command -v chroot-git &>/dev/null; then
+ XBPS_GIT_CMD=$(command -v chroot-git)
+elif command -v git &>/dev/null; then
+ XBPS_GIT_CMD=$(command -v git)
+else
+ echo "neither chroot-git or git are available in your system!"
+ exit 1
+fi
+
+readonly XBPS_GIT_CMD
+
+if [ -n "$IN_CHROOT" ]; then
readonly XBPS_CONFIG_FILE=/etc/xbps/xbps-src.conf
readonly XBPS_DISTDIR=/void-packages
+ # needed before call to check_config_vars
readonly XBPS_MASTERDIR=/
readonly XBPS_HOSTDIR=/host
else
@@ -487,37 +491,18 @@ else
elif [ -s $HOME/.xbps-src.conf ]; then
# ... fallback to ~/.xbps-src.conf otherwise.
readonly XBPS_CONFIG_FILE=$HOME/.xbps-src.conf
+ . $XBPS_CONFIG_FILE
fi
fi
-# Read settings from config file
-[ -s "$XBPS_CONFIG_FILE" ] && . $XBPS_CONFIG_FILE &>/dev/null
-
-# if XBPS_MASTERDIR unset, defaults to $XBPS_DISTDIR/masterdir.
-: ${XBPS_MASTERDIR:=$XBPS_DISTDIR/masterdir}
-
-# if XBPS_HOSTDIR unset, defaults to $XBPS_DISTDIR/hostdir.
-: ${XBPS_HOSTDIR:=$XBPS_DISTDIR/hostdir}
-mkdir -p $XBPS_MASTERDIR $XBPS_HOSTDIR
-
-if [ -d "$XBPS_MASTERDIR" -a ! -w "$XBPS_MASTERDIR" ]; then
- echo "ERROR: can't write to masterdir $XBPS_MASTERDIR."
- exit 1
-elif [ -d "$XBPS_HOSTDIR" -a ! -w "$XBPS_HOSTDIR" ]; then
- echo "ERROR: can't write to hostdir: $XBPS_HOSTDIR."
- exit 1
-fi
+#
+# Check configuration vars before anyting else, and set defaults vars.
+#
+check_config_vars
-# Try using chroot-git then git from the host system
-if command -v chroot-git &>/dev/null; then
- XBPS_GIT_CMD=$(command -v chroot-git)
-elif command -v git &>/dev/null; then
- XBPS_GIT_CMD=$(command -v git)
-else
- echo "neither chroot-git or git are available in your system!"
- exit 1
-fi
-readonly XBPS_GIT_CMD
+for f in $XBPS_DISTDIR/common/xbps-src/shutils/*.sh; do
+ [ -r $f ] && . $f
+done
if [ -n "$XBPS_HOSTDIR" ]; then
export XBPS_REPOSITORY=$XBPS_HOSTDIR/binpkgs
@@ -531,62 +516,80 @@ fi
if [ -z "$XBPS_ALT_REPOSITORY" ]; then
pushd "$PWD" &>/dev/null
cd $XBPS_DISTDIR
- _gitbranch="$($XBPS_GIT_CMD symbolic-ref --short HEAD 2>/dev/null)"
- if [ "${_gitbranch}" -a "${_gitbranch}" != "master" ]; then
+ if [ -n "$IN_CHROOT" ]; then
+ _gitbranch="$(chroot-git symbolic-ref --short HEAD 2>/dev/null)"
+ else
+ _gitbranch="$($XBPS_GIT_CMD symbolic-ref --short HEAD 2>/dev/null)"
+ fi
+ if [ -n "${_gitbranch}" -a "${_gitbranch}" != "master" ]; then
export XBPS_ALT_REPOSITORY="${_gitbranch}"
export XBPS_REPOSITORY="${XBPS_REPOSITORY}/${_gitbranch}"
+ if [ -z "$IN_CHROOT" ]; then
+ msg_normal "Using \`$XBPS_REPOSITORY\' as local repository.\n"
+ fi
fi
popd &>/dev/null
else
export XBPS_REPOSITORY="${XBPS_REPOSITORY}/${XBPS_ALT_REPOSITORY}"
+ if [ -z "$IN_CHROOT" ]; then
+ msg_normal "Using \`$XBPS_REPOSITORY\' as local repository.\n"
+ fi
fi
-readonly XBPS_SRCPKGDIR=$XBPS_DISTDIR/srcpkgs
-readonly XBPS_COMMONDIR=$XBPS_DISTDIR/common
-readonly XBPS_SHUTILSDIR=$XBPS_COMMONDIR/xbps-src/shutils
-readonly XBPS_TRIGGERSDIR=$XBPS_SRCPKGDIR/xbps-triggers/files
-readonly XBPS_CROSSPFDIR=$XBPS_COMMONDIR/cross-profiles
-readonly XBPS_BUILDSTYLEDIR=$XBPS_COMMONDIR/build-style
-readonly XBPS_LIBEXECDIR=$XBPS_COMMONDIR/xbps-src/libexec
-readonly XBPS_BUILDHELPERDIR=$XBPS_COMMONDIR/build-helper
-
-if [ "$IN_CHROOT" ]; then
+if [ -n "$IN_CHROOT" ]; then
readonly XBPS_UHELPER_CMD="xbps-uhelper"
- readonly XBPS_INSTALL_CMD="xbps-install --repository=$XBPS_REPOSITORY"
- readonly XBPS_QUERY_CMD="xbps-query --repository=$XBPS_REPOSITORY"
+ readonly XBPS_INSTALL_CMD="xbps-install"
+ readonly XBPS_QUERY_CMD="xbps-query"
+ readonly XBPS_RINDEX_CMD="xbps-rindex"
readonly XBPS_RECONFIGURE_CMD="xbps-reconfigure"
readonly XBPS_REMOVE_CMD="xbps-remove"
- readonly XBPS_CHECKVERS_CMD="xbps-checkvers --repository=$XBPS_REPOSITORY"
+ readonly XBPS_SRCPKGDIR=/void-packages/srcpkgs
+ readonly XBPS_COMMONDIR=/void-packages/common
readonly XBPS_DESTDIR=/destdir
readonly XBPS_BUILDDIR=/builddir
+ readonly XBPS_SHUTILSDIR=$XBPS_COMMONDIR/xbps-src/shutils
+ readonly XBPS_TRIGGERSDIR=$XBPS_SRCPKGDIR/xbps-triggers/files
+ readonly XBPS_CROSSPFDIR=$XBPS_COMMONDIR/cross-profiles
+ readonly XBPS_BUILDSTYLEDIR=$XBPS_COMMONDIR/build-style
+ readonly XBPS_LIBEXECDIR=$XBPS_COMMONDIR/xbps-src/libexec
+ readonly XBPS_BUILDHELPERDIR=$XBPS_COMMONDIR/build-helper
else
readonly XBPS_UHELPER_CMD="xbps-uhelper -r $XBPS_MASTERDIR"
- readonly XBPS_INSTALL_CMD="xbps-install -c $XBPS_HOSTDIR/repocache --repository=$XBPS_REPOSITORY -r $XBPS_MASTERDIR"
- readonly XBPS_QUERY_CMD="xbps-query -c $XBPS_HOSTDIR/repocache --repository=$XBPS_REPOSITORY -r $XBPS_MASTERDIR"
+ readonly XBPS_INSTALL_CMD="xbps-install -C /dev/null -c $XBPS_HOSTDIR/repocache --repository=$XBPS_REPOSITORY -r $XBPS_MASTERDIR"
+ readonly XBPS_QUERY_CMD="xbps-query -C /dev/null -c $XBPS_HOSTDIR/repocache -i --repository=$XBPS_REPOSITORY -r $XBPS_MASTERDIR"
+ readonly XBPS_RINDEX_CMD="xbps-rindex"
readonly XBPS_RECONFIGURE_CMD="xbps-reconfigure -r $XBPS_MASTERDIR"
readonly XBPS_REMOVE_CMD="xbps-remove -r $XBPS_MASTERDIR"
- readonly XBPS_CHECKVERS_CMD="xbps-checkvers --repository=$XBPS_REPOSITORY"
+ readonly XBPS_SRCPKGDIR=$XBPS_DISTDIR/srcpkgs
+ readonly XBPS_COMMONDIR=$XBPS_DISTDIR/common
+ readonly XBPS_SHUTILSDIR=$XBPS_COMMONDIR/xbps-src/shutils
readonly XBPS_DESTDIR=$XBPS_MASTERDIR/destdir
readonly XBPS_BUILDDIR=$XBPS_MASTERDIR/builddir
+ readonly XBPS_TRIGGERSDIR=$XBPS_SRCPKGDIR/xbps-triggers/files
+ readonly XBPS_CROSSPFDIR=$XBPS_COMMONDIR/cross-profiles
+ readonly XBPS_BUILDSTYLEDIR=$XBPS_COMMONDIR/build-style
+ readonly XBPS_LIBEXECDIR=$XBPS_COMMONDIR/xbps-src/libexec
+ readonly XBPS_BUILDHELPERDIR=$XBPS_COMMONDIR/build-helper
fi
-readonly XBPS_RINDEX_CMD="xbps-rindex"
readonly XBPS_FETCH_CMD="xbps-fetch"
readonly XBPS_DIGEST_CMD="xbps-digest"
readonly XBPS_CMPVER_CMD="xbps-uhelper cmpver"
readonly XBPS_TARGET="$1"
-if [ "$2" ]; then
+if [ -n "$2" ]; then
XBPS_TARGET_PKG="${2##*/}"
fi
-# Check for CHROOT_READY and set up XBPS_ARCH environment var for xbps.
+chroot_check() {
+ if [ -f $XBPS_MASTERDIR/.xbps_chroot_init -o "$XBPS_CHROOT_CMD" = "ethereal" ]; then
+ export CHROOT_READY=1
+ fi
+}
+
chroot_check
-check_native_arch
-# Reconfigure pkgs for 32bit on x86_64 and reexec itself.
-# XXX: how about 32bit userland on 64bit CPUs? (ppc, arm, etc).
if [ -z "$XBPS_REINIT" -a -s $XBPS_MASTERDIR/.xbps_chroot_init ]; then
- export XBPS_ARCH=${XBPS_ARCH:-$(<$XBPS_MASTERDIR/.xbps_chroot_init)}
+ export XBPS_ARCH=${XBPS_ARCH:-$(cat $XBPS_MASTERDIR/.xbps_chroot_init)}
if [[ $XBPS_MACHINE == x86_64* ]] && [[ $XBPS_ARCH == i686* ]]; then
# reconfigure pkgs via linux32
linux32 xbps-reconfigure -r ${XBPS_MASTERDIR} -a &>/dev/null
@@ -595,21 +598,20 @@ if [ -z "$XBPS_REINIT" -a -s $XBPS_MASTERDIR/.xbps_chroot_init ]; then
exec linux32 $0 ${XBPS_OPTIONS} $@
fi
fi
-if [ "$XBPS_ARCH" ]; then
+if [ -n "$XBPS_ARCH" ]; then
export XBPS_MACHINE=$XBPS_ARCH
fi
-# At this point if XBPS_TARGET_MACHINE isn't defined we assume
-# it's a native build.
if [ -z "$XBPS_TARGET_MACHINE" ]; then
- export XBPS_TARGET_MACHINE=$XBPS_MACHINE
+ export XBPS_TARGET_MACHINE=${XBPS_ARCH:=$XBPS_MACHINE}
fi
+
export XBPS_SHUTILSDIR XBPS_CROSSPFDIR XBPS_TRIGGERSDIR \
- XBPS_SRCPKGDIR XBPS_COMMONDIR XBPS_BUILDDIR \
+ XBPS_SRCPKGDIR XBPS_COMMONDIR XBPS_BUILDDIR XBPS_REPO_DELTAS \
XBPS_REPOSITORY XBPS_ALT_REPOSITORY XBPS_SRCDISTDIR XBPS_DIGEST_CMD \
XBPS_UHELPER_CMD XBPS_INSTALL_CMD XBPS_QUERY_CMD XBPS_BUILD_ONLY_ONE_PKG \
- XBPS_RINDEX_CMD XBPS_RECONFIGURE_CMD XBPS_REMOVE_CMD XBPS_CHECKVERS_CMD \
- XBPS_CMPVER_CMD XBPS_FETCH_CMD XBPS_VERSION XBPS_BUILDSTYLEDIR \
+ XBPS_RINDEX_CMD XBPS_RECONFIGURE_CMD XBPS_REMOVE_CMD \
+ XBPS_CMPVER_CMD XBPS_FETCH_CMD XBPS_VERSION XBPS_APIVER XBPS_BUILDSTYLEDIR \
XBPS_CPPFLAGS XBPS_CFLAGS XBPS_CXXFLAGS XBPS_FFLAGS XBPS_LDFLAGS \
XBPS_MAKEJOBS XBPS_BUILD_FORCEMODE XBPS_USE_GIT_REVS XBPS_DEBUG_PKGS \
XBPS_CHECK_PKGS XBPS_CCACHE XBPS_DISTCC XBPS_DISTCC_HOSTS XBPS_SKIP_DEPS \
@@ -627,7 +629,7 @@ for i in REPOSITORY DESTDIR BUILDDIR SRCDISTDIR; do
unset val
done
-# A temporary masterdir requires xbps-uchroot(1) and -O to use overlayfs
+# A temporary masterdir requires xbps-uchroot(8) and -O to use overlayfs
# on tmpfs (available with xbps-0.45).
if [ -z "$IN_CHROOT" -a -n "$XBPS_TEMP_MASTERDIR" ]; then
export XBPS_CHROOT_CMD="uchroot"
@@ -638,35 +640,31 @@ fi
#
if [ -z "$IN_CHROOT" ]; then
# In non chroot case always prefer host tools.
- export PATH="$PATH:$XBPS_MASTERDIR/usr/bin"
-fi
-
-#
-# Set up ccache
-#
-if [ "$XBPS_CCACHE" ]; then
- export CCACHEPATH="/usr/lib/ccache/bin"
- export CCACHE_DIR="$XBPS_HOSTDIR/ccache"
- # Avoid not using cached files just due to compiler mtime
- # changes when e.g. bootstrapping
- export CCACHE_COMPILERCHECK=content CCACHE_COMPRESS=1
- export PATH="$CCACHEPATH:$PATH"
- mkdir -p $CCACHE_DIR
-fi
-
-#
-# Set up distcc
-#
-if [ "$XBPS_DISTCC" ]; then
- if [ "$XBPS_CCACHE" ]; then
- export CCACHE_PREFIX="/usr/bin/distcc"
- else
- DISTCCPATH="/usr/lib/distcc/bin"
- export PATH="$DISTCCPATH:$PATH"
+ MYPATH="$XBPS_MASTERDIR/usr/bin:$XBPS_MASTERDIR/usr/sbin"
+ export PATH="$PATH:$MYPATH"
+else
+ MYPATH="/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
+ export PATH="$MYPATH"
+ if [ -n "$XBPS_CCACHE" ]; then
+ CCACHEPATH="/usr/lib/ccache/bin"
+ export CCACHE_DIR="$XBPS_HOSTDIR/ccache"
+ # Avoid not using cached files just due to compiler mtime
+ # changes when e.g. bootstrapping
+ export CCACHE_COMPILERCHECK=content CCACHE_COMPRESS=1
+ export PATH="$CCACHEPATH:$PATH"
+ mkdir -p $CCACHE_DIR
+ fi
+ if [ -n "$XBPS_DISTCC" ]; then
+ if [ -n "$XBPS_CCACHE" ]; then
+ export CCACHE_PREFIX="/usr/bin/distcc"
+ else
+ DISTCCPATH="/usr/lib/distcc/bin"
+ export PATH="$DISTCCPATH:$PATH"
+ fi
+ export DISTCC_DIR="$XBPS_HOSTDIR/distcc-${XBPS_CROSS_BUILD:-${XBPS_MACHINE}}"
+ export DISTCC_HOSTS="$XBPS_DISTCC_HOSTS"
+ mkdir -p $DISTCC_DIR
fi
- export DISTCC_DIR="$XBPS_HOSTDIR/distcc-${XBPS_CROSS_BUILD:-${XBPS_MACHINE}}"
- export DISTCC_HOSTS="$XBPS_DISTCC_HOSTS"
- mkdir -p $DISTCC_DIR
fi
check_build_requirements
@@ -677,12 +675,6 @@ if [ -z "$IN_CHROOT" ]; then
setup_distfiles_mirror
fi
fi
-#
-# Read funcs from helpers
-#
-for f in ${XBPS_SHUTILSDIR}/*.sh; do
- [ -r "$f" ] && . $f
-done
reconfigure_bootstrap_pkgs
@@ -697,24 +689,18 @@ case "$XBPS_TARGET" in
# bootstrap from sources
# check for required host utils
check_reqhost_utils bootstrap
- [[ $XBPS_MACHINE =~ musl ]] && subarch="-musl"
- [ ! -d $XBPS_SRCPKGDIR/base-chroot${subarch} ] && \
- msg_error "Cannot find $XBPS_SRCPKGDIR/base-chroot${subarch} directory!\n"
+ [ ! -d $XBPS_SRCPKGDIR/base-chroot ] && \
+ msg_error "Cannot find $XBPS_SRCPKGDIR/base-chroot directory!\n"
bootstrap_vpkg=${XBPS_MASTERDIR}/etc/xbps.d/bootstrap-vpkgs.conf
mkdir -p ${XBPS_MASTERDIR}/etc/xbps.d
if [ ! -s ${bootstrap_vpkg} ]; then
# Fool xbps to resolve dependencies.
- echo 'virtualpkg=libgcc:base-files' >> ${bootstrap_vpkg}
- echo 'virtualpkg=libstdc++:base-files' >> ${bootstrap_vpkg}
+ echo 'virtualpkg=libgcc-4.4.0_1:base-files' >> ${bootstrap_vpkg}
+ echo 'virtualpkg=libstdc++-4.4.0_1:base-files' >> ${bootstrap_vpkg}
fi
- (
- export XBPS_ARCH=$XBPS_MACHINE
- export XBPS_SKIP_REMOTEREPOS=1
- $XBPS_LIBEXECDIR/build.sh \
- base-chroot${subarch} base-chroot${subarch} $XBPS_TARGET || exit 1
- ) || exit 1
+ $XBPS_LIBEXECDIR/build.sh base-chroot base-chroot $XBPS_TARGET || exit 1
[ -d $XBPS_MASTERDIR ] && rm -rf $XBPS_MASTERDIR
- install_bbootstrap ${XBPS_TARGET_PKG:=$XBPS_MACHINE}
+ install_bbootstrap bootstrap
;;
bootstrap-update)
if [ -n "$CHROOT_READY" -a -z "$IN_CHROOT" ]; then
@@ -871,7 +857,7 @@ case "$XBPS_TARGET" in
bulk_build
;;
show-sys-updates)
- bulk_build -I
+ bulk_build -i
;;
sort-dependencies)
bulk_sortdeps ${@/$XBPS_TARGET/}
@@ -880,7 +866,7 @@ case "$XBPS_TARGET" in
bulk_update
;;
update-sys)
- bulk_update -I
+ bulk_update -i
;;
update-check)
read_pkg ignore-problems