source: BLFS/packages.sh@ d3f24df

experimental
Last change on this file since d3f24df was 37b4eab, checked in by George Boudreau <georgeb@…>, 18 years ago

packages.sh, added the ability to <get> a copy of the BLFS svn tree

  • Property mode set to 100755
File size: 2.4 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, only update at the moment
11
12#---------------------
13# packages module
14source libs/func_packages
15[[ $? > 0 ]] && echo -e "\n\tERROR: func_packages did not load..\n" && exit
16
17#----------------------------#
18BOOK_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
30inline_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/use-unzip.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
76BOOK_Source $BLFS_XML $DOC_MODE
77
78echo -en "\n\tGenerating packages file ..."
79generate_packages
80echo "done."
81
82echo -en "\tGenerating gnome-core dependencies list ..."
83generate_gnome_core
84echo "done."
85
86echo -en "\tGenerating gnome-full dependencies list ..."
87generate_gnome_full
88echo "done."
89
90echo -en "\tGenerating kde-core dependencies list ..."
91generate_kde_core
92echo "done."
93
94echo -en "\tGenerating kde-full dependencies list ..."
95generate_kde_full
96echo -e "done.\n"
97
Note: See TracBrowser for help on using the repository browser.