Changeset 37b4eab


Ignore:
Timestamp:
06/12/2006 07:57:50 PM (18 years ago)
Author:
George Boudreau <georgeb@…>
Branches:
experimental
Children:
3d888ef
Parents:
043bcbe
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BLFS/packages.sh

    r043bcbe r37b4eab  
    44#
    55set -e
     6
     7declare -r SVN="svn://svn.linuxfromscratch.org"
    68
    79BLFS_XML=$1  # Book directory
     
    1315[[ $? > 0 ]] && echo -e "\n\tERROR: func_packages did not load..\n" && exit
    1416
     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
    1531
    16 if [[ -z "$1" ]] ; then
    17   echo -e "\n\tYou must to provide the name of the BLFS book sources directory.\n"
    18   exit 1
    19 fi
     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
    2040
    21 if [[ ! -d $BLFS_XML ]] ; then
    22   echo -e "\n\t$BLFS_XML is not a directory\n"
    23   exit 1
    24 fi
     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
    2552
    26 if [[ ! -f $BLFS_XML/use-unzip.xml ]] ; then
    27   echo -e "\n\tLooks like $BLFS_XML is not a BLFS book sources directory\n"
    28   exit 1
    29 fi
     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}
    3075
    31 if [[ -n "$DOC_MODE" ]] ; then
    32   case $DOC_MODE in
    33     update )
    34       if [[ -d $BLFS_XML/.svn ]] ; then
    35       echo -e "\n\tUpdating the $BLFS_XML book sources ...\n"
    36         pushd $BLFS_XML 1> /dev/null
    37         svn up
    38         popd 1> /dev/null
    39         echo -e "\n\tBook sources updated."
    40       else
    41         echo -e "\n\tLooks like $BLFS_XML is not a svn working copy."
    42         echo -e "\tSkipping BLFS sources update.\n"
    43       fi
    44       ;;
    45     * )
    46       echo -e "\n\tUnknown option ${DOC_MODE} ignored.\n"
    47       ;;
    48   esac
    49 fi
     76BOOK_Source $BLFS_XML $DOC_MODE
    5077
    5178echo -en "\n\tGenerating packages file ..."
Note: See TracChangeset for help on using the changeset viewer.