[rtems-testing commit] merge-helpers: Delete old CVS based scripts

Joel Sherrill joel at rtems.org
Fri Mar 18 20:53:29 UTC 2016


Module:    rtems-testing
Branch:    master
Commit:    692f17892d3748c272ac170bddd943feb5b28cec
Changeset: http://git.rtems.org/rtems-testing/commit/?id=692f17892d3748c272ac170bddd943feb5b28cec

Author:    Joel Sherrill <joel at rtems.org>
Date:      Wed Mar 16 15:13:39 2016 -0500

merge-helpers: Delete old CVS based scripts

---

 merge-helpers/Makefile                   |   3 -
 merge-helpers/commit                     | 198 -------------------------------
 merge-helpers/commit-with-changelog-diff |  14 ---
 merge-helpers/mkChangeLogList            | 182 ----------------------------
 4 files changed, 397 deletions(-)

diff --git a/merge-helpers/Makefile b/merge-helpers/Makefile
index 9835a21..63cadba 100644
--- a/merge-helpers/Makefile
+++ b/merge-helpers/Makefile
@@ -1,8 +1,5 @@
 INSTALL_DIR=../bin
 SCRIPTS  = check_submission
-SCRIPTS += commit-with-changelog-diff
-SCRIPTS += commit
-SCRIPTS += mkChangeLogList
 SCRIPTS += prepend
 
 all: prep ${SCRIPTS} install
