Changeset e6a5d77 in rtems-testing


Ignore:
Timestamp:
Jan 14, 2012, 8:18:10 AM (7 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, 8895273c193787f84c4585a10f6d6aceb3b25dc4
Children:
3f62108
Parents:
6dff99a
Message:

Update to add initial support for git.

Files:
4 edited
1 moved

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r6dff99a re6a5d77  
     12012-01-14      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * README, cvs-helpers/Makefile, cvs-helpers/mkChangeLogList,
     4        cvs-helpers/mkChangeLogList: Update to add initial support for git.
     5
    162011-08-21      Jie Liu <lj8175@gmail.com>
    27
  • README

    r6dff99a re6a5d77  
    55This package contains a collection of scripts and support files
    66that support running the GCC (http://gcc.gnu.org) testsuite for
    7 C, C++, Ada.
     7C, C++, Ada, FORTRAN, GCJ, Go, and Objective-C.
    88
    99This testing environment is used on the GCC Compile Farm as well
  • cvs-helpers/Makefile

    r6dff99a re6a5d77  
    11#
    2 #  $Id$
     2#  $Id: Makefile,v 1.3 2010/06/21 12:37:03 joel Exp $
    33#
    44
    55INSTALL_DIR=../bin
    6 SCRIPTS=commit-with-changelog-diff cvscommit mkChangeLogList prepend mktest
     6SCRIPTS=commit-with-changelog-diff commit mkChangeLogList prepend mktest
    77
    88all: prep ${SCRIPTS} install
  • cvs-helpers/commit

    r6dff99a re6a5d77  
    11#! /bin/sh
    22#
    3  Do a cvs diff from the current directory and put the file names
    4  in suitable format for use in a ChangeLog.
     3Recurse from current directory assisting in generating ChangeLog entries
     4and committing files to the Source Code Repository.
    55#
    6 #   TODO:  No outstanding isses.
     6#   TODO: 
     7#     + Currently supports CVS and git. Could add svn
    78#
    8 #  $Id$
    9 #
    10 
    119
    1210progname=${0##*/}
     
    2826}
    2927
    30 if [ ! -d CVS ] ; then
    31   echo There is no CVS directory in the current directory.
     28# Determine VCS in use
     29if [ -d .git ] ; then
     30  VCS=git
     31elif [ -d CVS ] ; then
     32  VCS=cvs
     33else
     34  echo "This does not look like a checkout from a VCS I understand."
    3235  exit 1
    3336fi
     
    6467args=$*
    6568
    66 # done parsing arguments, now work
    67 if [ "X${CVSROOT}" = "X" ] ; then
    68   CVS=cvs
    69 else
    70   CVS="cvs -d ${CVSROOT}"
    71 fi
    72 
    73 CVS="${CVS}"
    74 
     69# find ChangeLogs and print them by depth
     70get_subdirs()
     71{
     72  find . -name ChangeLog | while read f
     73  do
     74    case $1 in
     75      */*/*/*/*/*/*/*/*/*) d=9 ;;
     76      */*/*/*/*/*/*/*/*) d=8 ;;
     77      */*/*/*/*/*/*/*) d=7 ;;
     78      */*/*/*/*/*/*) d=6 ;;
     79      */*/*/*/*/*) d=5 ;;
     80      */*/*/*/*) d=4 ;;
     81      */*/*/*) d=3 ;;
     82      */*/*) d=2 ;;
     83      */*) d=1 ;;
     84      *) d=0 ;;
     85    esac
     86    echo ${d} ${f}
     87  done | sort -n -r | cut -d' ' -f2- | while read f
     88  do
     89    dirname $f
     90  done
     91}
    7592if [ ${localdir} = "yes" ] ; then
    7693  subdirs="."
    7794else
    78   subdirs="* ."
     95  subdirs=`get_subdirs`
    7996fi
    8097
     
    90107commit()
    91108{
    92   ${CVS} up ChangeLog
    93   if [ $? -eq 0 ] ; then
    94     prepend ${changefile}
    95     cvs commit -F ${changefile}
     109  if [ $? -ne 0 ] ; then
     110    return
    96111  fi
     112
     113  prepend ${changefile}
     114
     115  # Specify VCS support directory
     116  case ${VCS} in
     117    cvs)
     118      ${CVS} up ChangeLog
     119      cvs commit -F ${changefile}
     120      ;;
     121    git)
     122      echo "git commit -F ${changefile}"
     123      git commit -a -F ${changefile}
     124      ;;
     125    *) echo "${VCS} to be implemented" ;  exit 1 ;;
     126  esac
    97127}
    98128
     129# Specify VCS support directory
     130case ${VCS} in
     131  cvs) VCSDIR=CVS ;;
     132  git) VCSDIR=.git ;;
     133  *)
     134    echo "${VCS} to be implemented"
     135    exit 1
     136    ;;
     137esac
     138
    99139for ddir in ${subdirs} ; do
    100   test "${ddir}" = "CVS" && continue
     140  test "${ddir}" = "${VCSDIR}" && continue
    101141  test "${ddir}" = "autom4te.cache" && continue
    102142  test "${ddir}" = "install" && continue
    103143  if [ -d "${ddir}" ]; then
    104     if [ ! -d "${ddir}/CVS" ] ; then
    105       echo "WARNING - ${ddir} is not in CVS"
     144    if [ ! -d "${ddir}/${VCSDIR}" ] ; then
     145      echo "WARNING - ${ddir} is not in .git"
    106146      continue
    107147    fi
  • cvs-helpers/mkChangeLogList

    r6dff99a re6a5d77  
    11#! /bin/sh
    22#
    3 #   Do a cvs diff from the current directory and put the file names
     3#   Use git from the current directory and put the file names
    44#   in suitable format for use in a ChangeLog.
    55#
    6 #   TODO:  No outstanding isses.
     6#   TODO:  Initial conversion from cvs
    77#
    8 #  $Id$
     8#  $Id: mkChangeLogList,v 1.6 2011/01/04 19:53:53 joel Exp $
    99#
    1010
     
    3030print_name="no"
    3131user=$LOGNAME
    32 cvs_local_arg=""
     32git_local_arg=""
    3333basedir=.
    3434while getopts d:lnM:m:p:c:u:U: OPT
     
    3636  case "$OPT" in
    3737    d) basedir=$OPTARG ;;
    38     l) cvs_local_arg="-l" ;;
     38    l) git_local_arg="-l" ;;
    3939    n) print_name="yes" ;;
    4040    p) prnum=$OPTARG ;;
     
    5353args=$*
    5454
    55 cvsarg="${cvs_local_arg} ${basedir}"
     55dirarg="${basedir}"
    5656
    57 if [ -d .svn ] ; then
    58   CVS=svn
     57# Determine VCS in use
     58if [ -d .git ] ; then
     59  VCS=git
    5960elif [ -d CVS ] ; then
    60   cmd=cvs
    61   # done parsing arguments, now work
    62   if [ "X${CVSROOT}" = "X" ] ; then
    63     CVS=${cmd}
    64   else
    65     CVS="${cmd} -d ${CVSROOT}"
    66   fi
     61  VCS=cvs
    6762else
    68   echo "This does not look like a CVS or SVN checkout."
     63  echo "This does not look like a checkout from a VCS I understand."
    6964  exit 1
    7065fi
    71 
    72 CVS="${CVS}"
    7366
    7467if [ ! -r ChangeLog ] ; then
     
    7871fi
    7972
    80 files_modded=`${CVS} diff ${cvsarg} 2>&1 | grep ^Index | wc -l`
    81 files_added=`${CVS} diff ${cvsarg} 2>&1 | grep "is a new entry, no " | wc -l`
    82 files_deleted=`${CVS} diff ${cvsarg} 2>&1 | grep " was removed, no " | wc -l`
     73case ${VCS} in
     74  cvs)
     75    # done parsing arguments, now work
     76    if [ "X${CVSROOT}" = "X" ] ; then
     77      CVS=cvs
     78    else
     79      CVS="cvs -d ${CVSROOT}"
     80    fi
     81    CVS="${CVS}"
     82
     83    files_modded=`${CVS} diff ${dirarg} 2>&1 | grep ^Index | wc -l`
     84    files_added=`${CVS} diff ${dirarg} 2>&1 | grep "is a new entry, no " | wc -l`
     85    files_deleted=`${CVS} diff ${dirarg} 2>&1 | grep " was removed, no " | wc -l`
     86    ;;
     87  git)
     88    files_modded=`git status ${dirarg} 2>&1 | grep "modified: " | wc -l`
     89    files_added=`git status ${dirarg} 2>&1 | grep "new file: " | wc -l`
     90    files_deleted=0
     91    #files_deleted=`${CVS} diff ${dirarg} 2>&1 | grep " was removed, no " | wc -l`
     92    ;;
     93  *)
     94    echo "${VCS} to be implemented"
     95    exit 1
     96    ;;
     97esac
     98
    8399files_changed=`expr ${files_modded} + ${files_added} + ${files_deleted}`
    84100if test ${files_changed} -eq 0 ; then
     
    112128fi
    113129
    114 # Generate list of modified files
    115 ${CVS} diff ${cvsarg} 2>/dev/null | grep ^Index | mklog_ ${message}
     130case ${VCS} in
     131  cvs)
     132    # Generate list of modified files
     133    ${CVS} diff ${dirarg} 2>/dev/null | grep ^Index | mklog_ ${message}
    116134
    117 # Generate list of deleted files
    118 test ${files_added} -gt 1 && plural=s
    119 ${CVS} diff ${cvsarg} 2>&1 | grep "is a new entry, no comparison" | \
    120   sed -e 's/^.*: //' -e 's/ is a .*$//' | mklog_ "New file${plural}."
     135    # Generate list of deleted files
     136    test ${files_added} -gt 1 && plural=s
     137    ${CVS} diff ${dirarg} 2>&1 | grep "is a new entry, no comparison" | \
     138      sed -e 's/^.*: //' -e 's/ is a .*$//' | mklog_ "New file${plural}."
    121139
    122 # Generate list of removed files
    123 ${CVS} diff ${cvsarg} 2>&1 | grep "was removed, no comparison" | \
    124   sed -e 's/^.*: //' -e 's/ was removed, no comparison.*$//' | \
    125   mklog_ Removed.
     140    # Generate list of removed files
     141    ${CVS} diff ${dirarg} 2>&1 | grep "was removed, no comparison" | \
     142      sed -e 's/^.*: //' -e 's/ was removed, no comparison.*$//' | \
     143      mklog_ Removed.
     144    ;;
     145  git)
     146    # Generate list of modified files
     147    git status 2>&1 | grep "modified: " | mklog_ ${message}
     148
     149    # Generate list of deleted files
     150    test ${files_added} -gt 1 && plural=s
     151    git status 2>&1 | grep "new file: " | \
     152      sed -e 's/^.*: //' -e 's/ is a .*$//' | mklog_ "New file${plural}."
     153
     154    # Generate list of removed files
     155    #${CVS} diff ${dirarg} 2>&1 | grep "was removed, no comparison" | \
     156    #  sed -e 's/^.*: //' -e 's/ was removed, no comparison.*$//' | \
     157    #  mklog_ Removed.
     158    ;;
     159  *)
     160    echo "${VCS} to be implemented"
     161    exit 1
     162    ;;
     163esac
     164
    126165echo
    127166
    128 rm -f XXX
     167# rm -f XXX
    129168exit 0
Note: See TracChangeset for help on using the changeset viewer.