1 # vim: set ts=4 sw=4 et:
5 local target
="$(readlink $XBPS_SRCPKGDIR/$p)"
7 if [ $?
-eq 0 -a -n "$target" ]; then
14 local _pkgs _pkg pkgs pkg found f x tmpf
17 # Iterate over the list and make sure that only real pkgs are
18 # added to our pkglist.
19 for pkg
in ${_pkgs}; do
21 f
=$
(bulk_getlink
$pkg)
23 if [ "$x" = "${f}" ]; then
28 if [ $found -eq 0 ]; then
33 tmpf
=$
(mktemp
) ||
exit 1
34 # Now make the real dependency graph of all pkgs to build.
35 # Perform a topological sort of all pkgs but only with build dependencies
36 # that are found in previous step.
37 for pkg
in ${pkgs}; do
38 _pkgs
="$($XBPS_DISTDIR/xbps-src show-build-deps $pkg 2>/dev/null)"
41 _pkg
=$
(bulk_getlink
$x)
43 if [ "${f}" != "${_pkg}" ]; then
47 echo "${pkg} ${f}" >> $tmpf
50 [ $found -eq 0 ] && echo "${pkg} ${pkg}" >> $tmpf
57 local bulk_build_cmd
="$1"
58 local NPROCS
=$
(($
(nproc
)*2))
61 if [ "$XBPS_CROSS_BUILD" ]; then
62 source ${XBPS_COMMONDIR}/cross-profiles
/${XBPS_CROSS_BUILD}.sh
63 export XBPS_ARCH
=${XBPS_TARGET_MACHINE}
65 if ! command -v xbps-checkvers
&>/dev
/null
; then
66 msg_error
"xbps-src: cannot find xbps-checkvers(1) command!\n"
69 # Compare installed pkg versions vs srcpkgs
70 case "$bulk_build_cmd" in
72 bulk_sortdeps $
(xbps-checkvers
-f '%n' -I -D "$XBPS_DISTDIR")
76 bulk_sortdeps $
(xbps-checkvers
-f '%n' -i -R "${XBPS_REPOSITORY}/bootstrap" -R "${XBPS_REPOSITORY}" -R "${XBPS_REPOSITORY}/nonfree" -D "$XBPS_DISTDIR")
81 # compare repo pkg versions vs srcpkgs
82 for f
in $
(xbps-checkvers
-f '%n' -D $XBPS_DISTDIR); do
83 if [ $NRUNNING -eq $NPROCS ]; then
87 NRUNNING
=$
((NRUNNING
+1))
89 setup_pkg
$f $XBPS_TARGET_MACHINE &>/dev
/null
90 if show_avail
&>/dev
/null
; then
100 local bulk_update_cmd
="$1" pkgs f rval
102 pkgs
="$(bulk_build "${bulk_update_cmd}")"
103 [[ -z $pkgs ]] && return 0
105 msg_normal
"xbps-src: the following packages must be rebuilt and updated:\n"
112 msg_normal
"xbps-src: building ${pkgver} ...\n"
113 if [ -n "$CHROOT_READY" -a -z "$IN_CHROOT" ]; then
114 chroot_handler pkg
$XBPS_TARGET_PKG
116 $XBPS_LIBEXECDIR/build.sh
$f $f pkg
$XBPS_CROSS_BUILD
118 if [ $?
-eq 1 ]; then
119 msg_error
"xbps-src: failed to build $pkgver pkg!\n"
122 if [ -n "$pkgs" -a "$bulk_update_cmd" == installed
]; then
124 msg_normal
"xbps-src: updating your system, confirm to proceed...\n"
125 ${XBPS_SUCMD} "xbps-install --repository=$XBPS_REPOSITORY/bootstrap --repository=$XBPS_REPOSITORY --repository=$XBPS_REPOSITORY/nonfree -u ${pkgs//[$'\n']/ }" ||
return 1