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