diff --git a/merge-helpers/commit b/merge-helpers/commit
deleted file mode 100755
index 1f9b473..0000000
--- a/merge-helpers/commit
+++ /dev/null
@@ -1,198 +0,0 @@
-#! /bin/sh
-#
-#  Recurse from current directory assisting in generating ChangeLog entries
-#  and committing files to the Source Code Repository.
-#
-#   TODO:  
-#     + Currently supports CVS and git. Could add svn
-#
-
-progname=${0##*/}
-usage()
-{
-  echo "$progname [-dlq] [-e editor] [-u user] [-m message] [-M msgfile]"
-  echo "options:"
-  echo "  -d         .. debug, don't delete change files";
-  echo "  -q         .. quiet, don't display directories";
-  echo "  -l         .. local directory only";
-  echo "  -m message .. text to use for modified files";
-  echo "  -M msgfile .. file containing to use for modified files";
-  echo "  -u user    .. use user instead of LOGNAME";
-  echo "  -U user    .. use explicit user info -- not from passwd";
-  echo "  -p PR      .. PR info";
-  echo "  -c CID     .. Coverity Id number";
-  echo
-  exit 1
-}
-
-# Determine VCS in use
-isgit()
-{
-  depth=0
-  dir=.git
-  while [ $depth -lt 10 ]
-  do
-    if [ -d ${dir} ] ; then
-      return 1
-    fi
-    dir=../${dir}
-    depth=`expr ${depth} + 1`
-  done  
-  return 0
-}
-
-isgit
-if [ $? -eq 1 ] ; then
-  VCS=git
-elif [ -d CVS ] ; then
-  VCS=cvs
-else
-  echo "This does not look like a checkout from a VCS I understand."
-  exit 1
-fi
-
-editor="vim"
-changefile="changes-xxx"
-rem_changes="yes"
-quiet="no"
-user=$LOGNAME
-mkchoptions="-n"
-message=
-localdir="no"
-while getopts dlqe:M:m:u:U:p:c: OPT
-do
-  case "$OPT" in 
-    d) rem_changes="yes" ;;
-    e) editor=$OPTARG ;;
-    l) localdir="yes" ;;
-    m) message=$OPTARG ;; 
-    M) message=`cat $OPTARG` ;; 
-    q) quiet="yes" ;;
-    u) user=$OPTARG ; mkchoptions=${mkchoptions}" -u ${user}" ;;
-    U) userArg="-U" userInfo=$OPTARG ;;
-    p) PrInfo=$OPTARG ; mkchoptions=${mkchoptions}" -p ${PrInfo}" ;;
-    c) CoverityInfo=$OPTARG ; mkchoptions=${mkchoptions}" -c ${CoverityInfo}" ;;
-    *) usage ;;
-  esac
-done
-
-export message
-let $((shiftcount = $OPTIND - 1))
-shift #shiftcount
-
-args=$*
-
-# find ChangeLogs and print them by depth
-get_subdirs()
-{
-  find . -name ChangeLog | while read f
-  do
-    case $1 in
-      */*/*/*/*/*/*/*/*/*) d=9 ;;
-      */*/*/*/*/*/*/*/*) d=8 ;;
-      */*/*/*/*/*/*/*) d=7 ;;
-      */*/*/*/*/*/*) d=6 ;;
-      */*/*/*/*/*) d=5 ;;
-      */*/*/*/*) d=4 ;;
-      */*/*/*) d=3 ;;
-      */*/*) d=2 ;;
-      */*) d=1 ;;
-      *) d=0 ;;
-    esac
-    echo ${d} ${f}
-  done | sort -n -r | cut -d' ' -f2- | while read f
-  do
-    dirname $f
-  done
-}
-if [ ${localdir} = "yes" ] ; then
-  subdirs="."
-else
-  subdirs=`get_subdirs`
-fi
-
-# Make sure we have user information
-if test "X${userInfo}" = "X" ; then
-  user_name=`grep ^${user} /etc/passwd | cut -d':' -f5 | cut -d',' -f1`
-  if test "X${user_name}" = "X" ; then
-    echo "User information not set"
-    usage
-  fi
-fi
-
-commit_helper()
-{
-  if [ $? -ne 0 ] ; then
-    return
-  fi
-
-  prepend ${changefile}
-
-  # Specify VCS support directory
-  case ${VCS} in
-    cvs)
-      ${CVS} up ChangeLog
-      cvs commit -F ${changefile}
-      ;;
-    git)
-      echo "git commit -F ${changefile}"
-      git add ${changefile} 
-      git commit -F ${changefile}
-      ;;
-    *) echo "${VCS} to be implemented" ;  exit 1 ;;
-  esac
-}
-
-# Specify VCS support directory
-case ${VCS} in
-  cvs) VCSDIR=CVS ;;
-  git) VCSDIR=.git ;;
-  *)
-    echo "${VCS} to be implemented"
-    exit 1
-    ;;
-esac
-
-for ddir in ${subdirs} ; do
-  test "${ddir}" = "${VCSDIR}" && continue
-  test "${ddir}" = "autom4te.cache" && continue
-  test "${ddir}" = "install" && continue
-  if [ -d "${ddir}" ]; then
-    case ${VCS} in
-      cvs) 
-	if [ ! -d "${ddir}/${VCSDIR}" ] ; then
-	  echo "WARNING - ${ddir} is not in .git"
-	  continue
-	fi
-        ;;
-      git)
-        ;;
-      *)
-        echo "${VCS} to be implemented"
-        exit 1
-        ;;
-    esac
-    test -f "${ddir}/ChangeLog" || continue
-    cd "$ddir" >/dev/null
-    mkChangeLogList ${mkchoptions} ${userArg} "${userInfo}" \
-          -m "${message}" >${changefile}
-    test $? -ne 0 && continue 
-    while test -s ${changefile} ; do
-      fullpath=`pwd`
-      test "$quiet" = "no" && echo "** directory: $fullpath **"
-      cat ${changefile}
-      response="n"
-      read -p "Commit changes? [y/n/e(edit)]: " response
-      case ${response} in
-        y) commit_helper; break ;;
-        n) break ;;
-        e) ${editor} ${changefile} ;;
-        *) echo "*** enter y,n, or e ***" ;;
-      esac
-    done
-    test $rem_changes = "yes" && rm -rf $changefile
-    cd - >/dev/null
-  fi
-done
-
-
diff --git a/merge-helpers/commit-with-changelog-diff b/merge-helpers/commit-with-changelog-diff
deleted file mode 100755
index f1bf5e5..0000000
--- a/merge-helpers/commit-with-changelog-diff
+++ /dev/null
@@ -1,14 +0,0 @@
-#! /bin/sh
-
-if [ ! -r ChangeLog ] ; then
-  echo "ERROR: No ChangeLog in current directory."
-  exit 1
-fi
-
-cvs diff -u ChangeLog| grep  ^+ | \
-  sed -e '/^+++/d' -e 's/^+ //' -e 's/^+//' >ch
-cat ch
-
-cvs commit -F ch
-rm -f ch
-exit 0
diff --git a/merge-helpers/mkChangeLogList b/merge-helpers/mkChangeLogList
deleted file mode 100755
index a97bb28..0000000
--- a/merge-helpers/mkChangeLogList
+++ /dev/null
@@ -1,182 +0,0 @@
-#! /bin/sh
-#
-#   Use git from the current directory and put the file names
-#   in suitable format for use in a ChangeLog.
-#
-#   TODO:  Initial conversion from cvs
-#
-
-mklog_()
-{
-  cat >XXX
-  if test `cat XXX | wc -l` -ne 0 ; then
-    (cat XXX | cut -d':' -f2 | \
-    sed -e '$!s/$/,/' -e '$s/$/:/' ; \
-    test $? -ne 0 || echo "$*" )| \
-    xargs -s80 | sed -e '1s/^/	\* /' -e '2,$s/^/	/' 
-  fi
-  rm -f XXX
-}
-
-progname=${0##*/}
-usage()
-{
-  echo "$progname [-ln] [-u user] [-U user_information] [-m message] [-M msgfile]"
-  exit 1
-}
-
-print_name="no"
-user=$LOGNAME
-git_local_arg=""
-basedir=.
-while getopts d:lnM:m:p:c:u:U: OPT
-do
-  case "$OPT" in 
-    d) basedir=$OPTARG ;;
-    l) git_local_arg="-l" ;;
-    n) print_name="yes" ;;
-    p) prnum=$OPTARG ;;
-    c) coverity_num=$OPTARG ;;
-    m) message=$OPTARG ;; 
-    M) message=`cat $OPTARG` ;; 
-    u) user=$OPTARG ; print_name="yes" ;;
-    U) user_name=$OPTARG ; print_name="yes" ;;
-    *) usage ;;
-  esac
-done
-
-let $((shiftcount = $OPTIND - 1))
-shift #shiftcount
-
-args=$*
-
-dirarg="${basedir}"
-
-# Determine VCS in use
-isgit()
-{
-  depth=0
-  dir=.git
-  while [ $depth -lt 10 ]
-  do
-    if [ -d ${dir} ] ; then
-      return 1
-    fi
-    dir=../${dir}
-    depth=`expr ${depth} + 1`
-  done  
-  return 0
-}
-
-isgit
-if [ $? -eq 1 ] ; then
-  VCS=git
-elif [ -d CVS ] ; then
-  VCS=cvs
-else
-  echo "This does not look like a checkout from a VCS I understand."
-  exit 1
-fi
-
-if [ ! -r ChangeLog ] ; then
-  ( echo "There is no ChangeLog in this directory." ;
-    echo "Where are you putting the entry?" )>/dev/stderr
-  exit 1
-fi
-
-case ${VCS} in
-  cvs)
-    # done parsing arguments, now work 
-    if [ "X${CVSROOT}" = "X" ] ; then
-      CVS=cvs
-    else
-      CVS="cvs -d ${CVSROOT}"
-    fi
-    CVS="${CVS}"
-
-    files_modded=`${CVS} diff ${dirarg} 2>&1 | grep ^Index | wc -l`
-    files_added=`${CVS} diff ${dirarg} 2>&1 | grep "is a new entry, no " | wc -l`
-    files_deleted=`${CVS} diff ${dirarg} 2>&1 | grep " was removed, no " | wc -l`
-    ;;
-  git)
-    files_modded=`git status ${dirarg} 2>&1 | grep "modified: " | wc -l`
-    files_added=`git status ${dirarg} 2>&1 | grep "new file: " | wc -l`
-    files_deleted=0
-    #files_deleted=`${CVS} diff ${dirarg} 2>&1 | grep " was removed, no " | wc -l`
-    ;;
-  *)
-    echo "${VCS} to be implemented"
-    exit 1
-    ;;
-esac
-
-files_changed=`expr ${files_modded} + ${files_added} + ${files_deleted}`
-if test ${files_changed} -eq 0 ; then
-  exit 0
-fi
-
-if test ${print_name} = "yes" ; then
-  if test "X${user_name}" = "X" ; then
-    if test "X${user}" = "X" ; then
-      echo "User not specified (LOGNAME not set or no -u option)"
-      usage
-    fi
-
-    user_name=`grep ^${user} /etc/passwd | cut -d':' -f5 | cut -d',' -f1`
-    if test "X${user_name}" = "X" ; then
-      echo "User information not set"
-      usage
-    fi
-  fi
-
-  date=`date +%Y-%m-%d`
-  echo "${date}	${user_name}"
-  echo
-fi
-
-if test "X${prnum}" != "X" ; then
-  echo "	PR ${prnum}"
-fi
-if test "X${coverity_num}" != "X" ; then
-  echo "	Coverity Id ${coverity_num}"
-fi
-
-case ${VCS} in
-  cvs)
-    # Generate list of modified files
-    ${CVS} diff ${dirarg} 2>/dev/null | grep ^Index | mklog_ ${message}
-
-    # Generate list of deleted files
-    test ${files_added} -gt 1 && plural=s
-    ${CVS} diff ${dirarg} 2>&1 | grep "is a new entry, no comparison" | \
-      sed -e 's/^.*: //' -e 's/ is a .*$//' | mklog_ "New file${plural}."
-
-    # Generate list of removed files
-    ${CVS} diff ${dirarg} 2>&1 | grep "was removed, no comparison" | \
-      sed -e 's/^.*: //' -e 's/ was removed, no comparison.*$//' | \
-      mklog_ Removed.
-    ;;
-  git)
-    # Generate list of modified files
-    git status 2>&1 | grep "modified: " | mklog_ ${message}
-
-    # Generate list of deleted files
-    test ${files_added} -gt 1 && plural=s
-    git status 2>&1 | grep "new file: " | \
-      sed -e 's/^.*: //' -e 's/ is a .*$//' | mklog_ "New file${plural}."
-
-    # Generate list of removed files
-    #${CVS} diff ${dirarg} 2>&1 | grep "was removed, no comparison" | \
-    #  sed -e 's/^.*: //' -e 's/ was removed, no comparison.*$//' | \
-    #  mklog_ Removed.
-    ;;
-  *)
-    echo "${VCS} to be implemented"
-    exit 1
-    ;;
-esac
-
-echo
-
-# rm -f XXX
-exit 0




More information about the vc mailing list