xbps-src: added -B flag for the install target.

This commit is contained in:
Juan RP 2011-07-17 20:12:31 +02:00
parent d9f155607c
commit d734239f2e

View file

@ -57,23 +57,22 @@ check_reqhost_utils()
usage() usage()
{ {
cat << _EOF cat << _EOF
$progname: [-CDhKS] [-c <file>] [-m <dir>] [-p <dir>] [-s <dir>] <target> [<pkgname>] $progname: [-BCDhKS] [-c file] [-m dir] [-p dir] [-s dir] [target] [pkgname]
Targets: Targets:
bootstrap bootstrap
Build and install from source the bootstrap packages Build and install from source the bootstrap packages into <masterdir>.
into <masterdir>.
build [pkgname] build [pkgname]
Build package source (fetch + extract + configure + build). Build package source (fetch + extract + configure + build).
build-pkg [pkgname|all] build-pkg [pkgname|all]
Build a binary package from <pkgname> or all packages if <all> Build a binary package from <pkgname> or all packages with the <all>
is specified. Package must be installed into destination directory. keyword. The package(s) must be installed into <destdir> for this to work.
checkvers checkvers
Checks installed package versions in <masterdir> Checks installed package versions in <masterdir> against the srcpkgs tree
against srcpkgs for new available versions. for new available versions.
chroot chroot
Enter to the chroot in <masterdir>. Enter to the chroot in <masterdir>.
@ -95,29 +94,29 @@ Targets:
Show information for the specified package. Show information for the specified package.
install [pkgname] install [pkgname]
Installs a package into destination directory and \`stows' its Installs a package into destination directory and \`stows' its files into
files into <masterdir>. If a package is not from bootstrap group, <masterdir>. If a package is not from bootstrap group, its files will be
its files will be symlinked rather than copied. symlinked rather than being fully copied.
list list
List installed packages in <masterdir>. List installed packages in <masterdir>.
list-files <pkgname> list-files <pkgname>
List package files from <pkgname>. List package files from <pkgname>. Package must be fully installed
into <masterdir> for this to work.
make-repoidx make-repoidx
Build a package index for the local repository associated with Build a package index for the local repository associated with the
the master directory <masterdir>. By default set to master directory <masterdir>. By default set to <masterdir/host/binpkgs.
<masterdir>/host/binpkgs. To specify another repo, use -p <dir>. To specify another repo, use -p <dir>.
remove [pkgname] remove [pkgname]
Remove package completely from <destdir> and <masterdir>. Remove package completely from <destdir> and <masterdir>.
stow [pkgname] stow [pkgname]
Stow <pkgname> files from <destdir> into <masterdir> and register Stow <pkgname> files from <destdir> into <masterdir> and register package
package in database. When a package is \`stown', its files will in database. When a package is \`stown', its files will be available in
be available in <masterdir>, and other packages will be able to <masterdir>, and other packages will be able to found it.
depend on it.
unstow [pkgname] unstow [pkgname]
Remove <pkgname> files from <masterdir> and unregister package Remove <pkgname> files from <masterdir> and unregister package
@ -133,6 +132,9 @@ is omitted xbps-src assumes that CWD is in the target package. Example:
Both ways are equivalent. Both ways are equivalent.
Options: Options:
-B Used in the install target, after successful installation a
binary package is also built for <pkgname> and local repository
pkg-index is created or updated.
-C Do not remove build directory after successful installation. -C Do not remove build directory after successful installation.
-c Path to global configuration file: -c Path to global configuration file:
if not specified @@XBPS_INSTALL_ETCDIR@@/xbps-src.conf is used. if not specified @@XBPS_INSTALL_ETCDIR@@/xbps-src.conf is used.
@ -144,13 +146,11 @@ Options:
-m Master directory, overwritting the value set in the configuration -m Master directory, overwritting the value set in the configuration
file xbps-src.conf. file xbps-src.conf.
-p Local packages repository, overwritting default path at -p Local packages repository, overwritting default path at
<masterdir>/host/binpkgs. <masterdir>/host/binpkgs or if XBPS_HOSTDIR is set <hostdir>/binpkgs.
-S Overrides and disables XBPS_PREFER_BINPKG_DEPS even if it was -S Overrides and disables XBPS_PREFER_BINPKG_DEPS even if it was
set in the configuration file xbps-src.conf. set in the configuration file xbps-src.conf.
it was set in the configuration file.
-s Source distribution files directory, overwritting default path at -s Source distribution files directory, overwritting default path at
<masterdir>/host/sources. <masterdir>/host/sources or if XBPS_HOSTDIR is set <hostdir>/sources.
_EOF _EOF
} }
@ -221,8 +221,9 @@ check_config_vars()
# #
# main() # main()
# #
while getopts "Cc:DhKm:p:Ss:" opt; do while getopts "CBc:DhKm:p:Ss:" opt; do
case $opt in case $opt in
B) export BUILD_BINPKG=1;;
C) export KEEP_WRKSRC=1;; C) export KEEP_WRKSRC=1;;
c) XBPS_CONFIG_FILE="$OPTARG";; c) XBPS_CONFIG_FILE="$OPTARG";;
D) export DESTDIR_ONLY_INSTALL=1;; D) export DESTDIR_ONLY_INSTALL=1;;
@ -253,6 +254,7 @@ shift $(($OPTIND - 1))
target="$1" target="$1"
_pkgname="$2" _pkgname="$2"
if [ -z "$target" ]; then if [ -z "$target" ]; then
echo "=> ERROR: missing target." echo "=> ERROR: missing target."
usage && exit 1 usage && exit 1
@ -359,17 +361,17 @@ build|configure)
fi fi
# All deps were installed, continue with the origin pkg... # All deps were installed, continue with the origin pkg...
setup_tmpl ${_ORIGINPKG} setup_tmpl ${_ORIGINPKG}
fetch_distfiles fetch_distfiles || exit $?
if [ ! -f "$XBPS_EXTRACT_DONE" ]; then if [ ! -f "$XBPS_EXTRACT_DONE" ]; then
extract_distfiles extract_distfiles || exit $?
fi fi
if [ "$target" = "configure" ]; then if [ "$target" = "configure" ]; then
configure_src_phase configure_src_phase || exit $?
else else
if [ ! -f "$XBPS_CONFIGURE_DONE" ]; then if [ ! -f "$XBPS_CONFIGURE_DONE" ]; then
configure_src_phase configure_src_phase || exit $?
fi fi
build_src_phase build_src_phase || exit $?
fi fi
fi fi
;; ;;
@ -429,29 +431,33 @@ install)
setup_tmpl ${_pkgname} setup_tmpl ${_pkgname}
_ORIGINPKG="${_pkgname}" _ORIGINPKG="${_pkgname}"
if [ -z "$IN_CHROOT" -a -z "$bootstrap" ]; then if [ -z "$IN_CHROOT" -a -z "$bootstrap" ]; then
xbps_chroot_handler $target ${_ORIGINPKG} xbps_chroot_handler $target ${_ORIGINPKG} || exit $?
else else
setup_tmpl ${_ORIGINPKG} setup_tmpl ${_ORIGINPKG}
install_pkg $pkgname install_pkg $pkgname || exit $?
fi
if [ -z "$IN_CHROOT" -a -n "$BUILD_BINPKG" ]; then
setup_tmpl ${_ORIGINPKG}
xbps_make_binpkg
[ -n "${_PACKAGEDIR}" ] && XBPS_PACKAGESDIR="${_PACKAGEDIR}"
msg_normal "Updating pkg-index for local repository at:\n"
msg_normal " $XBPS_PACKAGESDIR\n"
${XBPS_REPO_CMD} genindex ${XBPS_PACKAGESDIR} 2>/dev/null
fi fi
;; ;;
list|list-files) list)
if [ "$target" = "list" ]; then
$XBPS_BIN_CMD list $XBPS_BIN_CMD list
else ;;
list_pkg_files $2 list-files)
fi list_pkg_files ${_pkgname}
;; ;;
make-repoidx) make-repoidx)
if [ -n "${_PACKAGEDIR}" ]; then if [ -n "${_PACKAGEDIR}" ]; then
export XBPS_PACKAGESDIR=${_PACKAGEDIR} export XBPS_PACKAGESDIR=${_PACKAGEDIR}
fi fi
echo "=> Updating package index for local repository at" msg_normal "Updating pkg-index for local repository at:\n"
echo " $XBPS_PACKAGESDIR..." msg_normal " $XBPS_PACKAGESDIR\n"
[ ! -d "$XBPS_PACKAGESDIR/$(uname -m)" ] && \
mkdir -p "$XBPS_PACKAGESDIR/$(uname -m)"
${XBPS_REPO_CMD} genindex ${XBPS_PACKAGESDIR} 2>/dev/null ${XBPS_REPO_CMD} genindex ${XBPS_PACKAGESDIR} 2>/dev/null
[ $? -eq 0 ] && echo "=> done."
;; ;;
remove) remove)
if [ -z "${_pkgname}" ]; then if [ -z "${_pkgname}" ]; then