source: BLFS/update_book.sh@ f65d3cb

2.3 2.3.x 2.4 ablfs ablfs-more legacy new_features trunk
Last change on this file since f65d3cb was 8cb88dc, checked in by Manuel Canales Esparcia <manuel@…>, 18 years ago

Renamed packages.sh to update_book.sh.

  • Property mode set to 100755
File size: 2.2 KB
RevLine 
[3c10176]1#!/bin/bash
2#
3# $Id$
4#
5set -e
6
7declare -r SVN="svn://svn.linuxfromscratch.org"
8
9BLFS_XML=$1 # Book directory
[82aa9bf]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
[3c10176]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
[82aa9bf]26 function: Retrieve or upate a copy of the BLFS book
27 input vars: $1 BLFS_XML book sources directory
[3c10176]28 $2 DOC_MODE action get/update
[82aa9bf]29 $3 TREE SVN tree when $2=get
[3c10176]30 externals: none
31 modifies: $BLFS_XML directory tree
32 returns: nothing
[4cbc48f]33 output:
[3c10176]34 on error: exit
35 on success: text messages
36inline_doc
37
[82aa9bf]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 ;;
[4cbc48f]60
[82aa9bf]61 get )
62 [[ ! -d $BLFS_XML ]] && mkdir -pv $BLFS_XML
63 svn co $SVN/BLFS/$TREE $BLFS_XML 2>&1
[3c10176]64 ;;
[82aa9bf]65 * )
66 echo -e "\n\tUnknown option ${DOC_MODE} ignored.\n"
67 ;;
68 esac
[3c10176]69}
70
[82aa9bf]71BOOK_Source
[3c10176]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.