[00f4966] | 1 | #!/bin/bash
|
---|
| 2 | #
|
---|
| 3 | # $Id$
|
---|
| 4 | #
|
---|
| 5 | set -e
|
---|
| 6 |
|
---|
| 7 | declare -r SVN="svn://svn.linuxfromscratch.org"
|
---|
| 8 |
|
---|
| 9 | BLFS_XML=$1 # Book directory
|
---|
| 10 | DOC_MODE=$2 # Action to take, update or get
|
---|
| 11 | TREE=$3 # SVN tree for the BLFS book version
|
---|
| 12 |
|
---|
| 13 | [[ -z $BLFS_XML ]] && BLFS_XML=blfs-xml
|
---|
| 14 | [[ -z $DOC_MODE ]] && DOC_MODE=update
|
---|
| 15 | [[ -z $TREE ]] && TREE=trunk/BOOK
|
---|
| 16 |
|
---|
| 17 | #---------------------
|
---|
| 18 | # packages module
|
---|
| 19 | source libs/func_packages
|
---|
| 20 | [[ $? > 0 ]] && echo -e "\n\tERROR: func_packages did not load..\n" && exit
|
---|
| 21 |
|
---|
| 22 | #----------------------------#
|
---|
| 23 | BOOK_Source() { #
|
---|
| 24 | #----------------------------#
|
---|
| 25 | : <<inline_doc
|
---|
| 26 | function: Retrieve or upate a copy of the BLFS book
|
---|
| 27 | input vars: $1 BLFS_XML book sources directory
|
---|
| 28 | $2 DOC_MODE action get/update
|
---|
| 29 | $3 TREE SVN tree when $2=get
|
---|
| 30 | externals: none
|
---|
| 31 | modifies: $BLFS_XML directory tree
|
---|
| 32 | returns: nothing
|
---|
| 33 | output:
|
---|
| 34 | on error: exit
|
---|
| 35 | on success: text messages
|
---|
| 36 | inline_doc
|
---|
| 37 |
|
---|
| 38 | case $DOC_MODE in
|
---|
| 39 | update )
|
---|
| 40 | if [[ ! -d $BLFS_XML ]] ; then
|
---|
| 41 | echo -e "\n\t$BLFS_XML is not a directory\n"
|
---|
| 42 | exit 1
|
---|
| 43 | fi
|
---|
| 44 | if [[ ! -f $BLFS_XML/x/x.xml ]] ; then
|
---|
| 45 | echo -e "\n\tLooks like $BLFS_XML is not a BLFS book sources directory\n"
|
---|
| 46 | exit 1
|
---|
| 47 | fi
|
---|
| 48 |
|
---|
| 49 | if [[ -d $BLFS_XML/.svn ]] ; then
|
---|
| 50 | echo -e "\n\tUpdating the $BLFS_XML book sources ...\n"
|
---|
| 51 | pushd $BLFS_XML 1> /dev/null
|
---|
| 52 | svn up
|
---|
| 53 | popd 1> /dev/null
|
---|
| 54 | echo -e "\n\tBook sources updated."
|
---|
| 55 | else
|
---|
| 56 | echo -e "\n\tLooks like $BLFS_XML is not a svn working copy."
|
---|
| 57 | echo -e "\tSkipping BLFS sources update.\n"
|
---|
| 58 | fi
|
---|
| 59 | ;;
|
---|
| 60 |
|
---|
| 61 | get )
|
---|
| 62 | [[ ! -d $BLFS_XML ]] && mkdir -pv $BLFS_XML
|
---|
| 63 | svn co $SVN/BLFS/$TREE $BLFS_XML 2>&1
|
---|
| 64 | ;;
|
---|
| 65 | * )
|
---|
| 66 | echo -e "\n\tUnknown option ${DOC_MODE} ignored.\n"
|
---|
| 67 | ;;
|
---|
| 68 | esac
|
---|
| 69 | }
|
---|
| 70 |
|
---|
| 71 | BOOK_Source
|
---|
| 72 |
|
---|
| 73 | echo -en "\n\tGenerating packages file ..."
|
---|
| 74 | generate_packages
|
---|
| 75 | echo "done."
|
---|
| 76 |
|
---|
| 77 | echo -en "\tGenerating gnome-core dependencies list ..."
|
---|
| 78 | generate_gnome_core
|
---|
| 79 | echo "done."
|
---|
| 80 |
|
---|
| 81 | echo -en "\tGenerating gnome-full dependencies list ..."
|
---|
| 82 | generate_gnome_full
|
---|
| 83 | echo "done."
|
---|
| 84 |
|
---|
| 85 | echo -en "\tGenerating kde-core dependencies list ..."
|
---|
| 86 | generate_kde_core
|
---|
| 87 | echo "done."
|
---|
| 88 |
|
---|
| 89 | echo -en "\tGenerating kde-full dependencies list ..."
|
---|
| 90 | generate_kde_full
|
---|
| 91 | echo -e "done.\n"
|
---|
| 92 |
|
---|