Changeset de67016


Ignore:
Timestamp:
04/30/2021 12:21:44 PM (3 years ago)
Author:
Pierre Labastie <pierre.labastie@…>
Branches:
ablfs-more, legacy, trunk
Children:
dfab075
Parents:
dd5d63d
Message:

Adapt func_book_parser to git

The variable name "TREE" makes no sense now. It is rather a branch or a tag.
So more work is needed here.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • common/libs/func_book_parser

    rdd5d63d rde67016  
    1010  if [ -z $WORKING_COPY ] ; then
    1111# Check for Subversion or git instead of just letting the script fail.
     12    test `type -p git` || eval "echo \"This feature requires Git.\"
     13    exit 1"
     14
     15    echo -n "Downloading the $PROGNAME document, $LFSVRS version... "
     16
    1217    case $PROGNAME in
    13       lfs | hlfs)
    14         test `type -p svn` || eval "echo \"This feature requires Subversion.\"
    15         exit 1"
    16       ;;
    17       clfs*)
    18         test `type -p git` || eval "echo \"This feature requires Git.\"
    19         exit 1"
    20       ;;
    21     esac
    22 
    23     echo -n "Downloading the $PROGNAME document, $LFSVRS version... "
    24 
    25     case $PROGNAME in
    26       lfs) svn_root="LFS" ;;
    27       hlfs) svn_root="HLFS" ;;
     18      lfs) git_root="lfs.git" ;;
    2819      clfs*) ;;
    2920      *) echo "BOOK not defined in function <get_book>"
     
    3324    # repo. If we've already extracted the commands, move on to getting the
    3425    # sources.
    35     if [ $PROGNAME == "lfs" ] || [ $PROGNAME == "hlfs" ] &&
    36                                  [ ! -d ${PROGNAME}-${LFSVRS}/.svn ]; then
    37         svn co $SVN/${svn_root}/${TREE} ${PROGNAME}-$LFSVRS >>$LOGDIR/$LOG 2>&1
    38     elif [ $PROGNAME == "clfs" ]  || [ $PROGNAME == "clfs2" ] ||
    39          [ $PROGNAME == "clfs3" ] && [ ! -d ${PROGNAME}-${LFSVRS}/.git ]; then
    40         echo $TREE
     26    if [ ! -d ${PROGNAME}-${LFSVRS}/.git ]; then
    4127        git clone $GIT ${PROGNAME}-$LFSVRS >>$LOGDIR/$LOG 2>&1
    4228        if [ ! $TREE == "development" ]; then
     
    4834    else
    4935      cd ${PROGNAME}-$LFSVRS
    50       case $PROGNAME in
    51         clfs*)
    52           # If the repo is in "detached head" state, git pull fails, so get
    53           # back first to master:
    54           git checkout master >>$LOGDIR/$LOG 2>&1
    55           git pull >>$LOGDIR/$LOG 2>&1
    56               if [ ! $TREE == "development" ]; then
    57                  git checkout ${TREE} >>$LOGDIR/$LOG 2>&1
    58               fi
    59         ;;
    60         lfs | hlfs) svn up >>$LOGDIR/$LOG 2>&1 ;;
    61         *) ;;
    62       esac
     36      # If the repo is in "detached head" state, git pull fails, so get
     37      # back first to master:
     38      git checkout trunk >>$LOGDIR/$LOG 2>&1
     39      git pull >>$LOGDIR/$LOG 2>&1
     40      if [ ! $TREE == "development" ]; then
     41         git checkout ${TREE} >>$LOGDIR/$LOG 2>&1
     42      fi
    6343    fi
    6444    echo -ne "done\n"
Note: See TracChangeset for help on using the changeset viewer.