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