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, only update at the moment
|
---|
11 |
|
---|
12 | #---------------------
|
---|
13 | # packages module
|
---|
14 | source libs/func_packages
|
---|
15 | [[ $? > 0 ]] && echo -e "\n\tERROR: func_packages did not load..\n" && exit
|
---|
16 |
|
---|
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
|
---|
31 |
|
---|
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
|
---|
40 |
|
---|
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
|
---|
48 | if [[ ! -f $BLFS_XML/x/x.xml ]] ; then
|
---|
49 | echo -e "\n\tLooks like $BLFS_XML is not a BLFS book sources directory\n"
|
---|
50 | exit 1
|
---|
51 | fi
|
---|
52 |
|
---|
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"
|
---|
71 | ;;
|
---|
72 | esac
|
---|
73 | fi
|
---|
74 | }
|
---|
75 |
|
---|
76 | BOOK_Source $BLFS_XML $DOC_MODE
|
---|
77 |
|
---|
78 | echo -en "\n\tGenerating packages file ..."
|
---|
79 | generate_packages
|
---|
80 | echo "done."
|
---|
81 |
|
---|
82 | echo -en "\tGenerating gnome-core dependencies list ..."
|
---|
83 | generate_gnome_core
|
---|
84 | echo "done."
|
---|
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 |
|
---|