source: BLFS/update_book.sh@ b5effd5

experimental
Last change on this file since b5effd5 was 00f4966, checked in by Manuel Canales Esparcia <manuel@…>, 18 years ago

Merged r2936:2940 from trunk

  • Property mode set to 100755
File size: 2.2 KB
Line 
1#!/bin/bash
2#
3# $Id$
4#
5set -e
6
7declare -r SVN="svn://svn.linuxfromscratch.org"
8
9BLFS_XML=$1 # Book directory
10DOC_MODE=$2 # Action to take, update or get
11TREE=$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
19source libs/func_packages
20[[ $? > 0 ]] && echo -e "\n\tERROR: func_packages did not load..\n" && exit
21
22#----------------------------#
23BOOK_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
36inline_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
71BOOK_Source
72
73echo -en "\n\tGenerating packages file ..."
74generate_packages
75echo "done."
76
77echo -en "\tGenerating gnome-core dependencies list ..."
78generate_gnome_core
79echo "done."
80
81echo -en "\tGenerating gnome-full dependencies list ..."
82generate_gnome_full
83echo "done."
84
85echo -en "\tGenerating kde-core dependencies list ..."
86generate_kde_core
87echo "done."
88
89echo -en "\tGenerating kde-full dependencies list ..."
90generate_kde_full
91echo -e "done.\n"
92
Note: See TracBrowser for help on using the repository browser.