xbps-src: new layout in masterdir to use a common directory from host.
XBPS_CACHEDIR has been replaced by XBPS_HOSTDIR in configuration file, and this expects the following structure: /host |_ /build (previously /pkg-builddir) |_ /binpkgs (previously /pkg-binpkgs) |_ /repocache (previously /cachedir) |_ /sources (previously /pkg-srcdistdir) Thanks to str1ngs for the great idea!
This commit is contained in:
parent
c335a73af5
commit
b6c21b960b
5 changed files with 40 additions and 37 deletions
|
@ -15,10 +15,23 @@ XBPS_DISTRIBUTIONDIR=@@XBPS_DISTRIBDIR@@
|
||||||
XBPS_MASTERDIR=$XBPS_DISTRIBUTIONDIR/masterdir
|
XBPS_MASTERDIR=$XBPS_DISTRIBUTIONDIR/masterdir
|
||||||
|
|
||||||
#
|
#
|
||||||
# Cache directory for downloaded binary packages; it's bind mounted
|
# Host directory to be bind mounted into the chroot (masterdir) containing
|
||||||
# to $XBPS_MASTERDIR/cachedir for chroot operations.
|
# directories for downloaded cached packages from xbps-bin(8), packages
|
||||||
|
# created by xbps-src, source distribution tarballs downloaded required
|
||||||
|
# to build packages from source, etc.
|
||||||
#
|
#
|
||||||
#XBPS_CACHEDIR=/path/to/cachedir/with/user/permissions/to/write
|
# Basically your directory must contain this structure:
|
||||||
|
#
|
||||||
|
# /yourdir
|
||||||
|
# |_ /build
|
||||||
|
# |_ /binpkgs
|
||||||
|
# |_ /repocache
|
||||||
|
# |_ /sources
|
||||||
|
#
|
||||||
|
# Those names are constants so you cannot change them, even they are
|
||||||
|
# case sensitive.
|
||||||
|
#
|
||||||
|
#XBPS_HOSTDIR=/path/to/your/host/directory
|
||||||
|
|
||||||
#
|
#
|
||||||
# Compilation flags for C and C++.
|
# Compilation flags for C and C++.
|
||||||
|
@ -60,7 +73,7 @@ XBPS_COMPRESS_LEVEL=9
|
||||||
|
|
||||||
#
|
#
|
||||||
# Install required build time dependencies from binary packages,
|
# Install required build time dependencies from binary packages,
|
||||||
# Local repository associated with the masterdir at <masterdir>/pkg-binpkgs,
|
# Local repository associated with the masterdir at <masterdir>/host/binpkgs,
|
||||||
# and remote repositories specified in XBPS_REPO_LIST will be used
|
# and remote repositories specified in XBPS_REPO_LIST will be used
|
||||||
# to resolve build dependencies.
|
# to resolve build dependencies.
|
||||||
#
|
#
|
||||||
|
|
|
@ -31,11 +31,12 @@ HANDLER="$1"
|
||||||
if [ -n "${MASTERDIR}" ]; then
|
if [ -n "${MASTERDIR}" ]; then
|
||||||
export XBPS_MASTERDIR="${MASTERDIR}"
|
export XBPS_MASTERDIR="${MASTERDIR}"
|
||||||
fi
|
fi
|
||||||
if [ -n "${CACHEDIR}" ]; then
|
if [ -n "${HOSTDIR}" ]; then
|
||||||
export XBPS_CACHEDIR="${CACHEDIR}"
|
export XBPS_HOSTDIR="${HOSTDIR}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
REQFS="sys proc dev xbps cachedir"
|
|
||||||
|
REQFS="sys proc dev xbps host"
|
||||||
|
|
||||||
mount_chroot_fs()
|
mount_chroot_fs()
|
||||||
{
|
{
|
||||||
|
@ -53,13 +54,13 @@ mount_chroot_fs()
|
||||||
blah=${XBPS_DISTRIBUTIONDIR}
|
blah=${XBPS_DISTRIBUTIONDIR}
|
||||||
dowrite="-w"
|
dowrite="-w"
|
||||||
;;
|
;;
|
||||||
cachedir)
|
host)
|
||||||
blah=${XBPS_CACHEDIR}
|
blah=${XBPS_HOSTDIR}
|
||||||
dowrite="-w"
|
dowrite="-w"
|
||||||
;;
|
;;
|
||||||
*) blah=/${f};;
|
*) blah=/${f};;
|
||||||
esac
|
esac
|
||||||
if [ -z "$XBPS_CACHEDIR" -a "$f" = "cachedir" ]; then
|
if [ -z "$XBPS_HOSTDIR" -a "$f" = "host" ]; then
|
||||||
echo "unset, ignoring."
|
echo "unset, ignoring."
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
@ -105,15 +106,6 @@ umount_chroot_fs()
|
||||||
fi
|
fi
|
||||||
unset fs
|
unset fs
|
||||||
done
|
done
|
||||||
|
|
||||||
# Remove created dirs
|
|
||||||
for fs in xbps cachedir; do
|
|
||||||
if [ ! -f ${XBPS_MASTERDIR}/.${fs}_mount_bind_done ]; then
|
|
||||||
if [ -d ${XBPS_MASTERDIR}/${fs} ]; then
|
|
||||||
rmdir ${XBPS_MASTERDIR}/${fs} 2>/dev/null
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ $# -ne 1 ]; then
|
if [ $# -ne 1 ]; then
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
_mount()
|
_mount()
|
||||||
{
|
{
|
||||||
MASTERDIR="${XBPS_MASTERDIR}" CACHEDIR="${XBPS_CACHEDIR}" \
|
MASTERDIR="${XBPS_MASTERDIR}" HOSTDIR="${XBPS_HOSTDIR}" \
|
||||||
${sudo_cmd} \
|
${sudo_cmd} \
|
||||||
@@XBPS_INSTALL_LIBEXECDIR@@/xbps-src-chroot-helper mount
|
@@XBPS_INSTALL_LIBEXECDIR@@/xbps-src-chroot-helper mount
|
||||||
return $?
|
return $?
|
||||||
|
@ -33,7 +33,7 @@ _mount()
|
||||||
|
|
||||||
_umount()
|
_umount()
|
||||||
{
|
{
|
||||||
MASTERDIR="${XBPS_MASTERDIR}" CACHEDIR="${XBPS_CACHEDIR}" \
|
MASTERDIR="${XBPS_MASTERDIR}" HOSTDIR="${XBPS_HOSTDIR}" \
|
||||||
${sudo_cmd} \
|
${sudo_cmd} \
|
||||||
@@XBPS_INSTALL_LIBEXECDIR@@/xbps-src-chroot-helper umount
|
@@XBPS_INSTALL_LIBEXECDIR@@/xbps-src-chroot-helper umount
|
||||||
return $?
|
return $?
|
||||||
|
@ -86,8 +86,8 @@ _EOF
|
||||||
if [ -n "$XBPS_COMPRESS_LEVEL" ]; then
|
if [ -n "$XBPS_COMPRESS_LEVEL" ]; then
|
||||||
echo "XBPS_COMPRESS_LEVEL=$XBPS_COMPRESS_LEVEL" >> $XBPSSRC_CF
|
echo "XBPS_COMPRESS_LEVEL=$XBPS_COMPRESS_LEVEL" >> $XBPSSRC_CF
|
||||||
fi
|
fi
|
||||||
if [ -n "$XBPS_CACHEDIR" ]; then
|
if [ -n "$XBPS_HOSTDIR" ]; then
|
||||||
echo "XBPS_CACHEDIR=/cachedir" >> $XBPSSRC_CF
|
echo "XBPS_HOSTDIR=/host" >> $XBPSSRC_CF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "# End of configuration file." >> $XBPSSRC_CF
|
echo "# End of configuration file." >> $XBPSSRC_CF
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#-
|
#-
|
||||||
# Copyright (c) 2008-2010 Juan Romero Pardines.
|
# Copyright (c) 2008-2011 Juan Romero Pardines.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -37,13 +37,13 @@ set_defvars()
|
||||||
: ${XBPS_PKGMETADIR:=$XBPS_DBDIR/metadata}
|
: ${XBPS_PKGMETADIR:=$XBPS_DBDIR/metadata}
|
||||||
: ${XBPS_SRCPKGDIR:=$XBPS_DISTRIBUTIONDIR/srcpkgs}
|
: ${XBPS_SRCPKGDIR:=$XBPS_DISTRIBUTIONDIR/srcpkgs}
|
||||||
if [ -n "$IN_CHROOT" ]; then
|
if [ -n "$IN_CHROOT" ]; then
|
||||||
: ${XBPS_DESTDIR:=/pkg-destdir}
|
: ${XBPS_DESTDIR:=/host/destdir}
|
||||||
else
|
else
|
||||||
: ${XBPS_DESTDIR:=$XBPS_MASTERDIR/pkg-destdir}
|
: ${XBPS_DESTDIR:=$XBPS_MASTERDIR/host/destdir}
|
||||||
fi
|
fi
|
||||||
: ${XBPS_PACKAGESDIR:=$XBPS_MASTERDIR/pkg-binpkgs}
|
: ${XBPS_PACKAGESDIR:=$XBPS_MASTERDIR/host/binpkgs}
|
||||||
: ${XBPS_BUILDDIR:=$XBPS_MASTERDIR/pkg-builddir}
|
: ${XBPS_BUILDDIR:=$XBPS_MASTERDIR/host/build}
|
||||||
: ${XBPS_SRCDISTDIR:=$XBPS_MASTERDIR/pkg-srcdistdir}
|
: ${XBPS_SRCDISTDIR:=$XBPS_MASTERDIR/host/sources}
|
||||||
: ${XBPS_TRIGGERSDIR:=$XBPS_SRCPKGDIR/xbps-triggers/files}
|
: ${XBPS_TRIGGERSDIR:=$XBPS_SRCPKGDIR/xbps-triggers/files}
|
||||||
|
|
||||||
DDIRS="TRIGGERSDIR HELPERSDIR SRCPKGDIR COMMONVARSDIR SHUTILSDIR"
|
DDIRS="TRIGGERSDIR HELPERSDIR SRCPKGDIR COMMONVARSDIR SHUTILSDIR"
|
||||||
|
@ -65,9 +65,7 @@ set_defvars()
|
||||||
if [ -n "$xver" ]; then
|
if [ -n "$xver" ]; then
|
||||||
# XBPS utils >= 0.9.0.
|
# XBPS utils >= 0.9.0.
|
||||||
xbps_conf="-C $XBPS_MASTERDIR/usr/local/etc/xbps-conf.plist"
|
xbps_conf="-C $XBPS_MASTERDIR/usr/local/etc/xbps-conf.plist"
|
||||||
if [ -n "$XBPS_CACHEDIR" ]; then
|
xbps_conf="$xbps_conf -c $XBPS_MASTERDIR/host/repocache"
|
||||||
xbps_conf="$xbps_conf -c $XBPS_CACHEDIR"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
export XBPS_PKGDB_CMD="xbps-uhelper.static -r $XBPS_MASTERDIR"
|
export XBPS_PKGDB_CMD="xbps-uhelper.static -r $XBPS_MASTERDIR"
|
||||||
export XBPS_BIN_CMD="xbps-bin.static $xbps_conf -r $XBPS_MASTERDIR"
|
export XBPS_BIN_CMD="xbps-bin.static $xbps_conf -r $XBPS_MASTERDIR"
|
||||||
|
|
|
@ -80,7 +80,7 @@ Targets:
|
||||||
|
|
||||||
extract [pkgname]
|
extract [pkgname]
|
||||||
Extract package source distribution file(s) into the build directory.
|
Extract package source distribution file(s) into the build directory.
|
||||||
By default set to <masterdir>/pkg-builddir.
|
By default set to <masterdir>/host/build.
|
||||||
|
|
||||||
fetch [pkgname]
|
fetch [pkgname]
|
||||||
Download package source distribution file(s).
|
Download package source distribution file(s).
|
||||||
|
@ -102,7 +102,7 @@ Targets:
|
||||||
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 master directory <masterdir>. By default set to
|
the master directory <masterdir>. By default set to
|
||||||
<masterdir>/pkg-binpkgs. To specify another repo, use -p <dir>.
|
<masterdir>/host/binpkgs. 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>.
|
||||||
|
@ -131,19 +131,19 @@ Options:
|
||||||
-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.
|
||||||
-D Only install <pkgname> to package's destination directory set
|
-D Only install <pkgname> to package's destination directory set
|
||||||
to <masterdir>/pkg-destdir/<pkgname>-<version>.
|
to <masterdir>/host/destdir/<pkgname>-<version>.
|
||||||
-h Usage output.
|
-h Usage output.
|
||||||
-K Do not remove automatic package dependencies while building
|
-K Do not remove automatic package dependencies while building
|
||||||
or installing a package with XBPS_PREFER_BINPKG_DEPS enabled.
|
or installing a package with XBPS_PREFER_BINPKG_DEPS enabled.
|
||||||
-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>/pkg-binpkgs.
|
<masterdir>/host/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.
|
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>/pkg-srcdistdir.
|
<masterdir>/host/sources.
|
||||||
|
|
||||||
_EOF
|
_EOF
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue