OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc4/] [contrib/] [reghunt/] [bin/] [gcc-svn-update-fix] - Diff between revs 265 and 519

Only display areas with differences | Details | Blame | View Log

Rev 265 Rev 519
#! /bin/bash
#! /bin/bash
#set -ex
#set -ex
# Update an SVN tree for a particular date.
# Update an SVN tree for a particular date.
if [ $# != 1 ]; then
if [ $# != 1 ]; then
  echo Usage: $0 id
  echo Usage: $0 id
  exit 1
  exit 1
fi
fi
if [ "x${REG_DO_CLEANUPS}" != "x" ]; then
if [ "x${REG_DO_CLEANUPS}" != "x" ]; then
  reg_cleanup
  reg_cleanup
fi
fi
ID=$1
ID=$1
BRANCH=""
BRANCH=""
########################################################################
########################################################################
# Get sources.
# Get sources.
########################################################################
########################################################################
svn_get() {
svn_get() {
  # In case there are problems with updates (there were with CVS),
  # In case there are problems with updates (there were with CVS),
  # creating a file called REMOVE in the REG_SRCDIR directory causes us
  # creating a file called REMOVE in the REG_SRCDIR directory causes us
  # to start with a clean tree each time.
  # to start with a clean tree each time.
  unset LC_ALL
  unset LC_ALL
  unset LANG
  unset LANG
  cd ${REG_SRCDIR}
  cd ${REG_SRCDIR}
  if [ -d gcc ]; then
  if [ -d gcc ]; then
    # There's already a tree; do an update with the new revision.
    # There's already a tree; do an update with the new revision.
    cd gcc
    cd gcc
    echo "`date`  svn update begun for id ${ID}, rev ${REV} (fix)"
    echo "`date`  svn update begun for id ${ID}, rev ${REV} (fix)"
    echo svn update --non-interactive --revision ${REV} >> $LOG
    echo svn update --non-interactive --revision ${REV} >> $LOG
    svn update --non-interactive --revision ${REV} >> $LOG
    svn update --non-interactive --revision ${REV} >> $LOG
    if [ $? -eq 0 ]; then
    if [ $? -eq 0 ]; then
      echo "`date`  svn update done"
      echo "`date`  svn update done"
    else
    else
      echo "`date`  svn update failed"
      echo "`date`  svn update failed"
      exit 1
      exit 1
    fi
    fi
  else
  else
    echo "`date`  svn checkout begun for id ${ID}, rev ${REV}"
    echo "`date`  svn checkout begun for id ${ID}, rev ${REV}"
    echo svn checkout --non-interactive --revision ${REV} \
    echo svn checkout --non-interactive --revision ${REV} \
      ${REG_SVN_REPO}/${BRANCHPATH} gcc >> $LOG
      ${REG_SVN_REPO}/${BRANCHPATH} gcc >> $LOG
    svn checkout --non-interactive --revision ${REV} \
    svn checkout --non-interactive --revision ${REV} \
      ${REG_SVN_REPO}/${BRANCHPATH} gcc >> $LOG
      ${REG_SVN_REPO}/${BRANCHPATH} gcc >> $LOG
    if [ $? -eq 0 ]; then
    if [ $? -eq 0 ]; then
      echo "`date`  svn checkout done"
      echo "`date`  svn checkout done"
    else
    else
      echo "`date`  svn checkout failed"
      echo "`date`  svn checkout failed"
      exit 1
      exit 1
    fi
    fi
    cd gcc
    cd gcc
  fi
  fi
  # Touch generated files.
  # Touch generated files.
  contrib/gcc_update --touch >> $LOG
  contrib/gcc_update --touch >> $LOG
}
}
########################################################################
########################################################################
# Main program
# Main program
########################################################################
########################################################################
cd ${REG_SRCDIR}
cd ${REG_SRCDIR}
# This is a simple way to stop a long regression search fairly cleanly;
# This is a simple way to stop a long regression search fairly cleanly;
# just touch a file called STOP.
# just touch a file called STOP.
if [ -f STOP ]; then
if [ -f STOP ]; then
  echo "`date`  $0 detected STOP file"
  echo "`date`  $0 detected STOP file"
  rm -f STOP
  rm -f STOP
  exit 1
  exit 1
fi
fi
# Set up the log file.
# Set up the log file.
REV=`${REG_IDS} -f index -t rev ${ID}`
REV=`${REG_IDS} -f index -t rev ${ID}`
LOG=${REG_SRCDIR}/logs/${BUGID}/${REV}.log
LOG=${REG_SRCDIR}/logs/${BUGID}/${REV}.log
mkdir -p ${REG_SRCDIR}/logs/${BUGID}
mkdir -p ${REG_SRCDIR}/logs/${BUGID}
rm -f $LOG
rm -f $LOG
touch $LOG
touch $LOG
# Get the branch for this patch.
# Get the branch for this patch.
BRANCH=`${REG_IDS} -f index -t branch ${ID}`
BRANCH=`${REG_IDS} -f index -t branch ${ID}`
if [ "${BRANCH}" = "error" ]; then
if [ "${BRANCH}" = "error" ]; then
  echo "`date`  $0: cannot determine the SVN branch for id ${ID}"
  echo "`date`  $0: cannot determine the SVN branch for id ${ID}"
  exit 1
  exit 1
fi
fi
if [ "${BRANCH}" = "trunk" ]; then
if [ "${BRANCH}" = "trunk" ]; then
  BRANCHPATH=trunk
  BRANCHPATH=trunk
else
else
  BRANCHPATH=branches/${BRANCH}
  BRANCHPATH=branches/${BRANCH}
fi
fi
svn_get
svn_get
# Look for a patch that's needed for this revision to build.
# Look for a patch that's needed for this revision to build.
FIX=${REG_PATCHES}/${REV}.fix
FIX=${REG_PATCHES}/${REV}.fix
echo "`date`  looking for $FIX"
echo "`date`  looking for $FIX"
if [ -f $FIX ]; then
if [ -f $FIX ]; then
  echo "`date`  fix needed; checking whether it is already applied"
  echo "`date`  fix needed; checking whether it is already applied"
  cd ${REG_SRCDIR}/gcc
  cd ${REG_SRCDIR}/gcc
  patch --dry-run -s -p0 -i $FIX < /dev/null > /dev/null 2>&1
  patch --dry-run -s -p0 -i $FIX < /dev/null > /dev/null 2>&1
  if [ $? -eq 0 ]; then
  if [ $? -eq 0 ]; then
    echo "`date`  applying fix"
    echo "`date`  applying fix"
    patch -s -p0 -i $FIX
    patch -s -p0 -i $FIX
  fi
  fi
fi
fi
exit 0
exit 0
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.