Change variable names and logic for BLFS book
Only use BLFS_COMMIT instead of BLFS_BRANCH_ID, BLFS_TREE, BLFS_BOOK Same for le LFS_BLFS variables
This commit is contained in:
parent
30a444a477
commit
9b99adace9
5 changed files with 38 additions and 79 deletions
48
Config.in
48
Config.in
|
@ -216,23 +216,19 @@ menu "BOOK Settings"
|
||||||
endmenu
|
endmenu
|
||||||
|
|
||||||
choice
|
choice
|
||||||
prompt "BLFS Release"
|
prompt "BLFS book version"
|
||||||
default BLFS_GIT
|
default BLFS_BRANCH
|
||||||
|
|
||||||
config BLFS_GIT
|
config BLFS_BRANCH
|
||||||
bool "BLFS GIT"
|
bool "BLFS Branch (default trunk) or any commit"
|
||||||
help
|
help
|
||||||
Current development version as in trunk
|
Use a BLFS book downloaded from the git repository, and
|
||||||
|
checked out at any commit (branch/tag/sha).
|
||||||
|
|
||||||
config BLFS_WORKING_COPY
|
config BLFS_WORKING_COPY
|
||||||
bool "BLFS working copy"
|
bool "BLFS working copy"
|
||||||
help
|
help
|
||||||
A local working copy of the BLFS book.
|
Use a local working copy of the BLFS book.
|
||||||
|
|
||||||
config BLFS_BRANCH
|
|
||||||
bool "BLFS Branch or stable book"
|
|
||||||
help
|
|
||||||
A supported GIT branch or stable (tag) book release
|
|
||||||
endchoice
|
endchoice
|
||||||
|
|
||||||
config BLFS_WC_LOCATION
|
config BLFS_WC_LOCATION
|
||||||
|
@ -242,9 +238,9 @@ menu "BOOK Settings"
|
||||||
help
|
help
|
||||||
Full path to the BLFS book working copy
|
Full path to the BLFS book working copy
|
||||||
|
|
||||||
config BLFS_BRANCH_ID
|
config BLFS_COMMIT
|
||||||
string "BLFS Book Version (mandatory)"
|
string "BLFS Book commit (branch/tag/sha)"
|
||||||
default "**EDIT ME**"
|
default "trunk"
|
||||||
depends on BLFS_BRANCH
|
depends on BLFS_BRANCH
|
||||||
help
|
help
|
||||||
Can be any branch, tag, or abbreviated (or not) commit sha.
|
Can be any branch, tag, or abbreviated (or not) commit sha.
|
||||||
|
@ -288,24 +284,20 @@ menu "BOOK Settings"
|
||||||
unless you know what you are doing...
|
unless you know what you are doing...
|
||||||
|
|
||||||
choice
|
choice
|
||||||
prompt "LFS Release"
|
prompt "LFS book version"
|
||||||
default LFS_relGIT
|
default LFS_BRANCH
|
||||||
depends on BOOK_BLFS
|
depends on BOOK_BLFS
|
||||||
|
|
||||||
config LFS_relGIT
|
config LFS_BRANCH
|
||||||
bool "LFS GIT"
|
bool "LFS branch (default trunk) or any commit"
|
||||||
help
|
help
|
||||||
Current development version as in trunk
|
Use an LFS book downloaded from the git repository and
|
||||||
|
checked out at any commit (branch/tag/sha).
|
||||||
|
|
||||||
config LFS_WORKING_COPY
|
config LFS_WORKING_COPY
|
||||||
bool "LFS working copy"
|
bool "LFS working copy"
|
||||||
help
|
help
|
||||||
A local working copy of the LFS book.
|
Use a local working copy of the LFS book.
|
||||||
|
|
||||||
config LFS_BRANCH
|
|
||||||
bool "LFS Branch or stable book"
|
|
||||||
help
|
|
||||||
A supported GIT branch or stable (tag) book release
|
|
||||||
endchoice
|
endchoice
|
||||||
|
|
||||||
config BLFS_LFS_BOOK
|
config BLFS_LFS_BOOK
|
||||||
|
@ -315,9 +307,9 @@ menu "BOOK Settings"
|
||||||
help
|
help
|
||||||
Full path to the LFS book working copy"
|
Full path to the LFS book working copy"
|
||||||
|
|
||||||
config BLFS_LFS_BRANCH_ID
|
config BLFS_LFS_COMMIT
|
||||||
string "LFS Book Version (mandatory)"
|
string "LFS Book Commit (mandatory)"
|
||||||
default "**EDIT ME**"
|
default "trunk"
|
||||||
depends on LFS_BRANCH
|
depends on LFS_BRANCH
|
||||||
help
|
help
|
||||||
Any branch, tag or abbreviated (or not) commit sha.
|
Any branch, tag or abbreviated (or not) commit sha.
|
||||||
|
|
|
@ -53,7 +53,7 @@ sudo cp -ruT --preserve=timestamps $BOOK \
|
||||||
sudo make -j1 -C $BUILDDIR$BLFS_ROOT \
|
sudo make -j1 -C $BUILDDIR$BLFS_ROOT \
|
||||||
REV=$INITSYS \
|
REV=$INITSYS \
|
||||||
LFS-BRANCH=${COMMIT} \
|
LFS-BRANCH=${COMMIT} \
|
||||||
BLFS-BRANCH=${BLFS_TREE} \
|
BLFS-BRANCH=${BLFS_COMMIT} \
|
||||||
update
|
update
|
||||||
sudo make -j1 -C $BUILDDIR$BLFS_ROOT \
|
sudo make -j1 -C $BUILDDIR$BLFS_ROOT \
|
||||||
REV=$INITSYS \
|
REV=$INITSYS \
|
||||||
|
@ -61,7 +61,7 @@ sudo make -j1 -C $BUILDDIR$BLFS_ROOT \
|
||||||
LFS_XML=$BUILDDIR$BLFS_ROOT/$LFS_XML \
|
LFS_XML=$BUILDDIR$BLFS_ROOT/$LFS_XML \
|
||||||
LFS-BRANCH="${COMMIT}" \
|
LFS-BRANCH="${COMMIT}" \
|
||||||
BLFS_XML=$BUILDDIR$BLFS_ROOT/$BLFS_XML \
|
BLFS_XML=$BUILDDIR$BLFS_ROOT/$BLFS_XML \
|
||||||
BLFS-BRANCH=${BLFS_TREE} \
|
BLFS-BRANCH=${BLFS_COMMIT} \
|
||||||
$BUILDDIR$BLFS_ROOT/packages.xml
|
$BUILDDIR$BLFS_ROOT/packages.xml
|
||||||
|
|
||||||
# But then $BUILDDIR/var/lib/ is owned by root if just created, which
|
# But then $BUILDDIR/var/lib/ is owned by root if just created, which
|
||||||
|
|
|
@ -40,7 +40,7 @@ inline_doc
|
||||||
|
|
||||||
# Additional variables
|
# Additional variables
|
||||||
local -r blfs_tool_PARAM_LIST="\
|
local -r blfs_tool_PARAM_LIST="\
|
||||||
BLFS_TREE BLFS_BRANCH_ID BLFS_ROOT BLFS_XML TRACKING_DIR \
|
BLFS_COMMIT BLFS_ROOT BLFS_XML TRACKING_DIR \
|
||||||
DEP_LIBXML DEP_LIBXSLT DEP_DBXML DEP_LYNX DEP_SUDO DEP_WGET \
|
DEP_LIBXML DEP_LIBXSLT DEP_DBXML DEP_LYNX DEP_SUDO DEP_WGET \
|
||||||
DEP_GIT DEP_GPM"
|
DEP_GIT DEP_GPM"
|
||||||
local -r custom_tool_PARAM_LIST="TRACKING_DIR"
|
local -r custom_tool_PARAM_LIST="TRACKING_DIR"
|
||||||
|
|
|
@ -10,10 +10,10 @@ TRACKING_DIR : where the installed package file is kept.
|
||||||
INITSYS : which books do you want? 'sysv' or 'systemd' (default sysv)
|
INITSYS : which books do you want? 'sysv' or 'systemd' (default sysv)
|
||||||
BLFS_ROOT : where the installed tools will be installed, relative to $HOME.
|
BLFS_ROOT : where the installed tools will be installed, relative to $HOME.
|
||||||
Must start with a '/' (default /blfs_root)
|
Must start with a '/' (default /blfs_root)
|
||||||
BLFS_BRANCH_ID: development, branch-xxx, xxx (where xxx is a valid tag)
|
BLFS_COMMIT : any commit (branch/tag/sha)
|
||||||
(default development)
|
(default trunk)
|
||||||
LFS_BRANCH_ID : development, branch-xxx, xxx (where xxx is a valid tag)
|
LFS_COMMIT : any commit (branch/tag/sha)
|
||||||
(default development)
|
(default trunk)
|
||||||
Examples:
|
Examples:
|
||||||
1 - If you plan to use the tools to build BLFS on top of LFS, but you did not
|
1 - If you plan to use the tools to build BLFS on top of LFS, but you did not
|
||||||
use jhalfs, or forgot to include the jhalfs-blfs tools:
|
use jhalfs, or forgot to include the jhalfs-blfs tools:
|
||||||
|
@ -67,18 +67,12 @@ fi
|
||||||
|
|
||||||
if [ "$BOOK_BLFS" = y ]; then
|
if [ "$BOOK_BLFS" = y ]; then
|
||||||
## Read variables and sanity checks
|
## Read variables and sanity checks
|
||||||
[[ "$relGIT" = y ]] && BLFS_BRANCH_ID=development
|
[[ "$BRANCH" = y ]] && BLFS_COMMIT=$COMMIT
|
||||||
[[ "$BRANCH" = y ]] && BLFS_BRANCH_ID=$BRANCH_ID
|
|
||||||
[[ "$WORKING_COPY" = y ]] && BLFS_BOOK=$BOOK
|
[[ "$WORKING_COPY" = y ]] && BLFS_BOOK=$BOOK
|
||||||
[[ "$BRANCH_ID" = "**EDIT ME**" ]] &&
|
|
||||||
echo You have not set the BLFS book version or branch && exit 1
|
|
||||||
[[ "$BOOK" = "**EDIT ME**" ]] &&
|
[[ "$BOOK" = "**EDIT ME**" ]] &&
|
||||||
echo You have not set the BLFS working copy location && exit 1
|
echo You have not set the BLFS working copy location && exit 1
|
||||||
[[ "$LFS_relGIT" = y ]] && LFS_BRANCH_ID=development
|
[[ "$LFS_BRANCH" = y ]] && LFS_COMMIT=$BLFS_LFS_COMMIT
|
||||||
[[ "$LFS_BRANCH" = y ]] && LFS_BRANCH_ID=$BLFS_LFS_BRANCH_ID
|
|
||||||
[[ "$LFS_WORKING_COPY" = y ]] && LFS_BOOK=$BLFS_LFS_BOOK
|
[[ "$LFS_WORKING_COPY" = y ]] && LFS_BOOK=$BLFS_LFS_BOOK
|
||||||
[[ "$LFS_BRANCH_ID" = "**EDIT ME**" ]] &&
|
|
||||||
echo You have not set the LFS book version or branch && exit 1
|
|
||||||
[[ "$LFS_BOOK" = "**EDIT ME**" ]] &&
|
[[ "$LFS_BOOK" = "**EDIT ME**" ]] &&
|
||||||
echo You have not set the LFS working copy location && exit 1
|
echo You have not set the LFS working copy location && exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -90,8 +84,8 @@ BUILDDIR=$(cd ~;pwd)
|
||||||
BLFS_ROOT="${BLFS_ROOT:=/blfs_root}"
|
BLFS_ROOT="${BLFS_ROOT:=/blfs_root}"
|
||||||
TRACKING_DIR="${TRACKING_DIR:=/var/lib/jhalfs/BLFS}"
|
TRACKING_DIR="${TRACKING_DIR:=/var/lib/jhalfs/BLFS}"
|
||||||
INITSYS="${INITSYS:=sysv}"
|
INITSYS="${INITSYS:=sysv}"
|
||||||
BLFS_BRANCH_ID=${BLFS_BRANCH_ID:=development}
|
BLFS_COMMIT=${BLFS_COMMIT:=trunk}
|
||||||
LFS_BRANCH_ID=${LFS_BRANCH_ID:=development}
|
LFS_COMMIT=${LFS_COMMIT:=trunk}
|
||||||
BLFS_XML=${BLFS_XML:=blfs-xml}
|
BLFS_XML=${BLFS_XML:=blfs-xml}
|
||||||
LFS_XML=${LFS_XML:=lfs-xml}
|
LFS_XML=${LFS_XML:=lfs-xml}
|
||||||
|
|
||||||
|
@ -100,12 +94,12 @@ PARAMS="BLFS_ROOT TRACKING_DIR INITSYS BLFS_XML LFS_XML"
|
||||||
if [ "$WORKING_COPY" = y ]; then
|
if [ "$WORKING_COPY" = y ]; then
|
||||||
PARAMS="$PARAMS WORKING_COPY BLFS_BOOK"
|
PARAMS="$PARAMS WORKING_COPY BLFS_BOOK"
|
||||||
else
|
else
|
||||||
PARAMS="$PARAMS BLFS_BRANCH_ID"
|
PARAMS="$PARAMS BLFS_COMMIT"
|
||||||
fi
|
fi
|
||||||
if [ "$LFS_WORKING_COPY" = y ]; then
|
if [ "$LFS_WORKING_COPY" = y ]; then
|
||||||
PARAMS="$PARAMS LFS_WORKING_COPY LFS_BOOK"
|
PARAMS="$PARAMS LFS_WORKING_COPY LFS_BOOK"
|
||||||
else
|
else
|
||||||
PARAMS="$PARAMS LFS_BRANCH_ID"
|
PARAMS="$PARAMS LFS_COMMIT"
|
||||||
fi
|
fi
|
||||||
# Format for displaying parameters:
|
# Format for displaying parameters:
|
||||||
declare -r PARAM_VALS='${config_param}${dotSTR:${#config_param}} ${L_arrow}${BOLD}${!config_param}${OFF}${R_arrow}'
|
declare -r PARAM_VALS='${config_param}${dotSTR:${#config_param}} ${L_arrow}${BOLD}${!config_param}${OFF}${R_arrow}'
|
||||||
|
@ -131,17 +125,6 @@ source $COMMON_DIR/libs/func_check_version.sh
|
||||||
|
|
||||||
[[ $VERBOSITY > 0 ]] && echo "${SD_BORDER}${nl_}"
|
[[ $VERBOSITY > 0 ]] && echo "${SD_BORDER}${nl_}"
|
||||||
|
|
||||||
case $BLFS_BRANCH_ID in
|
|
||||||
development ) BLFS_TREE=trunk ;;
|
|
||||||
branch-* ) BLFS_TREE=${BLFS_BRANCH_ID#branch-} ;;
|
|
||||||
* ) BLFS_TREE=${BLFS_BRANCH_ID} ;;
|
|
||||||
esac
|
|
||||||
case $LFS_BRANCH_ID in
|
|
||||||
development ) LFS_TREE=trunk ;;
|
|
||||||
branch-* ) LFS_TREE=${LFS_BRANCH_ID#branch-} ;;
|
|
||||||
* ) LFS_TREE=${LFS_BRANCH_ID} ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Check for build prerequisites.
|
# Check for build prerequisites.
|
||||||
echo
|
echo
|
||||||
check_alfs_tools
|
check_alfs_tools
|
||||||
|
@ -193,11 +176,9 @@ make -j1 -C $BUILDDIR$BLFS_ROOT \
|
||||||
TRACKING_DIR=$TRACKING_DIR \
|
TRACKING_DIR=$TRACKING_DIR \
|
||||||
REV=$INITSYS \
|
REV=$INITSYS \
|
||||||
LFS_XML=$BUILDDIR$BLFS_ROOT/$LFS_XML \
|
LFS_XML=$BUILDDIR$BLFS_ROOT/$LFS_XML \
|
||||||
LFS-GIT=git://git.linuxfromscratch.org/lfs.git \
|
LFS-BRANCH=${LFS_COMMIT} \
|
||||||
LFS-BRANCH=${LFS_TREE} \
|
|
||||||
BLFS_XML=$BUILDDIR$BLFS_ROOT/$BLFS_XML \
|
BLFS_XML=$BUILDDIR$BLFS_ROOT/$BLFS_XML \
|
||||||
GIT=git://git.linuxfromscratch.org/blfs.git \
|
BLFS-BRANCH=${BLFS_COMMIT} \
|
||||||
BLFS-BRANCH=${BLFS_TREE} \
|
|
||||||
$BUILDDIR$BLFS_ROOT/packages.xml
|
$BUILDDIR$BLFS_ROOT/packages.xml
|
||||||
[[ $VERBOSITY > 0 ]] && echo "... OK"
|
[[ $VERBOSITY > 0 ]] && echo "... OK"
|
||||||
|
|
||||||
|
|
20
jhalfs
20
jhalfs
|
@ -243,28 +243,14 @@ if [[ "${BLFS_TOOL}" = "y" ]] ; then
|
||||||
# simple_message 'Checking supplementary tools for installing BLFS'
|
# simple_message 'Checking supplementary tools for installing BLFS'
|
||||||
# check_blfs_tools
|
# check_blfs_tools
|
||||||
simple_message "${SD_BORDER}${nl_}"
|
simple_message "${SD_BORDER}${nl_}"
|
||||||
BLFS_GIT=${BLFS_GIT:-n}
|
|
||||||
BLFS_WORKING_COPY=${BLFS_WORKING_COPY:-n}
|
|
||||||
BLFS_BRANCH=${BLFS_BRANCH:-n}
|
BLFS_BRANCH=${BLFS_BRANCH:-n}
|
||||||
if [[ "${BLFS_GIT}" = "y" ]]; then
|
BLFS_WORKING_COPY=${BLFS_WORKING_COPY:-n}
|
||||||
BLFS_BRANCH_ID=development
|
if [[ "${BLFS_WORKING_COPY}" = "y" ]] &&
|
||||||
BLFS_TREE=trunk
|
[[ ! -d "$BLFS_WC_LOCATION/postlfs" ]] ; then
|
||||||
elif [[ "${BLFS_WORKING_COPY}" = "y" ]]; then
|
|
||||||
if [[ ! -d "$BLFS_WC_LOCATION/postlfs" ]] ; then
|
|
||||||
echo " BLFS tools: This is not a working copy: $BLFS_WC_LOCATION."
|
echo " BLFS tools: This is not a working copy: $BLFS_WC_LOCATION."
|
||||||
echo " Please rerun make and fix the configuration."
|
echo " Please rerun make and fix the configuration."
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
BLFS_TREE=$(cd $BLFS_WC_LOCATION; git branch --show-current)
|
|
||||||
BLFS_BRANCH_ID=${BLFS_TREE/trunk/development}
|
|
||||||
elif [[ "${BLFS_BRANCH}" = "y" ]] ; then
|
|
||||||
case $BLFS_BRANCH_ID in
|
|
||||||
*EDIT* ) echo " You forgot to set the BLFS branch or stable book version."
|
|
||||||
echo " Please rerun make and fix the configuration."
|
|
||||||
exit 2 ;;
|
|
||||||
* ) BLFS_TREE=${BLFS_BRANCH_ID#branch-}
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
load_file "${COMMON_DIR}/libs/func_install_blfs"
|
load_file "${COMMON_DIR}/libs/func_install_blfs"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Reference in a new issue