2006-07-16 12:29:37 +02:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# $Id$
|
|
|
|
#
|
|
|
|
set -e
|
|
|
|
|
|
|
|
declare -r SVN="svn://svn.linuxfromscratch.org"
|
|
|
|
|
2006-08-24 22:38:22 +02:00
|
|
|
DOC_MODE=$1 # Action to take, update, get or none
|
|
|
|
BLFS_XML=$2 # Book directory
|
2006-08-13 13:15:07 +02:00
|
|
|
TREE=$3 # SVN tree for the BLFS book version
|
|
|
|
|
|
|
|
[[ -z $BLFS_XML ]] && BLFS_XML=blfs-xml
|
|
|
|
[[ -z $DOC_MODE ]] && DOC_MODE=update
|
|
|
|
[[ -z $TREE ]] && TREE=trunk/BOOK
|
2006-07-16 12:29:37 +02:00
|
|
|
|
2006-08-24 22:38:22 +02:00
|
|
|
TRACKING_DIR=tracking-dir
|
|
|
|
|
2006-07-16 12:29:37 +02:00
|
|
|
#---------------------
|
|
|
|
# packages module
|
|
|
|
source libs/func_packages
|
|
|
|
[[ $? > 0 ]] && echo -e "\n\tERROR: func_packages did not load..\n" && exit
|
|
|
|
|
|
|
|
#----------------------------#
|
|
|
|
BOOK_Source() { #
|
|
|
|
#----------------------------#
|
|
|
|
: <<inline_doc
|
2006-08-13 13:15:07 +02:00
|
|
|
function: Retrieve or upate a copy of the BLFS book
|
|
|
|
input vars: $1 BLFS_XML book sources directory
|
2006-07-16 12:29:37 +02:00
|
|
|
$2 DOC_MODE action get/update
|
2006-08-13 13:15:07 +02:00
|
|
|
$3 TREE SVN tree when $2=get
|
2006-07-16 12:29:37 +02:00
|
|
|
externals: none
|
|
|
|
modifies: $BLFS_XML directory tree
|
|
|
|
returns: nothing
|
2006-08-06 12:06:07 +02:00
|
|
|
output:
|
2006-07-16 12:29:37 +02:00
|
|
|
on error: exit
|
|
|
|
on success: text messages
|
|
|
|
inline_doc
|
|
|
|
|
2006-08-13 13:15:07 +02:00
|
|
|
case $DOC_MODE in
|
|
|
|
update )
|
|
|
|
if [[ ! -d $BLFS_XML ]] ; then
|
|
|
|
echo -e "\n\t$BLFS_XML is not a directory\n"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
if [[ ! -f $BLFS_XML/x/x.xml ]] ; then
|
|
|
|
echo -e "\n\tLooks like $BLFS_XML is not a BLFS book sources directory\n"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ -d $BLFS_XML/.svn ]] ; then
|
|
|
|
echo -e "\n\tUpdating the $BLFS_XML book sources ...\n"
|
|
|
|
pushd $BLFS_XML 1> /dev/null
|
|
|
|
svn up
|
|
|
|
popd 1> /dev/null
|
|
|
|
echo -e "\n\tBook sources updated."
|
|
|
|
else
|
|
|
|
echo -e "\n\tLooks like $BLFS_XML is not a svn working copy."
|
|
|
|
echo -e "\tSkipping BLFS sources update.\n"
|
|
|
|
fi
|
|
|
|
;;
|
2006-08-06 12:06:07 +02:00
|
|
|
|
2006-08-13 13:15:07 +02:00
|
|
|
get )
|
|
|
|
[[ ! -d $BLFS_XML ]] && mkdir -pv $BLFS_XML
|
|
|
|
svn co $SVN/BLFS/$TREE $BLFS_XML 2>&1
|
2006-07-16 12:29:37 +02:00
|
|
|
;;
|
2006-08-13 13:15:07 +02:00
|
|
|
* )
|
|
|
|
echo -e "\n\tUnknown option ${DOC_MODE} ignored.\n"
|
|
|
|
;;
|
|
|
|
esac
|
2006-07-16 12:29:37 +02:00
|
|
|
}
|
|
|
|
|
2006-08-24 22:38:22 +02:00
|
|
|
[ "${DOC_MODE}" != "none" ] && BOOK_Source
|
|
|
|
|
|
|
|
if [ "${DOC_MODE}" = "none" ] ; then
|
|
|
|
echo -en "\n\tGenerating packages database file ..."
|
2007-07-25 23:53:33 +02:00
|
|
|
LC_ALL=C && generate_packages
|
2006-08-24 22:38:22 +02:00
|
|
|
echo "done."
|
|
|
|
|
|
|
|
echo -en "\tGenerating alsa dependencies list ..."
|
|
|
|
generate_alsa
|
|
|
|
echo "done."
|
|
|
|
|
|
|
|
echo -en "\tGenerating gnome-core dependencies list ..."
|
|
|
|
generate_gnome_core
|
|
|
|
echo "done."
|
2006-07-16 12:29:37 +02:00
|
|
|
|
2006-08-24 22:38:22 +02:00
|
|
|
echo -en "\tGenerating gnome-full dependencies list ..."
|
|
|
|
generate_gnome_full
|
|
|
|
echo "done."
|
2006-07-16 12:29:37 +02:00
|
|
|
|
2006-08-24 22:38:22 +02:00
|
|
|
echo -en "\tGenerating kde-core dependencies list ..."
|
|
|
|
generate_kde_core
|
|
|
|
echo "done."
|
2006-07-16 12:29:37 +02:00
|
|
|
|
2006-08-24 22:38:22 +02:00
|
|
|
echo -en "\tGenerating kde-full dependencies list ..."
|
|
|
|
generate_kde_full
|
|
|
|
echo -e "done."
|
2006-07-16 12:29:37 +02:00
|
|
|
|
2006-08-24 22:38:22 +02:00
|
|
|
echo -en "\tGenerating kde-koffice dependencies list ..."
|
|
|
|
generate_kde_koffice
|
|
|
|
echo -e "done."
|
2006-07-16 12:29:37 +02:00
|
|
|
|
2006-08-24 22:38:22 +02:00
|
|
|
echo -en "\tGenerating xorg7 dependencies list ..."
|
|
|
|
generate_xorg7
|
|
|
|
echo "done."
|
|
|
|
fi
|
2006-07-16 12:29:37 +02:00
|
|
|
|