diff --git a/srcpkgs/base-chroot/template b/srcpkgs/base-chroot/template index aec77314be..79285694d2 100644 --- a/srcpkgs/base-chroot/template +++ b/srcpkgs/base-chroot/template @@ -10,7 +10,7 @@ long_desc=" replaces="xbps-base-chroot>=0" noarch=yes -base_chroot=yes +bootstrap=yes Add_dependency full xbps-triggers Add_dependency full base-files diff --git a/srcpkgs/base-directories/template b/srcpkgs/base-directories/template index 97028ffb33..cf6e6e4303 100644 --- a/srcpkgs/base-directories/template +++ b/srcpkgs/base-directories/template @@ -9,7 +9,7 @@ long_desc=" installed by any other package and are required on any GNU/Linux system." noarch=yes -base_chroot=yes +bootstrap=yes do_install() { diff --git a/srcpkgs/base-files/template b/srcpkgs/base-files/template index 1302de03b7..12adde5a2a 100644 --- a/srcpkgs/base-files/template +++ b/srcpkgs/base-files/template @@ -12,7 +12,7 @@ long_desc=" replaces="xbps-base-files>=0" noarch=yes -base_chroot=yes +bootstrap=yes conf_files=" /etc/profile diff --git a/srcpkgs/bash/template b/srcpkgs/bash/template index 84889db9c2..fc6ad5a6a7 100644 --- a/srcpkgs/bash/template +++ b/srcpkgs/bash/template @@ -34,7 +34,7 @@ long_desc=" to sixty-four. In addition, most sh scripts can be run by Bash without modification." -base_chroot=yes +bootstrap=yes register_shell="/bin/bash" Add_dependency run glibc diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template index c9c49689fe..27a4045c29 100644 --- a/srcpkgs/binutils/template +++ b/srcpkgs/binutils/template @@ -22,7 +22,7 @@ long_desc=" stripping out symbols (like debugging information) from object files, and other tools." -base_chroot=yes +bootstrap=yes subpackages="$pkgname-devel" Add_dependency run glibc Add_dependency run zlib diff --git a/srcpkgs/busybox/template b/srcpkgs/busybox/template index a3fb3ff081..77b45ea6e9 100644 --- a/srcpkgs/busybox/template +++ b/srcpkgs/busybox/template @@ -16,7 +16,7 @@ long_desc=" very much like their GNU counterparts. BusyBox provides a fairly complete environment for any small or embedded system." -base_chroot=yes +bootstrap=yes replaces="busybox-initramfs>=0" Add_dependency run glibc diff --git a/srcpkgs/bzip2/template b/srcpkgs/bzip2/template index 1378416461..12b23755a8 100644 --- a/srcpkgs/bzip2/template +++ b/srcpkgs/bzip2/template @@ -22,7 +22,7 @@ long_desc=" The archive file format of bzip2 (.bz2) is incompatible with that of its predecessor, bzip (.bz)." -base_chroot=yes +bootstrap=yes subpackages="bzip2-devel" Add_dependency run glibc diff --git a/srcpkgs/chroot-grep/template b/srcpkgs/chroot-grep/template index c28ba181c7..91fc9b5a9f 100644 --- a/srcpkgs/chroot-grep/template +++ b/srcpkgs/chroot-grep/template @@ -6,7 +6,7 @@ unset run_depends build_depends revision revision=2 -base_chroot=yes +bootstrap=yes pkgname=chroot-grep wrksrc=grep-${version} configure_args="--disable-perl-regexp --disable-nls ac_cv_path_GREP=grep" diff --git a/srcpkgs/cloog-ppl/template b/srcpkgs/cloog-ppl/template index 6e49a58f44..c4040529ea 100644 --- a/srcpkgs/cloog-ppl/template +++ b/srcpkgs/cloog-ppl/template @@ -13,7 +13,7 @@ long_desc=" parametrized polyhedron or parametrized polyhedra union is reached. CLooG is designed to avoid control overhead and to produce a very efficient code." -base_chroot=yes +bootstrap=yes subpackages="$pkgname-devel" Add_dependency run glibc Add_dependency run gmp diff --git a/srcpkgs/diffutils/template b/srcpkgs/diffutils/template index c8447486e8..28870cecf6 100644 --- a/srcpkgs/diffutils/template +++ b/srcpkgs/diffutils/template @@ -13,7 +13,7 @@ long_desc=" faster. Cmp has been moved into this package from the GNU textutils package. These programs are usually used for creating patch files." -base_chroot=yes +bootstrap=yes Add_dependency run glibc post_install() diff --git a/srcpkgs/fakeroot/template b/srcpkgs/fakeroot/template index df05bfc75e..79390cbdb0 100644 --- a/srcpkgs/fakeroot/template +++ b/srcpkgs/fakeroot/template @@ -14,7 +14,7 @@ long_desc=" around getuid, chown, chmod, mknod, stat, and so on, thereby creating a fake root environment." -base_chroot=yes +bootstrap=yes Add_dependency run glibc post_install() diff --git a/srcpkgs/file/template b/srcpkgs/file/template index aaa55c9ad3..daa7b5738d 100644 --- a/srcpkgs/file/template +++ b/srcpkgs/file/template @@ -10,7 +10,7 @@ long_desc=" File attempts to classify files depending on their contents and prints a description if a match is found." -base_chroot=yes +bootstrap=yes subpackages="file-devel" Add_dependency run glibc diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template index 4925fcba79..2ca229ae8f 100644 --- a/srcpkgs/gcc/template +++ b/srcpkgs/gcc/template @@ -17,7 +17,8 @@ long_desc=" for ObjectiveC++ install gcc-objc++, for Go install gcc-go, for Fortran install gcc-fortran." -base_chroot=yes +bootstrap=yes + subpackages="libgcc libgo libssp libssp-devel libstdc++ libstdc++-devel libgomp" subpackages="${subpackages} libquadmath libquadmath-devel libgo-devel libgomp-devel" subpackages="${subpackages} libmudflap libmudflap-devel libobjc libobjc-devel" @@ -44,6 +45,8 @@ Add_dependency build mpc-devel Add_dependency build binutils-devel Add_dependency build cloog-ppl-devel Add_dependency build libelf-devel +Add_dependency build binutils + do_build() { diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template index ae592c2937..9be0869afd 100644 --- a/srcpkgs/glibc/template +++ b/srcpkgs/glibc/template @@ -18,7 +18,7 @@ long_desc=" # Don't check for deps here ignore_vdeps_dir="/usr/lib/gconv" -base_chroot=yes +bootstrap=yes conf_files="/etc/rpc /etc/ld.so.conf /etc/nsswitch.conf" subpackages="glibc-devel glibc-locales nscd" diff --git a/srcpkgs/gmp/template b/srcpkgs/gmp/template index f180b9ecbf..11841c00b8 100644 --- a/srcpkgs/gmp/template +++ b/srcpkgs/gmp/template @@ -28,7 +28,7 @@ long_desc=" The advantage for GNU MP increases with the operand sizes for certain operations, since GNU MP in many cases has asymptotically faster algorithms." -base_chroot=yes +bootstrap=yes subpackages="gmp-devel" Add_dependency build m4 Add_dependency run libgcc diff --git a/srcpkgs/gzip/template b/srcpkgs/gzip/template index aa146c799b..4116a27b09 100644 --- a/srcpkgs/gzip/template +++ b/srcpkgs/gzip/template @@ -12,7 +12,7 @@ long_desc=" and freedom from patented algorithms. The GNU Project uses it as the standard compression program for its system." -base_chroot=yes +bootstrap=yes Add_dependency run glibc post_build() diff --git a/srcpkgs/kernel-libc-headers/template b/srcpkgs/kernel-libc-headers/template index a8a69b03e2..e272849d47 100644 --- a/srcpkgs/kernel-libc-headers/template +++ b/srcpkgs/kernel-libc-headers/template @@ -7,7 +7,7 @@ short_desc="The Linux kernel headers for development" long_desc=" This package provides the linux kernel headers for use in userspace." -base_chroot=yes +bootstrap=yes nostrip=yes do_build() diff --git a/srcpkgs/libelf/template b/srcpkgs/libelf/template index a66207c62c..1f0138f4f8 100644 --- a/srcpkgs/libelf/template +++ b/srcpkgs/libelf/template @@ -14,6 +14,6 @@ long_desc=" Eli (a state of the art compiler generation system), and Elk (the Extension Language Kit - an implementation of the Scheme programming language.)" -base_chroot=yes +bootstrap=yes subpackages="$pkgname-devel" Add_dependency run glibc diff --git a/srcpkgs/m4/template b/srcpkgs/m4/template index 42df264995..723514bc8a 100644 --- a/srcpkgs/m4/template +++ b/srcpkgs/m4/template @@ -15,5 +15,5 @@ long_desc=" shell commands, doing arithmetic, etc. Autoconf needs GNU m4 for generating configure scripts, but not for running them." -base_chroot=yes +bootstrap=yes Add_dependency run glibc diff --git a/srcpkgs/make/template b/srcpkgs/make/template index 0008b20c5c..ba02166d1d 100644 --- a/srcpkgs/make/template +++ b/srcpkgs/make/template @@ -12,5 +12,5 @@ long_desc=" program need to be recompiled and issues the commands to recompile them, when necessary." -base_chroot=yes +bootstrap=yes Add_dependency run glibc diff --git a/srcpkgs/mpc/template b/srcpkgs/mpc/template index 9aff4ed6c1..dd0c5da32c 100644 --- a/srcpkgs/mpc/template +++ b/srcpkgs/mpc/template @@ -12,7 +12,7 @@ long_desc=" high precision and correct rounding of the result. It is built upon and follows the same principles as Mpfr." -base_chroot=yes +bootstrap=yes subpackages="mpc-devel" Add_dependency run glibc Add_dependency run gmp diff --git a/srcpkgs/mpfr/template b/srcpkgs/mpfr/template index 069cce050d..17164abe60 100644 --- a/srcpkgs/mpfr/template +++ b/srcpkgs/mpfr/template @@ -15,7 +15,7 @@ long_desc=" see more on the credit page. MPFR is based on the GMP multiple-precision library." -base_chroot=yes +bootstrap=yes subpackages="$pkgname-devel" Add_dependency run glibc Add_dependency run gmp diff --git a/srcpkgs/ncurses/template b/srcpkgs/ncurses/template index cec54d4e02..1c597a875c 100644 --- a/srcpkgs/ncurses/template +++ b/srcpkgs/ncurses/template @@ -17,7 +17,7 @@ long_desc=" ecompiler infocmp, clear, tput, tset, and a termcap conversion tool captoinfo. Full manual pages are provided for the library and tools." -base_chroot=yes +bootstrap=yes subpackages="ncurses-base ncurses-devel ncurses-libs ncurses-term" Add_dependency run glibc Add_dependency run ncurses-libs diff --git a/srcpkgs/patch/template b/srcpkgs/patch/template index 7251a8bddd..5df7820aa8 100644 --- a/srcpkgs/patch/template +++ b/srcpkgs/patch/template @@ -13,5 +13,5 @@ long_desc=" This is the GPL version from the Free Software Foundation." -base_chroot=yes +bootstrap=yes Add_dependency run glibc diff --git a/srcpkgs/ppl/template b/srcpkgs/ppl/template index ef271faa66..1804a5c0c7 100644 --- a/srcpkgs/ppl/template +++ b/srcpkgs/ppl/template @@ -22,7 +22,7 @@ long_desc=" exact-arithmetic version of the simplex algorithm." disable_parallel_build=yes -base_chroot=yes +bootstrap=yes subpackages="ppl-devel" Add_dependency run libgcc diff --git a/srcpkgs/tar/template b/srcpkgs/tar/template index 00f889a282..d980acbb96 100644 --- a/srcpkgs/tar/template +++ b/srcpkgs/tar/template @@ -13,7 +13,7 @@ long_desc=" of these. Note that as of the current version of GNU tar (1.12), gtar does not create "correct" ustar archives." -base_chroot=yes +bootstrap=yes Add_dependency run glibc Add_dependency run bzip2 Add_dependency full gzip diff --git a/srcpkgs/xbps-triggers/template b/srcpkgs/xbps-triggers/template index e603a9384b..74acbaa630 100644 --- a/srcpkgs/xbps-triggers/template +++ b/srcpkgs/xbps-triggers/template @@ -11,7 +11,7 @@ long_desc=" noarch=yes noextract=yes -base_chroot=yes +bootstrap=yes do_install() { diff --git a/srcpkgs/zlib/template b/srcpkgs/zlib/template index a2834364a1..47bd4608a3 100644 --- a/srcpkgs/zlib/template +++ b/srcpkgs/zlib/template @@ -18,7 +18,7 @@ long_desc=" is thread safe. The data format used by the library is described by RFCs (Request for Comments) 1950 to 1952." -base_chroot=yes +bootstrap=yes subpackages="zlib-devel" Add_dependency run glibc diff --git a/xbps-src/shutils/builddep_funcs.sh b/xbps-src/shutils/builddep_funcs.sh index 3fa26e8dd5..061a2483b0 100644 --- a/xbps-src/shutils/builddep_funcs.sh +++ b/xbps-src/shutils/builddep_funcs.sh @@ -101,7 +101,7 @@ autoremove_pkg_dependencies() # If XBPS_PREFER_BINPKG_DEPS is set, we should remove those # package dependencies installed by the target package, do it. # - if [ -n "$XBPS_PREFER_BINPKG_DEPS" -a -z "$base_chroot" ]; then + if [ -n "$XBPS_PREFER_BINPKG_DEPS" -a -z "$bootstrap" ]; then msg_normal "'$pkgname': removing automatically installed dependencies ...\n" # Autoremove installed binary packages. ${cmd} -y reconfigure all && ${cmd} -Rpyf autoremove 2>&1 >/dev/null @@ -188,7 +188,7 @@ install_pkg_deps() [ $? -eq 0 ] && continue prev_pkg="$j" - if [ -n "$XBPS_PREFER_BINPKG_DEPS" -a -z "$base_chroot" ]; then + if [ -n "$XBPS_PREFER_BINPKG_DEPS" -a -z "$bootstrap" ]; then install_pkg_from_repos ${j} if [ $? -eq 255 ]; then # xbps-bin returned unexpected error @@ -214,7 +214,7 @@ install_pkg_deps() fi done - if [ -n "$XBPS_PREFER_BINPKG_DEPS" -a -z "$base_chroot" ]; then + if [ -n "$XBPS_PREFER_BINPKG_DEPS" -a -z "$bootstrap" ]; then install_pkg_from_repos ${curpkg} if [ $? -eq 255 ]; then # xbps-bin returned unexpected error @@ -279,7 +279,7 @@ install_dependencies_pkg() [ -z "$notinstalled_deps" ] && return 0 # Install direct build dependencies from binary packages. - if [ -n "$XBPS_PREFER_BINPKG_DEPS" -a -z "$base_chroot" ]; then + if [ -n "$XBPS_PREFER_BINPKG_DEPS" -a -z "$bootstrap" ]; then msg_normal "'$pkg': installing dependencies from repositories ...\n" for i in ${notinstalled_deps}; do if [ -z "$pkglist" ]; then diff --git a/xbps-src/shutils/chroot.sh.in b/xbps-src/shutils/chroot.sh.in index a3cc475c4c..6e78def8d0 100644 --- a/xbps-src/shutils/chroot.sh.in +++ b/xbps-src/shutils/chroot.sh.in @@ -45,7 +45,7 @@ _umount() return $? } -[ -n "$base_chroot" ] && return 0 +[ -n "$bootstrap" ] && return 0 if [ "${chroot_cmd}" = "chroot" ]; then if [ "$(id -u)" -ne 0 ]; then @@ -316,6 +316,8 @@ xbps_chroot_handler() else [ -n "$KEEP_WRKSRC" ] && arg="-C" [ -n "$KEEP_AUTODEPS" ] && arg="$arg -K" + [ -n "$DESTDIR_ONLY_INSTALL" ] && arg="$arg -D" + action="$arg $action" env in_chroot=1 IN_CHROOT=1 LANG=C _ORIGINPKG="$pkg" \ ${chroot_cmd} $XBPS_MASTERDIR sh -c \ diff --git a/xbps-src/shutils/pkgtarget_funcs.sh.in b/xbps-src/shutils/pkgtarget_funcs.sh.in index dd06f8da72..abe4bc1d7c 100644 --- a/xbps-src/shutils/pkgtarget_funcs.sh.in +++ b/xbps-src/shutils/pkgtarget_funcs.sh.in @@ -50,7 +50,7 @@ install_pkg() check_installed_pkg "$pkg" if [ $? -eq 1 -o $? -eq 0 ]; then instver="$($XBPS_PKGDB_CMD version $pkgname)" - if [ -n "$instver" ]; then + if [ -n "$instver" -a -z "$DESTDIR_ONLY_INSTALL" ]; then echo "=> $pkgname-$instver already installed." return 0 fi @@ -130,6 +130,7 @@ install_pkg() if [ -d "$wrksrc" -a -z "$KEEP_WRKSRC" ]; then remove_tmpl_wrksrc $wrksrc fi + return 0 fi # Stow package into masterdir. @@ -200,7 +201,6 @@ remove_pkg() [ -z $pkgname ] && msg_error "unexistent package, aborting.\n" ver=$($XBPS_PKGDB_CMD version $pkgname) - stow_pkg_handler unstow || return $? for subpkg in ${subpackages}; do if [ -d "$XBPS_DESTDIR/${subpkg}-${ver%_*}" ]; then @@ -223,6 +223,8 @@ remove_pkg() [ -f $XBPS_POST_INSTALL_DONE ] && rm -f $XBPS_POST_INSTALL_DONE [ -f $XBPS_INSTALL_DONE ] && rm -f $XBPS_INSTALL_DONE + stow_pkg_handler unstow || return $? + [ -n "$found" ] && return 0 return 1 diff --git a/xbps-src/shutils/tmpl_funcs.sh.in b/xbps-src/shutils/tmpl_funcs.sh.in index b8cd315415..96f4ec3d1b 100644 --- a/xbps-src/shutils/tmpl_funcs.sh.in +++ b/xbps-src/shutils/tmpl_funcs.sh.in @@ -90,7 +90,7 @@ reset_tmpl_vars() local TMPL_VARS="pkgname distfiles configure_args \ make_build_args make_install_args build_style \ short_desc maintainer long_desc checksum wrksrc \ - make_cmd base_chroot register_shell keep_empty_dirs \ + make_cmd bootstrap register_shell keep_empty_dirs \ make_build_target configure_script noextract nofetch \ pre_configure pre_build pre_install build_depends \ post_configure post_build post_install nostrip \ @@ -285,6 +285,10 @@ set_tmpl_common_vars() . $XBPS_SHUTILSDIR/install_files.sh + if [ -n "$IGNORE_BOOTSTRAP_PKGS" ]; then + unset bootstrap + fi + FILESDIR=$XBPS_SRCPKGDIR/$pkgname/files PATCHESDIR=$XBPS_SRCPKGDIR/$pkgname/patches DESTDIR=${XBPS_DESTDIR}/${pkgname}-${version} diff --git a/xbps-src/xbps-src.sh.in b/xbps-src/xbps-src.sh.in index 183edb9795..24b8d58bd0 100644 --- a/xbps-src/xbps-src.sh.in +++ b/xbps-src/xbps-src.sh.in @@ -315,6 +315,16 @@ else fi export PATH="$MYPATH" +# +# If masterdir is ready (base-chroot installed and chroot set up) and +# XBPS_PREFER_BINPKG_DEPS enabled, force ignoring rules to handle +# bootstrap packages. +# +if [ -n "$DESTDIR_ONLY_INSTALL" -a -n "$XBPS_PREFER_BINPKG_DEPS" \ + -a -f "$XBPS_MASTERDIR/.xbps_perms_done" ]; then + export IGNORE_BOOTSTRAP_PKGS=1 +fi + # # Main switch. # @@ -332,7 +342,7 @@ build|configure) _pkgname=$(basename_cwd) fi - if [ -z "$base_chroot" -a -z "$IN_CHROOT" ]; then + if [ -z "$bootstrap" -a -z "$IN_CHROOT" ]; then . $XBPS_SHUTILSDIR/chroot.sh xbps_chroot_handler $target ${_pkgname} else @@ -416,7 +426,7 @@ install) fi setup_tmpl ${_pkgname} _ORIGINPKG="${_pkgname}" - if [ -z "$IN_CHROOT" -a -z "$base_chroot" ]; then + if [ -z "$IN_CHROOT" -a -z "$bootstrap" ]; then . $XBPS_SHUTILSDIR/chroot.sh xbps_chroot_handler $target ${_ORIGINPKG} else @@ -448,7 +458,7 @@ remove) _pkgname=$(basename_cwd) fi setup_tmpl ${_pkgname} - if [ -z "$IN_CHROOT" -a -z "$base_chroot" ]; then + if [ -z "$IN_CHROOT" -a -z "$bootstrap" ]; then . $XBPS_SHUTILSDIR/chroot.sh xbps_chroot_handler $target ${_pkgname} else