Changeset 82aa9bf for BLFS


Ignore:
Timestamp:
08/13/2006 11:15:07 AM (18 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
2.3, 2.3.x, 2.4, ablfs, ablfs-more, legacy, new_features, trunk
Children:
8cb88dc
Parents:
cb18ec7
Message:

Added support for branches and setting default values.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BLFS/packages.sh

    rcb18ec7 r82aa9bf  
    88
    99BLFS_XML=$1  # Book directory
    10 DOC_MODE=$2  # Action to take, only update at the moment
     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
    1116
    1217#---------------------
     
    1924#----------------------------#
    2025: <<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
     26    function:   Retrieve or upate a copy of the BLFS book
     27    input vars: $1 BLFS_XML book sources directory
    2328                $2 DOC_MODE action get/update
     29                $3 TREE     SVN tree when $2=get
    2430    externals:  none
    2531    modifies:   $BLFS_XML directory tree
     
    3036inline_doc
    3137
    32     # Redundant definitions but this function may be reused
    33   local BLFS_XML=$1
    34   local DOC_MODE=$2
     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
    3548
    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
     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      ;;
    4060
    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"
     61    get )
     62      [[ ! -d $BLFS_XML ]] && mkdir -pv $BLFS_XML
     63      svn co $SVN/BLFS/$TREE $BLFS_XML 2>&1
    7164      ;;
    72     esac
    73   fi
     65    * )
     66        echo -e "\n\tUnknown option ${DOC_MODE} ignored.\n"
     67    ;;
     68  esac
    7469}
    7570
    76 BOOK_Source $BLFS_XML $DOC_MODE
     71BOOK_Source
    7772
    7873echo -en "\n\tGenerating packages file ..."
Note: See TracChangeset for help on using the changeset viewer.