Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/freebsd/poudriere.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/share
diff options
context:
space:
mode:
authorBryan Drewery <bryan@shatow.net>2022-05-28 17:46:00 +0300
committerBryan Drewery <bryan@shatow.net>2022-05-28 17:46:00 +0300
commit6eea9e5ef4a53da98f6aac32ec00a8b11d97a2a0 (patch)
treedae5e0d93f4238f40c1ca489cebe5d146567475b /src/share
parent4bebcc5be8617c5fa51b28de46dbbf8eb96eb360 (diff)
options: Add -o flag to specify PORT_DBDIR name to write to.
-o port_dbdir will expand to $POUDRIERE_ETC/$port_dbdir. The -jpz flags will be used for the make.conf, poudriere.conf, and ports tree. Fixes #111 Fixes #583 Fixes #176
Diffstat (limited to 'src/share')
-rwxr-xr-xsrc/share/poudriere/options.sh20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/share/poudriere/options.sh b/src/share/poudriere/options.sh
index e325cde8..df66b9f2 100755
--- a/src/share/poudriere/options.sh
+++ b/src/share/poudriere/options.sh
@@ -42,6 +42,7 @@ Options:
-c -- Use 'make config' target
-C -- Use 'make config-conditional' target (default)
-j name -- Run on the given jail
+ -o name -- Specify name of options directory to write to
-p tree -- Specify on which ports tree the configuration will be done
-n -- Do not configure/show/remove options of dependencies
-r -- Remove port options instead of configuring them
@@ -58,10 +59,11 @@ PTNAME_TMP=""
DO_RECURSE=y
COMMAND=config-conditional
RECURSE_COMMAND=config-recursive
+OFLAG=0
[ $# -eq 0 ] && usage
-while getopts "a:cCj:f:p:nrsz:" FLAG; do
+while getopts "a:cCj:f:o:p:nrsz:" FLAG; do
case "${FLAG}" in
a)
ARCH=${OPTARG}
@@ -86,6 +88,10 @@ while getopts "a:cCj:f:p:nrsz:" FLAG; do
OPTARG="${SAVED_PWD}/${OPTARG}"
LISTPKGS="${LISTPKGS:+${LISTPKGS} }${OPTARG}"
;;
+ o)
+ PORT_DBDIRNAME="${OPTARG}"
+ OFLAG=1
+ ;;
p)
porttree_exists ${OPTARG} ||
err 2 "No such ports tree: ${OPTARG}"
@@ -132,11 +138,14 @@ command -v dialog4ports >/dev/null 2>&1 || err 1 "You must have ports-mgmt/dialo
read_packages_from_params "$@"
OLD_PORT_DBDIR=${POUDRIERED}/${JAILNAME}${JAILNAME:+-}${SETNAME}${SETNAME:+-}options
-PORT_DBDIR=${POUDRIERED}/${JAILNAME}${JAILNAME:+-}${PTNAME_TMP}${PTNAME_TMP:+-}${SETNAME}${SETNAME:+-}options
+: ${PORT_DBDIRNAME:="${JAILNAME}${JAILNAME:+-}${PTNAME_TMP}${PTNAME_TMP:+-}${SETNAME}${SETNAME:+-}options"}
+PORT_DBDIR="${POUDRIERED}/${PORT_DBDIRNAME}"
-if [ -d "${OLD_PORT_DBDIR}" ] && [ ! -d "${PORT_DBDIR}" ]; then
+if [ "${OFLAG}" -eq 0 ] &&
+ [ -d "${OLD_PORT_DBDIR}" ] && [ ! -d "${PORT_DBDIR}" ]; then
msg_warn "You already have options configured without '-p ${PTNAME_TMP}' that will no longer be used."
msg_warn "Drop the '-p ${PTNAME_TMP}' option to avoid this problem."
+ msg_warn "Alternatively use '-o dirname' to write to a different directory than -jpz specify."
if [ -t 0 ]; then
confirm_if_tty "Are you sure you want to continue?" || exit 0
else
@@ -144,8 +153,9 @@ if [ -d "${OLD_PORT_DBDIR}" ] && [ ! -d "${PORT_DBDIR}" ]; then
fi
fi
-mkdir -p ${PORT_DBDIR}
-msg "Working on options directory ${PORT_DBDIR}"
+mkdir -p "${PORT_DBDIR}"
+msg "Working on options directory: ${PORT_DBDIR}"
+msg "Using ports from: ${PORTSDIR}"
__MAKE_CONF=$(mktemp -t poudriere-make.conf)
export __MAKE_CONF